[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241209161140.3b8b5c7b@kernel.org>
Date: Mon, 9 Dec 2024 16:11:40 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Parthiban Veerasooran <parthiban.veerasooran@...rochip.com>
Cc: <andrew+netdev@...n.ch>, <davem@...emloft.net>, <edumazet@...gle.com>,
<pabeni@...hat.com>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <UNGLinuxDriver@...rochip.com>,
<jacob.e.keller@...el.com>
Subject: Re: [PATCH net v3 2/2] net: ethernet: oa_tc6: fix tx skb race
condition between reference pointers
On Wed, 4 Dec 2024 19:05:18 +0530 Parthiban Veerasooran wrote:
> @@ -1210,7 +1213,9 @@ netdev_tx_t oa_tc6_start_xmit(struct oa_tc6 *tc6, struct sk_buff *skb)
> return NETDEV_TX_OK;
> }
>
> + mutex_lock(&tc6->tx_skb_lock);
> tc6->waiting_tx_skb = skb;
> + mutex_unlock(&tc6->tx_skb_lock);
start_xmit runs in BH / softirq context. You can't take sleeping locks.
The lock has to be a spin lock. You could possibly try to use the
existing spin lock of the tx queue (__netif_tx_lock()) but that may be
more challenging to do cleanly from within a library..
Please make sure you test with builds including the
kernel/configs/debug.config Kconfigs.
--
pw-bot: cr
Powered by blists - more mailing lists