[PATCH 1/2] KEYS: Replace uid/gid/perm permissions checking with an ACL
Eric Biggers
ebiggers at kernel.org
Wed Jul 31 01:16:14 UTC 2019
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
More information about the Linux-security-module-archive
mailing list