Re: [bug report] net/mlx5: DR, Move STEv0 setters and getters

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

 




On 08-Jan-21 15:16, Dan Carpenter wrote:

The patch 6b93b400aa88: "net/mlx5: DR, Move STEv0 setters and
getters" from Nov 19, 2020, leads to the following static checker
warning:

         drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v0.c:252 dr_ste_v0_get_miss_addr()
         warn: potential shift truncation.  '0xff (0-255) << 26'

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v0.c
    248  static u64 dr_ste_v0_get_miss_addr(u8 *hw_ste_p)
    249  {
    250          u64 index =
    251                  (MLX5_GET(ste_rx_steering_mult, hw_ste_p, miss_address_31_6) |
    252                   MLX5_GET(ste_rx_steering_mult, hw_ste_p, miss_address_39_32) << 26);
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is shifting a u32 value in the 0-255 range by << 26 which could
result in shift wrapping.  "index" is a u64 but ORing two u32 values
will result in a u32.

Thanks Dan, will send a fix shortly.

-- YK



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux