Commit 1576919
committed
net/packet: fix a race in packet_set_ring() and packet_notifier()
JIRA: https://issues.redhat.com/browse/RHEL-115601
Upstream Status: net-next.git commit 01d3c84
commit 01d3c84
Author: Quang Le <quanglex97@gmail.com>
Date: Fri Aug 1 13:54:16 2025 -0400
net/packet: fix a race in packet_set_ring() and packet_notifier()
When packet_set_ring() releases po->bind_lock, another thread can
run packet_notifier() and process an NETDEV_UP event.
This race and the fix are both similar to that of commit 15fe076
("net/packet: fix a race in packet_bind() and packet_notifier()").
There too the packet_notifier NETDEV_UP event managed to run while a
po->bind_lock critical section had to be temporarily released. And
the fix was similarly to temporarily set po->num to zero to keep
the socket unhooked until the lock is retaken.
The po->bind_lock in packet_set_ring and packet_notifier precede the
introduction of git history.
Fixes: 1da177e ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: Quang Le <quanglex97@gmail.com>
Signed-off-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20250801175423.2970334-1-willemdebruijn.kernel@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Davide Caratti <dcaratti@redhat.com>1 parent 1c3682f commit 1576919
1 file changed
+6
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4562 | 4562 | | |
4563 | 4563 | | |
4564 | 4564 | | |
4565 | | - | |
4566 | | - | |
| 4565 | + | |
| 4566 | + | |
4567 | 4567 | | |
4568 | | - | |
| 4568 | + | |
4569 | 4569 | | |
4570 | 4570 | | |
4571 | 4571 | | |
| |||
4597 | 4597 | | |
4598 | 4598 | | |
4599 | 4599 | | |
4600 | | - | |
4601 | | - | |
| 4600 | + | |
| 4601 | + | |
4602 | 4602 | | |
4603 | | - | |
| 4603 | + | |
4604 | 4604 | | |
4605 | 4605 | | |
4606 | 4606 | | |
| |||
0 commit comments