Re: [PATCH 6/7] keys: Add a keyctl to move a key between keyrings

2019-05-30 Thread David Howells
Eric Biggers wrote: > This shows up after a few seconds of syzkaller fuzzing with a description of > KEYCTL_MOVE added: Yeah... I'm fixing that now. I've also created a bunch of tests, manpages, etc. for keyutils which I'll push when I've fixed my patches. David

Re: [PATCH 6/7] keys: Add a keyctl to move a key between keyrings

2019-05-29 Thread Eric Biggers
On Wed, May 22, 2019 at 11:28:45PM +0100, David Howells wrote: > Add a keyctl to atomically move a link to a key from one keyring to > another. The key must exist in "from" keyring and a flag can be given to > cause the operation to fail if there's a matching key already in the "to" > keyring. >

Re: [PATCH 6/7] keys: Add a keyctl to move a key between keyrings

2019-05-29 Thread David Howells
James Morris wrote: > > + > > + if (flags & ~KEYCTL_MOVE_EXCL) > > + return -EINVAL; > > + > > + key_ref = lookup_user_key(id, KEY_LOOKUP_CREATE, KEY_NEED_LINK); > > + if (IS_ERR(key_ref)) { > > + ret = PTR_ERR(key_ref); > > + goto error; > > + } > > This co

Re: [PATCH 6/7] keys: Add a keyctl to move a key between keyrings

2019-05-28 Thread James Morris
On Wed, 22 May 2019, David Howells wrote: > + > + if (flags & ~KEYCTL_MOVE_EXCL) > + return -EINVAL; > + > + key_ref = lookup_user_key(id, KEY_LOOKUP_CREATE, KEY_NEED_LINK); > + if (IS_ERR(key_ref)) { > + ret = PTR_ERR(key_ref); > + goto error; > +

[PATCH 6/7] keys: Add a keyctl to move a key between keyrings

2019-05-22 Thread David Howells
Add a keyctl to atomically move a link to a key from one keyring to another. The key must exist in "from" keyring and a flag can be given to cause the operation to fail if there's a matching key already in the "to" keyring. This can be done with: keyctl(KEYCTL_MOVE, key_se