[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aLhf7XdOO99IyRfA@arm.com>
Date: Wed, 3 Sep 2025 16:34:05 +0100
From: Catalin Marinas <catalin.marinas@....com>
To: Mark Brown <broonie@...nel.org>
Cc: "Rick P. Edgecombe" <rick.p.edgecombe@...el.com>,
Deepak Gupta <debug@...osinc.com>,
Szabolcs Nagy <Szabolcs.Nagy@....com>,
"H.J. Lu" <hjl.tools@...il.com>,
Florian Weimer <fweimer@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>,
Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
Valentin Schneider <vschneid@...hat.com>,
Christian Brauner <brauner@...nel.org>,
Shuah Khan <shuah@...nel.org>, linux-kernel@...r.kernel.org,
Will Deacon <will@...nel.org>, jannh@...gle.com,
Andrew Morton <akpm@...ux-foundation.org>,
Yury Khrustalev <yury.khrustalev@....com>,
Wilco Dijkstra <wilco.dijkstra@....com>,
linux-kselftest@...r.kernel.org, linux-api@...r.kernel.org,
Kees Cook <kees@...nel.org>
Subject: Re: [PATCH v20 4/8] fork: Add shadow stack support to clone3()
On Wed, Sep 03, 2025 at 11:01:05AM +0100, Mark Brown wrote:
> On Tue, Sep 02, 2025 at 10:02:07PM +0100, Catalin Marinas wrote:
> > On Tue, Sep 02, 2025 at 11:21:48AM +0100, Mark Brown wrote:
> > > + mmap_read_lock(mm);
> > > +
> > > + addr = untagged_addr_remote(mm, args->shadow_stack_token);
> > > + page = get_user_page_vma_remote(mm, addr, FOLL_FORCE | FOLL_WRITE,
> > > + &vma);
>
> > However, I wonder whether it makes sense to use the remote mm access
> > here at all. Does this code ever run without CLONE_VM? If not, this is
> > all done within the current mm context.
>
> Yes, userspace can select if it wants CLONE_VM or not so we should
> handle that case. We discussed this on prior versions and we felt that
> while we couldn't immediately see the use case for !CLONE_VM there
> wasn't a good reason to restrict the creativity of userspace developers,
> and given that you can specify the regular stack in these cases it seems
> logical that you'd also be able to specify the shadow stack.
Yeah. Not sure it makes much sense in practice but if we allow a new
stack without CLONE_VM, we should also allow a shadow stack. Thanks for
the clarification.
Reviewed-by: Catalin Marinas <catalin.marinas@....com>
Powered by blists - more mailing lists