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] [thread-next>] [day] [month] [year] [list]
Message-ID: <rtdubi5ewzrptvl25zcdg6ta46kcd6ixowaguftwo3rtmx5cz7@f4sj33igjuic>
Date: Tue, 14 Oct 2025 10:41:18 +0100
From: Pedro Falcato <pfalcato@...e.de>
To: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>, 
	"Liam R . Howlett" <Liam.Howlett@...cle.com>, Vlastimil Babka <vbabka@...e.cz>, Jann Horn <jannh@...gle.com>, 
	linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/mremap: correctly account old mapping after
 MREMAP_DONTUNMAP remap

On Mon, Oct 13, 2025 at 05:58:36PM +0100, Lorenzo Stoakes wrote:
> Commit b714ccb02a76 ("mm/mremap: complete refactor of move_vma()")
> mistakenly introduced a new behaviour - clearing the VM_ACCOUNT flag of the
> old mapping when a mapping is mremap()'d with the MREMAP_DONTUNMAP flag
> set.
> 
> While we always clear the VM_LOCKED and VM_LOCKONFAULT flags for the old
> mapping (the page tables have been moved, so there is no data that could
> possibly be locked in memor), there is no reason to touch any other VMA
                        memory
> flags.
> 
> This is because after the move the old mapping is in a state as if it were
> freshly mapped. This implies that the attributes of the mapping ought to
> remain the same, including whether or not the mapping is accounted.
> 
> Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>

Reviewed-by: Pedro Falcato <pfalcato@...e.de>

Looks good, thanks! Should we add a test for it?

-- 
Pedro

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ