Thread (4 messages) 4 messages, 4 authors, 2024-10-15

Re: [PATCH][next][V2] octeontx2-af: Fix potential integer overflows on integer shifts

From: Dan Carpenter <hidden>
Date: 2024-10-10 18:25:53
Also in: kernel-janitors, lkml

On Thu, Oct 10, 2024 at 04:45:19PM +0100, Colin Ian King wrote:
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 <redacted>
---

V2: Fix both (1 << i) shifts, thanks to Dan Carpenter for spotting the
    second shift that I overlooked in the first patch.
Reviewed-by: Dan Carpenter <redacted>

regards,
dan carpenter
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help