]> git.hungrycats.org Git - linux/commit
crypto: bcm - Fix pointer arithmetic
authorAleksandr Mishin <amishin@t-argos.ru>
Fri, 22 Mar 2024 20:59:15 +0000 (23:59 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 May 2024 07:48:56 +0000 (09:48 +0200)
commitc0082ee420639a97e40cae66778b02b341b005e5
treea5429eb74a9284d442c2b874986802da6a68e1fa
parentc79efc4bfa1c8e3e0ac50209ad9daad240e34933
crypto: bcm - Fix pointer arithmetic

[ Upstream commit 2b3460cbf454c6b03d7429e9ffc4fe09322eb1a9 ]

In spu2_dump_omd() value of ptr is increased by ciph_key_len
instead of hash_iv_len which could lead to going beyond the
buffer boundaries.
Fix this bug by changing ciph_key_len to hash_iv_len.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 9d12ba86f818 ("crypto: brcm - Add Broadcom SPU driver")
Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/bcm/spu2.c