]> git.baikalelectronics.ru Git - kernel.git/commit
KEYS: DH: don't feed uninitialized "otherinfo" into KDF
authorEric Biggers <ebiggers@google.com>
Thu, 8 Jun 2017 13:49:42 +0000 (14:49 +0100)
committerJames Morris <james.l.morris@oracle.com>
Fri, 9 Jun 2017 03:29:49 +0000 (13:29 +1000)
commit618fed023a6c7e2ea231c3585240a1c6ddcfa314
tree3abf0a758a569c41c972f5c79f31337ad7a04fae
parent254851549c7a7b04e10a72d96ab2e6d1fc536a16
KEYS: DH: don't feed uninitialized "otherinfo" into KDF

If userspace called KEYCTL_DH_COMPUTE with kdf_params containing NULL
otherinfo but nonzero otherinfolen, the kernel would allocate a buffer
for the otherinfo, then feed it into the KDF without initializing it.
Fix this by always doing the copy from userspace (which will fail with
EFAULT in this scenario).

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: James Morris <james.l.morris@oracle.com>
security/keys/dh.c