Re: [PATCH net] net: hsr: remove seqnr_lock

From
Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date
2024-09-05 20:47:08
Reply to
Eric Dumazet, 2024-09-05
On 2024-09-05 15:26:27 [+0200], Eric Dumazet wrote:
quoted hunk ↗ jump to hunk
This has nothing to do with GRO.

Look at this alternative patch, perhaps you will see the problem ?
diff --git a/net/hsr/hsr_slave.c b/net/hsr/hsr_slave.c
index af6cf64a00e081c777db5f7786e8a27ea6f62e14..3971dbc0644ab8d32c04c262dbba7b1c950ebea9
100644
--- a/net/hsr/hsr_slave.c
+++ b/net/hsr/hsr_slave.c
@@ -67,7 +67,9 @@ static rx_handler_result_t hsr_handle_frame(struct
sk_buff **pskb)
                skb_set_network_header(skb, ETH_HLEN + HSR_HLEN);
        skb_reset_mac_len(skb);

+       spin_lock_bh(&hsr->seqnr_lock);
        hsr_forward_skb(skb, port);
+       spin_unlock_bh(&hsr->seqnr_lock);

 finish_consume:
        return RX_HANDLER_CONSUMED;
This does not trigger any warning while testing (warning as in recursion
or so). The other invocations have the lock so it should work.

This did not trigger earlier because hsr_handle_frame() is invoked from
the Slave-Interfaces which don't assign a seq-nr.
syzkaller might have managed to receive the packet from the
master interface. Or it is the interlink which is new and was added in
commit 5055cccfc2d1c ("net: hsr: Provide RedBox support (HSR-SAN)").

Did the bot leave a reproducer? I'm wondering if the packet is dropped
later in process. I can't test interlink right now, my `ip' seems not
recent enough.

Assuming it is a interlink packet, I would suggest to acquire that lock
as you suggested. I can send a patch if you wish. Added Lukasz Majewski
on Cc who added interlink support, maybe he can say if this is a legal
path.

Sebastian
Thread (9 messages) 9 messages, 4 authors, last reply 2024-09-09
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help