Commit 85eba5f1 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'mm-hotfixes-stable-2023-09-23-10-31' of...

Merge tag 'mm-hotfixes-stable-2023-09-23-10-31' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull misc fixes from Andrew Morton:
 "13 hotfixes, 10 of which pertain to post-6.5 issues. The other three
  are cc:stable"

* tag 'mm-hotfixes-stable-2023-09-23-10-31' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
  proc: nommu: fix empty /proc/<pid>/maps
  filemap: add filemap_map_order0_folio() to handle order0 folio
  proc: nommu: /proc/<pid>/maps: release mmap read lock
  mm: memcontrol: fix GFP_NOFS recursion in memory.high enforcement
  pidfd: prevent a kernel-doc warning
  argv_split: fix kernel-doc warnings
  scatterlist: add missing function params to kernel-doc
  selftests/proc: fixup proc-empty-vm test after KSM changes
  revert "scripts/gdb/symbols: add specific ko module load command"
  selftests: link libasan statically for tests with -fsanitize=address
  task_work: add kerneldoc annotation for 'data' argument
  mm: page_alloc: fix CMA and HIGHATOMIC landing on the wrong buddy list
  sh: mm: re-add lost __ref to ioremap_prot() to fix modpost warning
parents 8565bdf8 fe441980
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ __ioremap_29bit(phys_addr_t offset, unsigned long size, pgprot_t prot)
#define __ioremap_29bit(offset, size, prot)		NULL
#endif /* CONFIG_29BIT */

void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size,
void __iomem __ref *ioremap_prot(phys_addr_t phys_addr, size_t size,
				 unsigned long prot)
{
	void __iomem *mapped;
+0 −2
Original line number Diff line number Diff line
@@ -289,9 +289,7 @@ struct proc_maps_private {
	struct inode *inode;
	struct task_struct *task;
	struct mm_struct *mm;
#ifdef CONFIG_MMU
	struct vma_iterator iter;
#endif
#ifdef CONFIG_NUMA
	struct mempolicy *task_mempolicy;
#endif
+37 −27
Original line number Diff line number Diff line
@@ -175,15 +175,28 @@ static int show_map(struct seq_file *m, void *_p)
	return nommu_vma_show(m, _p);
}

static void *m_start(struct seq_file *m, loff_t *pos)
static struct vm_area_struct *proc_get_vma(struct proc_maps_private *priv,
						loff_t *ppos)
{
	struct vm_area_struct *vma = vma_next(&priv->iter);

	if (vma) {
		*ppos = vma->vm_start;
	} else {
		*ppos = -1UL;
	}

	return vma;
}

static void *m_start(struct seq_file *m, loff_t *ppos)
{
	struct proc_maps_private *priv = m->private;
	unsigned long last_addr = *ppos;
	struct mm_struct *mm;
	struct vm_area_struct *vma;
	unsigned long addr = *pos;

	/* See m_next(). Zero at the start or after lseek. */
	if (addr == -1UL)
	/* See proc_get_vma(). Zero at the start or after lseek. */
	if (last_addr == -1UL)
		return NULL;

	/* pin the task and mm whilst we play with them */
@@ -192,44 +205,41 @@ static void *m_start(struct seq_file *m, loff_t *pos)
		return ERR_PTR(-ESRCH);

	mm = priv->mm;
	if (!mm || !mmget_not_zero(mm))
	if (!mm || !mmget_not_zero(mm)) {
		put_task_struct(priv->task);
		priv->task = NULL;
		return NULL;
	}

	if (mmap_read_lock_killable(mm)) {
		mmput(mm);
		put_task_struct(priv->task);
		priv->task = NULL;
		return ERR_PTR(-EINTR);
	}

	/* start the next element from addr */
	vma = find_vma(mm, addr);
	if (vma)
		return vma;
	vma_iter_init(&priv->iter, mm, last_addr);

	mmap_read_unlock(mm);
	mmput(mm);
	return NULL;
	return proc_get_vma(priv, ppos);
}

static void m_stop(struct seq_file *m, void *_vml)
static void m_stop(struct seq_file *m, void *v)
{
	struct proc_maps_private *priv = m->private;
	struct mm_struct *mm = priv->mm;

	if (!IS_ERR_OR_NULL(_vml)) {
		mmap_read_unlock(priv->mm);
		mmput(priv->mm);
	}
	if (priv->task) {
	if (!priv->task)
		return;

	mmap_read_unlock(mm);
	mmput(mm);
	put_task_struct(priv->task);
	priv->task = NULL;
}
}

static void *m_next(struct seq_file *m, void *_p, loff_t *pos)
static void *m_next(struct seq_file *m, void *_p, loff_t *ppos)
{
	struct vm_area_struct *vma = _p;

	*pos = vma->vm_end;
	return find_vma(vma->vm_mm, vma->vm_end);
	return proc_get_vma(m->private, ppos);
}

static const struct seq_operations proc_pid_maps_ops = {
+2 −2
Original line number Diff line number Diff line
@@ -920,7 +920,7 @@ unsigned long mem_cgroup_get_zone_lru_size(struct lruvec *lruvec,
	return READ_ONCE(mz->lru_zone_size[zone_idx][lru]);
}

void mem_cgroup_handle_over_high(void);
void mem_cgroup_handle_over_high(gfp_t gfp_mask);

unsigned long mem_cgroup_get_max(struct mem_cgroup *memcg);

@@ -1458,7 +1458,7 @@ static inline void mem_cgroup_unlock_pages(void)
	rcu_read_unlock();
}

static inline void mem_cgroup_handle_over_high(void)
static inline void mem_cgroup_handle_over_high(gfp_t gfp_mask)
{
}

+1 −1
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ static inline void resume_user_mode_work(struct pt_regs *regs)
	}
#endif

	mem_cgroup_handle_over_high();
	mem_cgroup_handle_over_high(GFP_KERNEL);
	blkcg_maybe_throttle_current();

	rseq_handle_notify_resume(NULL, regs);
Loading