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] [day] [month] [year] [list]
Date:   Thu, 12 Dec 2019 17:32:14 +0000
From:   Ben Hutchings <ben@...adent.org.uk>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     Jann Horn <jannh@...gle.com>,
        Casey Schaufler <casey@...aufler-ca.com>,
        stable@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 4.9 45/47] Smack: Dont ignore other bprm->unsafe flags
 if LSM_UNSAFE_PTRACE is set

On Thu, 2019-12-12 at 18:06 +0100, Greg Kroah-Hartman wrote:
> On Thu, Dec 05, 2019 at 03:50:07PM +0000, Ben Hutchings wrote:
> > On Sun, 2019-10-06 at 19:21 +0200, Greg Kroah-Hartman wrote:
> > > From: Jann Horn <jannh@...gle.com>
> > > 
> > > commit 3675f052b43ba51b99b85b073c7070e083f3e6fb upstream.
> > [...]
> > > --- a/security/smack/smack_lsm.c
> > > +++ b/security/smack/smack_lsm.c
> > > @@ -949,7 +949,8 @@ static int smack_bprm_set_creds(struct l
> > >  
> > >  		if (rc != 0)
> > >  			return rc;
> > > -	} else if (bprm->unsafe)
> > > +	}
> > > +	if (bprm->unsafe & ~LSM_UNSAFE_PTRACE)
> > 
> > I think this needs to be ~(LSM_UNSAFE_PTRACE | LSM_UNSAFE_PTRACE_CAP)
> > for 4.9 and older branches.
> 
> Why?  Where did the LSM_UNSAFE_PTRACE_CAP requirement come from (or
> really, go away?)

LSM_UNSAFE_PTRACE_CAP was combined with LSM_UNSAFE_PTRACE by:

commit 9227dd2a84a765fcfef1677ff17de0958b192eda
Author: Eric W. Biederman <ebiederm@...ssion.com>
Date:   Mon Jan 23 17:26:31 2017 +1300

    exec: Remove LSM_UNSAFE_PTRACE_CAP

If I understand the patch ("Smack: Dont ignore other bprm->unsafe
flags …") correctly, this function should have one if-statement
handling LSM_UNSAFE_PTRACE (and LSM_UNSAFE_PTRACE_CAP if it exists),
followed by another if-statement handling all other flags in
bprm->unsafe.

Ben.

-- 
Ben Hutchings
Sturgeon's Law: Ninety percent of everything is crap.


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ