Thread (10 messages) 10 messages, 2 authors, 3d ago

RE: [PATCH net v4 1/3] net: ethernet: oa_tc6: Protect skb pointer used by two different kernel instances

From: Selvamani Rajagopal <hidden>
Date: 2026-07-27 00:26:34
Also in: lkml

-----Original Message-----
From: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
Sent: Wednesday, July 22, 2026 3:09 AM
quoted
result, it might leak skb buffer, particularly threaded IRQ
runs in the middle of tranmsmit path, near skb_linearize.
Typo: "tranmsmit" -> "transmit"
Fixed. Thanks.
quoted
void oa_tc6_exit(struct oa_tc6 *tc6)
{
+ spin_lock_bh(&tc6->tx_skb_lock);
tc6->disable_traffic = true;
I don't know whether this is the right place to provide this comment,
but FYI: the disable_traffic read/check in the hard-IRQ handler
(oa_tc6_macphy_isr()) is not protected, while it may be written in
oa_tc6_exit() under tx_skb_lock.
Yes. I agree. Ideal way is to protect disable_traffic is to use spin_lock_irq.

But disable_traffic flag is just one-way ticket to stop the device from working,
Worst case scenario is one more interrupt would come after this is set by those
functions, which is harmless, in my view.

I am open to changing it. If you (or anyone who reviews) want to protect this flag 
with spin_lock_irq, I can change it.
Of course, spin_lock_bh() cannot be used in hard-IRQ context, so perhaps
a different synchronization approach is needed?

Best regards,
Parthiban V
quoted
+ spin_unlock_bh(&tc6->tx_skb_lock);
disable_irq(tc6->spi->irq);
oa_tc6_phy_exit(tc6);
oa_tc6_free_pending_skbs(tc6);
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help