Linux-Security-Module Archive on lore.kernel.org
 help / color / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: David Howells <dhowells@redhat.com>
Cc: keyrings@vger.kernel.org, linux-security-module@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] KEYS: Replace uid/gid/perm permissions checking with an ACL
Date: Wed, 14 Aug 2019 15:41:07 -0700
Message-ID: <20190814224106.GG101319@gmail.com> (raw)
In-Reply-To: <20190807025814.GA1167@sol.localdomain>

On Tue, Aug 06, 2019 at 07:58:14PM -0700, Eric Biggers wrote:
> On Tue, Jul 30, 2019 at 06:16:14PM -0700, Eric Biggers wrote:
> > On Mon, Jul 29, 2019 at 08:49:56PM -0700, Eric Biggers wrote:
> > > Hi David,
> > > 
> > > On Tue, Jul 09, 2019 at 06:16:01PM -0700, Eric Biggers wrote:
> > > > On Thu, May 23, 2019 at 04:58:27PM +0100, David Howells wrote:
> > > > > Replace the uid/gid/perm permissions checking on a key with an ACL to allow
> > > > > the SETATTR and SEARCH permissions to be split.  This will also allow a
> > > > > greater range of subjects to represented.
> > > > > 
> > > > 
> > > > This patch broke 'keyctl new_session', and hence broke all the fscrypt tests:
> > > > 
> > > > $ keyctl new_session
> > > > keyctl_session_to_parent: Permission denied
> > > > 
> > > > Output of 'keyctl show' is
> > > > 
> > > > $ keyctl show
> > > > Session Keyring
> > > >  605894913 --alswrv      0     0  keyring: _ses
> > > >  189223103 ----s-rv      0     0   \_ user: invocation_id
> > > > 
> > > > - Eric
> > > 
> > > This bug is still present in next-20190729.
> > > 
> > > - Eric
> > 
> > This fixes it:
> > 
> > diff --git a/security/keys/process_keys.c b/security/keys/process_keys.c
> > index aa3bfcadbc660..519c94f1cc3c2 100644
> > --- a/security/keys/process_keys.c
> > +++ b/security/keys/process_keys.c
> > @@ -58,7 +58,7 @@ static struct key_acl session_keyring_acl = {
> >  	.possessor_viewable = true,
> >  	.nr_ace	= 2,
> >  	.aces = {
> > -		KEY_POSSESSOR_ACE(KEY_ACE__PERMS & ~KEY_ACE_JOIN),
> > +		KEY_POSSESSOR_ACE(KEY_ACE__PERMS),
> >  		KEY_OWNER_ACE(KEY_ACE_VIEW | KEY_ACE_READ),
> >  	}
> >  };
> > 
> > 
> > The old permissions were KEY_POS_ALL | KEY_USR_VIEW | KEY_USR_READ, so
> > I'm not sure why JOIN permission was removed?
> > 
> > - Eric
> 
> Ping.  This is still broken in linux-next.
> 

David, any comment on this?  This is still broken in linux-next.

- Eric

  reply index

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-23 15:58 [PATCH 0/2] keys: ACLs David Howells
2019-05-23 15:58 ` [PATCH 1/2] KEYS: Replace uid/gid/perm permissions checking with an ACL David Howells
2019-07-10  1:15   ` Eric Biggers
2019-07-10  1:35     ` Eric Biggers
2019-07-30  3:49     ` Eric Biggers
2019-07-31  1:16       ` Eric Biggers
2019-08-07  2:58         ` Eric Biggers
2019-08-14 22:41           ` Eric Biggers [this message]
2019-05-23 15:58 ` [PATCH 2/2] KEYS: Provide KEYCTL_GRANT_PERMISSION David Howells
2019-07-09 20:42   ` Eric Biggers

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190814224106.GG101319@gmail.com \
    --to=ebiggers@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Security-Module Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-security-module/0 linux-security-module/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-security-module linux-security-module/ https://lore.kernel.org/linux-security-module \
		linux-security-module@vger.kernel.org linux-security-module@archiver.kernel.org
	public-inbox-index linux-security-module


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-security-module


AGPL code for this site: git clone https://public-inbox.org/ public-inbox