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: <ZV+NamY31GyANEe/@finisterre.sirena.org.uk>
Date:   Thu, 23 Nov 2023 17:35:38 +0000
From:   Mark Brown <broonie@...nel.org>
To:     Christian Brauner <brauner@...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>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        Valentin Schneider <vschneid@...hat.com>,
        Shuah Khan <shuah@...nel.org>, linux-kernel@...r.kernel.org,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>,
        Kees Cook <keescook@...omium.org>, jannh@...gle.com,
        linux-kselftest@...r.kernel.org, linux-api@...r.kernel.org
Subject: Re: [PATCH RFT v3 2/5] fork: Add shadow stack support to clone3()

On Thu, Nov 23, 2023 at 05:33:05PM +0100, Christian Brauner wrote:
> On Thu, Nov 23, 2023 at 12:17:19PM +0000, Mark Brown wrote:

> > > > +		if (clone_flags & CLONE_VFORK) {
> > > > +			shstk->base = 0;
> > > > +			shstk->size = 0;
> > > > +			return 0;
> > > > +		}

> > > Why is the CLONE_VFORK handling only necessary if shadow_stack_size is
> > > unset? In general, a comment or explanation on the interaction between
> > > CLONE_VFORK and shadow_stack_size would be helpful.

> > This is the existing implicit behaviour that clone() has, it's current
> > ABI for x86.  The intent is that if the user has explicitly configured a
> > shadow stack then we just do whatever they asked us to do, if they

> So what I'm asking is: if the calling process is suspended until the
> child exits or exec's does it make sense for the child to even get a
> shadow stack? I don't know the answer which is why I'm asking.

We were initially doing some suppression of stack creation based on the
flags but based on prior discussion we decided it wasn't worth it.
There was some question about corner cases (IIRC the main one was
posix_spawn()), but generally the thinking here was that since userspace
explicitly asked for the shadow stack in the worst case it'll just be
inefficient and userspace can fix things by just not doing that.  If we
just create the shadow stack whenever it's requested then it makes the
kernel side handling really simple to implement/verify and we don't have
to worry about having missed any use cases with combinations of flags
that we've not anticipated.

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ