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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 1 Feb 2022 20:05:21 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Steen Hegelund <steen.hegelund@...rochip.com>
Cc:     "David S. Miller" <davem@...emloft.net>,
        <UNGLinuxDriver@...rochip.com>, <netdev@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>,
        "Dan Carpenter" <dan.carpenter@...cle.com>,
        kernel test robot <lkp@...el.com>
Subject: Re: [PATCH net] net: sparx5: do not refer to skb after passing it
 on

On Tue, 1 Feb 2022 15:30:57 +0100 Steen Hegelund wrote:
> Do not try to use any SKB fields after the packet has been passed up in the
> receive stack.
> 
> This error was reported as shown below:

No need to spell it out, the tags speak for themselves.

> Reported-by: kernel test robot <lkp@...el.com>
> Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
> 

Drop this...

> Fixes: f3cad2611a77 (net: sparx5: add hostmode with phylink support)
> 

and this empty line - all the tags should be together.

> Signed-off-by: Steen Hegelund <steen.hegelund@...rochip.com>
> ---
>  drivers/net/ethernet/microchip/sparx5/sparx5_packet.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_packet.c b/drivers/net/ethernet/microchip/sparx5/sparx5_packet.c
> index dc7e5ea6ec15..ebdce4b35686 100644
> --- a/drivers/net/ethernet/microchip/sparx5/sparx5_packet.c
> +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_packet.c
> @@ -145,8 +145,8 @@ static void sparx5_xtr_grp(struct sparx5 *sparx5, u8 grp, bool byte_swap)
>  	skb_put(skb, byte_cnt - ETH_FCS_LEN);
>  	eth_skb_pad(skb);
>  	skb->protocol = eth_type_trans(skb, netdev);
> -	netif_rx(skb);
>  	netdev->stats.rx_bytes += skb->len;
> +	netif_rx(skb);
>  	netdev->stats.rx_packets++;

sorry to nit pick - wouldn't it be neater if both the stats were
updated together?  Looks a little strange that netif_rx() is in
between the two now.

>  }
> 
> --
> 2.35.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ