Commit 723c4bc
committed
net/packet: fix a race in packet_set_ring() and packet_notifier()
JIRA: https://issues.redhat.com/browse/RHEL-115650
Upstream Status: net.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 c51a5dd commit 723c4bc
1 file changed
+6
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4500 | 4500 | | |
4501 | 4501 | | |
4502 | 4502 | | |
4503 | | - | |
4504 | | - | |
| 4503 | + | |
| 4504 | + | |
4505 | 4505 | | |
4506 | | - | |
| 4506 | + | |
4507 | 4507 | | |
4508 | 4508 | | |
4509 | 4509 | | |
| |||
4535 | 4535 | | |
4536 | 4536 | | |
4537 | 4537 | | |
4538 | | - | |
4539 | | - | |
| 4538 | + | |
| 4539 | + | |
4540 | 4540 | | |
4541 | | - | |
| 4541 | + | |
4542 | 4542 | | |
4543 | 4543 | | |
4544 | 4544 | | |
| |||
0 commit comments