summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2017-09-18 18:36:45 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-05 07:44:00 (GMT)
commit47e8bd1965fc2bcee69a62a5cc2d5336b2e79835 (patch)
tree985e8898e19078f07a1367302b5fc22b11dc963a /include
parent0c70fb88c7510784b12567e9ca5b848dd2b20395 (diff)
downloadlinux-47e8bd1965fc2bcee69a62a5cc2d5336b2e79835.tar.xz
KEYS: fix writing past end of user-supplied buffer in keyring_read()
commit e645016abc803dafc75e4b8f6e4118f088900ffb upstream. Userspace can call keyctl_read() on a keyring to get the list of IDs of keys in the keyring. But if the user-supplied buffer is too small, the kernel would write the full list anyway --- which will corrupt whatever userspace memory happened to be past the end of the buffer. Fix it by only filling the space that is available. Fixes: b2a4df200d57 ("KEYS: Expand the capacity of a keyring") Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions