lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 4 Nov 2020 14:02:56 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Saeed Mahameed <saeedm@...dia.com>
Cc:     <netdev@...r.kernel.org>, "David S. Miller" <davem@...emloft.net>,
        Vladyslav Tarasiuk <vladyslavt@...dia.com>,
        Tariq Toukan <tariqt@...dia.com>
Subject: Re: [net-next 09/12] net/mlx5e: Validate stop_room size upon user
 input

On Tue, 3 Nov 2020 11:47:35 -0800 Saeed Mahameed wrote:
> From: Vladyslav Tarasiuk <vladyslavt@...dia.com>
> 
> Stop room is a space that may be taken by WQEs in the SQ during a packet
> transmit. It is used to check if next packet has enough room in the SQ.
> Stop room guarantees this packet can be served and if not, the queue is
> stopped, so no more packets are passed to the driver until it's ready.
> 
> Currently, stop_room size is calculated and validated upon tx queues
> allocation. This makes it impossible to know if user provided valid
> input for certain parameters when interface is down.
> 
> Instead, store stop_room in mlx5e_sq_param and create
> mlx5e_validate_params(), to validate its fields upon user input even
> when the interface is down.
> 
> Signed-off-by: Vladyslav Tarasiuk <vladyslavt@...dia.com>
> Reviewed-by: Tariq Toukan <tariqt@...dia.com>
> Signed-off-by: Saeed Mahameed <saeedm@...dia.com>

32 bit build wants you to use %zd or such: 

drivers/net/ethernet/mellanox/mlx5/core/en/params.c: In function ‘mlx5e_validate_params’:
drivers/net/ethernet/mellanox/mlx5/core/en/params.c:182:72: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=]
  182 |   netdev_err(priv->netdev, "Stop room %hu is bigger than the SQ size %lu\n",
      |                                                                      ~~^
      |                                                                        |
      |                                                                        long unsigned int
      |                                                                      %u
  183 |       stop_room, sq_size);
      |                  ~~~~~~~                                                
      |                  |
      |                  size_t {aka unsigned int}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ