deepin-kernel/net/can
Oliver Hartkopp e46bf7f972 can: bcm: add missing rcu read protection for procfs content
commit dac5e62491 upstream.

When the procfs content is generated for a bcm_op which is in the process
to be removed the procfs output might show unreliable data (UAF).

As the removal of bcm_op's is already implemented with rcu handling this
patch adds the missing rcu_read_lock() and makes sure the list entries
are properly removed under rcu protection.

Fixes: f1b4e32aca ("can: bcm: use call_rcu() instead of costly synchronize_rcu()")
Reported-by: Anderson Nascimento <anderson@allelesecurity.com>
Suggested-by: Anderson Nascimento <anderson@allelesecurity.com>
Tested-by: Anderson Nascimento <anderson@allelesecurity.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://patch.msgid.link/20250519125027.11900-2-socketcan@hartkopp.net
Cc: stable@vger.kernel.org # >= 5.4
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 1f912f8484e9c4396378c39460bbea0af681f319)
2025-06-10 16:18:03 +08:00
..
j1939 can: j1939: j1939_sk_send_loop(): fix unable to send messages with data length zero 2025-03-01 15:55:12 +08:00
Kconfig net: Kconfig: move the CAN device menu to the "Device Drivers" section 2022-06-11 17:11:02 +02:00
Makefile can: add ISO 15765-2:2016 transport protocol 2020-10-07 23:18:33 +02:00
af_can.c can: statistics: use atomic access in hot path 2025-04-14 15:51:01 +08:00
af_can.h can: statistics: use atomic access in hot path 2025-04-14 15:51:01 +08:00
bcm.c can: bcm: add missing rcu read protection for procfs content 2025-06-10 16:18:03 +08:00
gw.c can: gw: fix RCU/BH usage in cgw_create_job() 2025-05-23 23:45:51 +08:00
isotp.c can: isotp: isotp_sendmsg(): fix TX state detection and wait behavior 2023-10-06 12:54:33 +02:00
proc.c can: statistics: use atomic access in hot path 2025-04-14 15:51:01 +08:00
raw.c can: raw: add missing refcount for memory leak fix 2023-08-22 17:18:50 -07:00