WSL2-Linux-Kernel/net/hsr
Sebastian Andrzej Siewior f617cef465 net: Write lock dev_base_lock without disabling bottom halves.
[ Upstream commit fd888e85fe ]

The writer acquires dev_base_lock with disabled bottom halves.
The reader can acquire dev_base_lock without disabling bottom halves
because there is no writer in softirq context.

On PREEMPT_RT the softirqs are preemptible and local_bh_disable() acts
as a lock to ensure that resources, that are protected by disabling
bottom halves, remain protected.
This leads to a circular locking dependency if the lock acquired with
disabled bottom halves (as in write_lock_bh()) and somewhere else with
enabled bottom halves (as by read_lock() in netstat_show()) followed by
disabling bottom halves (cxgb_get_stats() -> t4_wr_mbox_meat_timeout()
-> spin_lock_bh()). This is the reverse locking order.

All read_lock() invocation are from sysfs callback which are not invoked
from softirq context. Therefore there is no need to disable bottom
halves while acquiring a write lock.

Acquire the write lock of dev_base_lock without disabling bottom halves.

Reported-by: Pei Zhang <pezhang@redhat.com>
Reported-by: Luis Claudio R. Goncalves <lgoncalv@redhat.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-29 09:03:22 +02:00
..
Kconfig hsr: enhance netlink socket interface to support PRP 2020-07-27 12:20:40 -07:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
hsr_debugfs.c /net/hsr: fix misspellings using codespell tool 2021-03-18 19:13:41 -07:00
hsr_device.c net: Write lock dev_base_lock without disabling bottom halves. 2022-06-29 09:03:22 +02:00
hsr_device.h net: hsr: add offloading support 2021-02-11 13:24:44 -08:00
hsr_forward.c net: hsr: fix mac_len checks 2021-05-24 14:10:28 -07:00
hsr_forward.h net: hsr: fix mac_len checks 2021-05-24 14:10:28 -07:00
hsr_framereg.c net: hsr: don't check sequence number if tag removal is offloaded 2021-06-16 12:13:01 -07:00
hsr_framereg.h net: hsr: add support for EntryForgetTime 2021-02-25 09:41:51 -08:00
hsr_main.c net: hsr: add offloading support 2021-02-11 13:24:44 -08:00
hsr_main.h net: hsr: fix mac_len checks 2021-05-24 14:10:28 -07:00
hsr_netlink.c genetlink: move to smaller ops wherever possible 2020-10-02 19:11:11 -07:00
hsr_netlink.h hsr: enhance netlink socket interface to support PRP 2020-07-27 12:20:40 -07:00
hsr_slave.c net: hsr: fix mac_len checks 2021-05-24 14:10:28 -07:00
hsr_slave.h net: prp: add packet handling support 2020-07-27 12:20:40 -07:00