]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
LoongArch: csum: Fix OoB access in IP checksum code for negative lengths
authorYuli Wang <wangyuli@uniontech.com>
Thu, 13 Feb 2025 04:02:40 +0000 (12:02 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Feb 2025 13:01:17 +0000 (14:01 +0100)
commit9f15a8df542c0f08732a67d1a14ee7c22948fb97
tree47409bbb6919ec012447dc47fdc31f5524f06ac5
parent78d192f6147c20190b9d626aaba8705846b8811f
LoongArch: csum: Fix OoB access in IP checksum code for negative lengths

[ Upstream commit 6287f1a8c16138c2ec750953e35039634018c84a ]

Commit 69e3a6aa6be2 ("LoongArch: Add checksum optimization for 64-bit
system") would cause an undefined shift and an out-of-bounds read.

Commit 8bd795fedb84 ("arm64: csum: Fix OoB access in IP checksum code
for negative lengths") fixes the same issue on ARM64.

Fixes: 69e3a6aa6be2 ("LoongArch: Add checksum optimization for 64-bit system")
Co-developed-by: Wentao Guan <guanwentao@uniontech.com>
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Signed-off-by: Yuli Wang <wangyuli@uniontech.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/loongarch/lib/csum.c