]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
octeontx2-af: Fix potential integer overflows on integer shifts
authorColin Ian King <colin.i.king@gmail.com>
Thu, 10 Oct 2024 15:45:19 +0000 (16:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Nov 2024 00:52:33 +0000 (01:52 +0100)
commit75df8b53800cee9ba5079d91a8605f118d4f42b0
treefb0a103ba62c8211ca76b4e2623749152cc42f02
parent213d1ff6c491704d601a6a509573fe7d44501a4d
octeontx2-af: Fix potential integer overflows on integer shifts

[ Upstream commit 637c4f6fe40befa04f19c38b5d15429cbb9191d9 ]

The left shift int 32 bit integer constants 1 is evaluated using 32 bit
arithmetic and then assigned to a 64 bit unsigned integer. In the case
where the shift is 32 or more this can lead to an overflow. Avoid this
by shifting using the BIT_ULL macro instead.

Fixes: 019aba04f08c ("octeontx2-af: Modify SMQ flush sequence to drop packets")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20241010154519.768785-1-colin.i.king@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c