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:   Sat, 14 Nov 2020 15:19:08 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Sven Van Asbroeck <thesven73@...il.com>
Cc:     Bryan Whitehead <bryan.whitehead@...rochip.com>,
        David S Miller <davem@...emloft.net>,
        Microchip Linux Driver Support <UNGLinuxDriver@...rochip.com>,
        Andrew Lunn <andrew@...n.ch>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH net v1] lan743x: fix issue causing intermittent kernel
 log warnings

On Thu, 12 Nov 2020 13:59:49 -0500 Sven Van Asbroeck wrote:
> From: Sven Van Asbroeck <thesven73@...il.com>
> 
> When running this chip on arm imx6, we intermittently observe
> the following kernel warning in the log, especially when the
> system is under high load:

> The driver is calling dev_kfree_skb() from code inside a spinlock,
> where h/w interrupts are disabled. This is forbidden, as documented
> in include/linux/netdevice.h. The correct function to use
> dev_kfree_skb_irq(), or dev_kfree_skb_any().
> 
> Fix by using the correct dev_kfree_skb_xxx() functions:
> 
> in lan743x_tx_release_desc():
>   called by lan743x_tx_release_completed_descriptors()
>     called by in lan743x_tx_napi_poll()
>     which holds a spinlock
>   called by lan743x_tx_release_all_descriptors()
>     called by lan743x_tx_close()
>     which can-sleep
> conclusion: use dev_kfree_skb_any()
> 
> in lan743x_tx_xmit_frame():
>   which holds a spinlock
> conclusion: use dev_kfree_skb_irq()
> 
> in lan743x_tx_close():
>   which can-sleep
> conclusion: use dev_kfree_skb()
> 
> in lan743x_rx_release_ring_element():
>   called by lan743x_rx_close()
>     which can-sleep
>   called by lan743x_rx_open()
>     which can-sleep
> conclusion: use dev_kfree_skb()
> 
> Fixes: 23f0703c125b ("lan743x: Add main source files for new lan743x driver")
> Signed-off-by: Sven Van Asbroeck <thesven73@...il.com>

Applied, thanks.

The _irq() cases look a little strange, are you planning a refactor in
net-next? Seems like the freeing can be moved outside the lock.

Also the driver could stop the queue when there is less than
MAX_SKB_FRAGS + 2 descriptors left, so it doesn't need the
"overflow_skb" thing.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ