aboutsummaryrefslogtreecommitdiffstats
path: root/security/keys/compat.c
diff options
context:
space:
mode:
authorMathias Krause <minipli@googlemail.com>2013-02-05 18:19:13 +0100
committerBen Hutchings <ben@decadent.org.uk>2013-03-20 15:03:37 +0000
commitf56cb892159202ee6486c7fd3c5dec3f82bd5114 (patch)
treeb4573b48ec4b861813d7bddd55e7b1787cffdded /security/keys/compat.c
parenta5f562fe78164e6c52284aa47323c86dc49f9873 (diff)
downloadkernel_samsung_smdk4412-f56cb892159202ee6486c7fd3c5dec3f82bd5114.zip
kernel_samsung_smdk4412-f56cb892159202ee6486c7fd3c5dec3f82bd5114.tar.gz
kernel_samsung_smdk4412-f56cb892159202ee6486c7fd3c5dec3f82bd5114.tar.bz2
crypto: user - fix info leaks in report API
commit 9a5467bf7b6e9e02ec9c3da4e23747c05faeaac6 upstream. Three errors resulting in kernel memory disclosure: 1/ The structures used for the netlink based crypto algorithm report API are located on the stack. As snprintf() does not fill the remainder of the buffer with null bytes, those stack bytes will be disclosed to users of the API. Switch to strncpy() to fix this. 2/ crypto_report_one() does not initialize all field of struct crypto_user_alg. Fix this to fix the heap info leak. 3/ For the module name we should copy only as many bytes as module_name() returns -- not as much as the destination buffer could hold. But the current code does not and therefore copies random data from behind the end of the module name, as the module name is always shorter than CRYPTO_MAX_ALG_NAME. Also switch to use strncpy() to copy the algorithm's name and driver_name. They are strings, after all. Signed-off-by: Mathias Krause <minipli@googlemail.com> Cc: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> [bwh: Backported to 3.2: adjust context] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'security/keys/compat.c')
0 files changed, 0 insertions, 0 deletions