Subject: Re: [PATCH net v2] net: Drop the lock in skb_may_tx_timestamp()

From: Willem de Bruijn <[email-masked]>
Date: Fri, 20 Feb 2026 16:49:24 -0500

Jakub Kicinski wrote:
> On Fri, 20 Feb 2026 19:38:58 +0100 Sebastian Andrzej Siewior wrote:
> > skb_may_tx_timestamp() may acquire sock::sk_callback_lock. The lock must
> > not be taken in IRQ context, only softirq is okay. A few drivers receive
> > the timestamp via a dedicated interrupt and complete the TX timestamp
> > from that handler. This will lead to a deadlock if the lock is already
> > write-locked on the same CPU.
> 
> Fine by me, the fix is fairly simple. But FWIW I can't stop myself from
> restating that networking core is not supposed to be called by drivers
> in hard IRQ context in general. Especially when it comes to anything
> that may involve user sockets. So my intuition is that fixing the driver
> to use a tasklet^w work_bh would make the expectations clearer.
> 
> Willem, you don't find that argument convincing?

This narrow case seems fine to me too.

But I can understand if that would be a global rule. As it simplifies
reasoning about correctness of core code quite a bit. In which case
that would trump this. No preference from me. Clearly other drivers
are quite capable of making this work without requiring updates from
hard IRQ.
 
> BTW IIUC the driver in question was igc, and it did not exist for
> another 3 years after the commit under Fixes, which is another bad
> smell here.

I was wondering about that too. But Sebastian shared quite a few more
drivers: https://lore.kernel.org/netdev/[email-masked]/
I did not bother to check whether all were newer than the introduction
of the blamed commit.