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: <Zw4QHoPArxEQan0G@infradead.org>
Date: Mon, 14 Oct 2024 23:47:58 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
	Suren Baghdasaryan <surenb@...gle.com>,
	"Liam R . Howlett" <Liam.Howlett@...cle.com>,
	Matthew Wilcox <willy@...radead.org>,
	Vlastimil Babka <vbabka@...e.cz>,
	"Paul E . McKenney" <paulmck@...nel.org>,
	Jann Horn <jannh@...gle.com>, David Hildenbrand <david@...hat.com>,
	linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	Muchun Song <muchun.song@...ux.dev>,
	Richard Henderson <richard.henderson@...aro.org>,
	Ivan Kokshaysky <ink@...assic.park.msu.ru>,
	Matt Turner <mattst88@...il.com>,
	Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
	"James E . J . Bottomley" <James.Bottomley@...senpartnership.com>,
	Helge Deller <deller@....de>, Chris Zankel <chris@...kel.net>,
	Max Filippov <jcmvbkbc@...il.com>, Arnd Bergmann <arnd@...db.de>,
	linux-alpha@...r.kernel.org, linux-mips@...r.kernel.org,
	linux-parisc@...r.kernel.org, linux-arch@...r.kernel.org,
	Shuah Khan <shuah@...nel.org>,
	Christian Brauner <brauner@...nel.org>,
	linux-kselftest@...r.kernel.org,
	Sidhartha Kumar <sidhartha.kumar@...cle.com>
Subject: Re: [RFC PATCH 1/4] mm: pagewalk: add the ability to install PTEs

Hi Lorenzo,

sorry for only replying to this so late.

On Fri, Sep 27, 2024 at 01:51:11PM +0100, Lorenzo Stoakes wrote:
> The existing generic pagewalk logic permits the walking of page tables,
> invoking callbacks at individual page table levels via user-provided
> mm_walk_ops callbacks.
> 
> This is useful for traversing existing page table entries, but precludes
> the ability to establish new ones.
> 
> Existing mechanism for performing a walk which also installs page table
> entries if necessary are heavily duplicated throughout the kernel, each
> with semantic differences from one another and largely unavailable for use
> elsewhere.

I do like the idea of having common code for installing page tables!

Minor nits below:

> +int walk_page_range_mm(struct mm_struct *mm, unsigned long start,
>  		unsigned long end, const struct mm_walk_ops *ops,
>  		void *private)

It would be good to have a minimum level of documentation for this
function, including how it differs from walk_page_range and why
it should remain internal.

> +	/* For internal use only. */
> +	if (ops->install_pte)
> +		return -EINVAL;

And this should probably be expanded a bit, including that no exported
symbol should allow inserting arbitrary PTEs.  Maybe best done with
a helper to share that comment with the other places that have this
check.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ