lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250722030431.56507-1-sj@kernel.org>
Date: Mon, 21 Jul 2025 20:04:31 -0700
From: SeongJae Park <sj@...nel.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: SeongJae Park <sj@...nel.org>,
	Honggyu Kim <honggyu.kim@...com>,
	Hyeongtak Ji <hyeongtak.ji@...com>,
	damon@...ts.linux.dev,
	linux-kernel@...r.kernel.org,
	linux-mm@...ck.org,
	stable@...r.kernel.org
Subject: Re: [PATCH] mm/damon/ops-common: ignore migration request to invalid nodes

On Mon, 21 Jul 2025 19:56:58 -0700 Andrew Morton <akpm@...ux-foundation.org> wrote:

> On Sun, 20 Jul 2025 11:58:22 -0700 SeongJae Park <sj@...nel.org> wrote:
> 
[...]
> > Add a target node validity check in damon_migrate_pages().  The validity
> > check is stolen from that of do_pages_move(), which is being used for
> > move_pages() system call.
> > 
> > Fixes: b51820ebea65 ("mm/damon/paddr: introduce DAMOS_MIGRATE_COLD action for demotion") # 6.11.x
> > Cc: stable@...r.kernel.org
> >
> > ...
> >
> > --- a/mm/damon/ops-common.c
> > +++ b/mm/damon/ops-common.c
> > @@ -383,6 +383,10 @@ unsigned long damon_migrate_pages(struct list_head *folio_list, int target_nid)
> >  	if (list_empty(folio_list))
> >  		return nr_migrated;
> >  
> > +	if (target_nid < 0 || target_nid >= MAX_NUMNODES ||
> > +			!node_state(target_nid, N_MEMORY))
> > +		return nr_migrated;
> > +
> >  	noreclaim_flag = memalloc_noreclaim_save();
> >  
> >  	nid = folio_nid(lru_to_folio(folio_list));
> > 
> 
> OK.  damon_migrate_pages() exists only in mm.git thanks to 13dde31db71f
> ("mm/damon: move migration helpers from paddr to ops-common").  I
> assume that you'll send the -stable people a patch which adds this check into
> damon_pa_migrate_pages() when called upon to do so.

That's very correct, Andrew.  I am planning to do so as soon as this is merged
into the mainline :)


Thanks,
SJ

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ