Commit 01d3c84
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: [email protected]
Signed-off-by: Quang Le <[email protected]>
Signed-off-by: Willem de Bruijn <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>1 parent 5a40f8a commit 01d3c84
1 file changed
+6
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4573 | 4573 | | |
4574 | 4574 | | |
4575 | 4575 | | |
4576 | | - | |
4577 | | - | |
| 4576 | + | |
| 4577 | + | |
4578 | 4578 | | |
4579 | | - | |
| 4579 | + | |
4580 | 4580 | | |
4581 | 4581 | | |
4582 | 4582 | | |
| |||
4608 | 4608 | | |
4609 | 4609 | | |
4610 | 4610 | | |
4611 | | - | |
4612 | | - | |
| 4611 | + | |
| 4612 | + | |
4613 | 4613 | | |
4614 | | - | |
| 4614 | + | |
4615 | 4615 | | |
4616 | 4616 | | |
4617 | 4617 | | |
| |||
0 commit comments