diff options
author | Eric Biggers <ebiggers@google.com> | 2017-06-08 14:48:18 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-02-16 20:09:38 +0100 |
commit | 33813d43dd593e1c32c567c75483233212b825ae (patch) | |
tree | ce8ee721b907a2b31745349f74260d396a415115 /sound/pci/ens1370.c | |
parent | 4f8a4e9984479c05bbf78f09e1744711a3eb32b3 (diff) |
KEYS: encrypted: fix buffer overread in valid_master_desc()
commit 794b4bc292f5d31739d89c0202c54e7dc9bc3add upstream.
With the 'encrypted' key type it was possible for userspace to provide a
data blob ending with a master key description shorter than expected,
e.g. 'keyctl add encrypted desc "new x" @s'. When validating such a
master key description, validate_master_desc() could read beyond the end
of the buffer. Fix this by using strncmp() instead of memcmp(). [Also
clean up the code to deduplicate some logic.]
Cc: Mimi Zohar <zohar@linux.vnet.ibm.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
Signed-off-by: Jin Qian <jinqian@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/pci/ens1370.c')
0 files changed, 0 insertions, 0 deletions