android_kernel_oneplus_msm8998/arch
Ard Biesheuvel 9246fd26f9 crypto: arm/aes-ctr - fix NULL dereference in tail processing
commit f82e90b28654804ab72881d577d87c3d5c65e2bc upstream.

The AES-CTR glue code avoids calling into the blkcipher API for the
tail portion of the walk, by comparing the remainder of walk.nbytes
modulo AES_BLOCK_SIZE with the residual nbytes, and jumping straight
into the tail processing block if they are equal. This tail processing
block checks whether nbytes != 0, and does nothing otherwise.

However, in case of an allocation failure in the blkcipher layer, we
may enter this code with walk.nbytes == 0, while nbytes > 0. In this
case, we should not dereference the source and destination pointers,
since they may be NULL. So instead of checking for nbytes != 0, check
for (walk.nbytes % AES_BLOCK_SIZE) != 0, which implies the former in
non-error conditions.

Fixes: 86464859cc ("crypto: arm - AES in ECB/CBC/CTR/XTS modes using ARMv8 Crypto Extensions")
Reported-by: xiakaixu <xiakaixu@huawei.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-30 10:18:34 +02:00
..
alpha alpha: fix copy_from_user() 2016-09-24 10:07:45 +02:00
arc ARC: uaccess: get_user to zero out dest in cause of fault 2016-09-24 10:07:44 +02:00
arm crypto: arm/aes-ctr - fix NULL dereference in tail processing 2016-09-30 10:18:34 +02:00
arm64 crypto: arm64/aes-ctr - fix NULL dereference in tail processing 2016-09-30 10:18:34 +02:00
avr32 avr32: fix 'undefined reference to `___copy_from_user' 2016-09-24 10:07:46 +02:00
blackfin blackfin: fix copy_from_user() 2016-09-24 10:07:44 +02:00
c6x irqdomain: Use irq_domain_get_of_node() instead of direct field access 2015-10-13 19:01:23 +02:00
cris cris: buggered copy_from_user/copy_to_user/clear_user 2016-09-24 10:07:44 +02:00
frv frv: fix clear_user() 2016-09-24 10:07:44 +02:00
h8300 h8300 update for v4.4 2015-11-12 15:26:39 -08:00
hexagon hexagon: fix strncpy_from_user() error return 2016-09-24 10:07:44 +02:00
ia64 ia64: copy_from_user() should zero the destination on access_ok() failure 2016-09-24 10:07:46 +02:00
m32r m32r: fix __get_user() 2016-09-24 10:07:43 +02:00
m68k m68k: Wire up mlock2 2015-11-22 11:35:26 +01:00
metag metag: copy_from_user() should zero the destination on access_ok() failure 2016-09-24 10:07:45 +02:00
microblaze microblaze: fix copy_from_user() 2016-09-24 10:07:43 +02:00
mips mips: copy_from_user() must zero the destination on access_ok() failure 2016-09-24 10:07:45 +02:00
mn10300 mn10300: copy_from_user() should zero on access_ok() failure... 2016-09-24 10:07:45 +02:00
nios2 nios2: copy_from_user() should zero the tail of destination 2016-09-24 10:07:45 +02:00
openrisc openrisc: fix the fix of copy_from_user() 2016-09-24 10:07:46 +02:00
parisc parisc: fix copy_from_user() 2016-09-24 10:07:45 +02:00
powerpc ppc32: fix copy_from_user() 2016-09-24 10:07:45 +02:00
s390 s390: get_user() should zero on failure 2016-09-24 10:07:44 +02:00
score score: fix copy_from_user() and friends 2016-09-24 10:07:44 +02:00
sh sh: fix copy_from_user() 2016-09-24 10:07:44 +02:00
sparc sparc32: fix copy_from_user() 2016-09-24 10:07:45 +02:00
tile tile: provide CONFIG_PAGE_SIZE_64KB etc for tilepro 2016-01-05 08:16:09 -05:00
um um: Don't discard .text.exit section 2016-09-07 08:32:38 +02:00
unicore32 pwm: Changes for v4.4-rc1 2015-11-11 09:16:10 -08:00
x86 fix minor infoleak in get_user_ex() 2016-09-24 10:07:43 +02:00
xtensa xtensa: clear all DBREAKC registers on start 2016-04-12 09:08:55 -07:00
.gitignore
Kconfig