> > Left shifts of integer literals and bool values overwriting the sign bit > were used multiple times in bpf_jit_arm64.c. E.g.: > > insn = (!!is64) << 31; > > where is64 has type bool (double bang is a no-op here). The operand of > left shift was promoted to type int, which when 32-bit wide cannot > represent the result. Similarly literal integers have int type by > default. Sanitizer produced the following diagnostic during runtime > (for various lines): > > lib/bpf/bpf_jit_arm64.c:241:18: runtime error: left shift of 1 by 31 > places cannot be represented in type 'int' > > To fix the issue use RTE_BIT32 and similar macros instead. > > Signed-off-by: Marat Khalili <[email protected]> > Acked-by: Morten Brørup <[email protected]> > ---
Acked-by: Konstantin Ananyev <[email protected]> > -- > 2.43.0

