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: <Z4TzbELIPJFinj66@localhost.localdomain>
Date: Mon, 13 Jan 2025 12:05:16 +0100
From: Oscar Salvador <osalvador@...e.de>
To: Peter Xu <peterx@...hat.com>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	Breno Leitao <leitao@...ian.org>, Rik van Riel <riel@...riel.com>,
	Muchun Song <muchun.song@...ux.dev>,
	Naoya Horiguchi <nao.horiguchi@...il.com>,
	Roman Gushchin <roman.gushchin@...ux.dev>,
	Ackerley Tng <ackerleytng@...gle.com>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v2 2/7] mm/hugetlb: Stop using avoid_reserve flag in
 fork()

On Tue, Jan 07, 2025 at 03:39:57PM -0500, Peter Xu wrote:
> When fork() and stumble on top of a dma-pinned hugetlb private page, CoW
> must happen during fork() to guarantee dma coherency.
> 
> In this specific path, hugetlb pages need to be allocated for the child
> process.  Stop using avoid_reserve=1 flag here: it's not required to be
> used here, as dest_vma (which is destined to be a MAP_PRIVATE hugetlb vma)
> will have no private vma resv map, and that will make sure it won't be able
> to use a vma reservation later.
> 
> No functional change intended with this change.  Said that, it's still
> wanted to do this, so as to reduce the usage of avoid_reserve to the only
> one user, which is also why this flag was introduced initially in commit
> 04f2cbe35699 ("hugetlb: guarantee that COW faults for a process that called
> mmap(MAP_PRIVATE) on hugetlbfs will succeed").  I don't see whoever else
> should set it at all.
> 
> Further patch will clean up resv accounting based on this.
> 
> Signed-off-by: Peter Xu <peterx@...hat.com>

Reviewed-by: Oscar Salvador <osalvador@...e.de>


-- 
Oscar Salvador
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ