Re: [PATCH bpf-next] bpf: avoid gcc overflow warning in test_xdp_vlan.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello:

This patch was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@xxxxxxxxxx>:

On Wed,  8 May 2024 12:35:12 -0700 you wrote:
> This patch fixes an integer overflow warning raised by GCC in
> xdp_prognum1 of progs/test_xdp_vlan.c:
> 
>   GCC-BPF  [test_maps] test_xdp_vlan.bpf.o
> progs/test_xdp_vlan.c: In function 'xdp_prognum1':
> progs/test_xdp_vlan.c:163:25: error: integer overflow in expression
>  '(short int)(((__builtin_constant_p((int)vlan_hdr->h_vlan_TCI)) != 0
>    ? (int)(short unsigned int)((short int)((int)vlan_hdr->h_vlan_TCI
>    << 8 >> 8) << 8 | (short int)((int)vlan_hdr->h_vlan_TCI << 0 >> 8
>    << 0)) & 61440 : (int)__builtin_bswap16(vlan_hdr->h_vlan_TCI)
>    & 61440) << 8 >> 8) << 8' of type 'short int' results in '0' [-Werror=overflow]
>   163 |                         bpf_htons((bpf_ntohs(vlan_hdr->h_vlan_TCI) & 0xf000)
>       |                         ^~~~~~~~~
> 
> [...]

Here is the summary with links:
  - [bpf-next] bpf: avoid gcc overflow warning in test_xdp_vlan.c
    https://git.kernel.org/bpf/bpf-next/c/792a04bed41c

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html






[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux