mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
ovpn injects decrypted packets into the netdev RX path through
ovpn_netdev_write() which invokes gro_cells_receive() and
dev_dstats_rx_add().
ovpn_netdev_write() is normally called in softirq context,
however, in case of TCP connections it may also be invoked
process context.
When this happens gro_cells_receive() will throw a warning:
[ 230.183747][ T12] WARNING: net/core/gro_cells.c:30 at gro_cells_receive+0x708/0xaa0, CPU#1: kworker/u16:0/12
and lockdep will also report a potential inconsistent lock state:
WARNING: inconsistent lock state
7.0.0-rc4+ #246 Tainted: G W
--------------------------------
inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage.
because attempts to acquire gro_cells->bh_lock by both
contexts may lead to a deadlock.
At the same time, dev_dstats_rx_add() does not expect to race
with a softirq (which may happen when invoked in process context),
because the latter may access its per-cpu state and corrupt
it.
Fix all this by invoking local_bh_disable/enable() around
gro_cells_receive() and dev_dstats_rx_add() to ensure that
bottom halves are always disabled before calling both of
them.
Fixes:
|
||
|---|---|---|
| .. | ||
| bind.c | ||
| bind.h | ||
| crypto_aead.c | ||
| crypto_aead.h | ||
| crypto.c | ||
| crypto.h | ||
| io.c | ||
| io.h | ||
| main.c | ||
| main.h | ||
| Makefile | ||
| netlink-gen.c | ||
| netlink-gen.h | ||
| netlink.c | ||
| netlink.h | ||
| ovpnpriv.h | ||
| peer.c | ||
| peer.h | ||
| pktid.c | ||
| pktid.h | ||
| proto.h | ||
| skb.h | ||
| socket.c | ||
| socket.h | ||
| stats.c | ||
| stats.h | ||
| tcp.c | ||
| tcp.h | ||
| udp.c | ||
| udp.h | ||