Commit 53d3749
net: avoid updating qdisc_xmit_lock_key in netdev_update_lockdep_key()
syzbot reported some bogus lockdep warnings, for example bad unlock
balance in sch_direct_xmit(). They are due to a race condition between
slow path and fast path, that is qdisc_xmit_lock_key gets re-registered
in netdev_update_lockdep_key() on slow path, while we could still
acquire the queue->_xmit_lock on fast path in this small window:
CPU A CPU B
__netif_tx_lock();
lockdep_unregister_key(qdisc_xmit_lock_key);
__netif_tx_unlock();
lockdep_register_key(qdisc_xmit_lock_key);
In fact, unlike the addr_list_lock which has to be reordered when
the master/slave device relationship changes, queue->_xmit_lock is
only acquired on fast path and only when NETIF_F_LLTX is not set,
so there is likely no nested locking for it.
Therefore, we can just get rid of re-registration of
qdisc_xmit_lock_key.
Reported-by: [email protected]
Fixes: ab92d68 ("net: core: add generic lockdep keys")
Cc: Taehee Yoo <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
Acked-by: Taehee Yoo <[email protected]>
Signed-off-by: David S. Miller <[email protected]>1 parent 44c23d7 commit 53d3749
1 file changed
+0
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9177 | 9177 | | |
9178 | 9178 | | |
9179 | 9179 | | |
9180 | | - | |
9181 | | - | |
9182 | | - | |
9183 | | - | |
9184 | 9180 | | |
9185 | | - | |
9186 | | - | |
9187 | 9181 | | |
9188 | 9182 | | |
9189 | 9183 | | |
9190 | | - | |
9191 | | - | |
9192 | | - | |
9193 | | - | |
9194 | | - | |
9195 | | - | |
9196 | 9184 | | |
9197 | 9185 | | |
9198 | 9186 | | |
| |||
0 commit comments