Commit dac5e62
can: bcm: add missing rcu read protection for procfs content
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: f1b4e32 ("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>1 parent c2aba69 commit dac5e62
1 file changed
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
223 | 225 | | |
224 | 226 | | |
225 | 227 | | |
| |||
275 | 277 | | |
276 | 278 | | |
277 | 279 | | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
278 | 283 | | |
279 | 284 | | |
280 | 285 | | |
| |||
858 | 863 | | |
859 | 864 | | |
860 | 865 | | |
861 | | - | |
| 866 | + | |
862 | 867 | | |
863 | 868 | | |
864 | 869 | | |
| |||
878 | 883 | | |
879 | 884 | | |
880 | 885 | | |
881 | | - | |
| 886 | + | |
882 | 887 | | |
883 | 888 | | |
884 | 889 | | |
| |||
1296 | 1301 | | |
1297 | 1302 | | |
1298 | 1303 | | |
1299 | | - | |
| 1304 | + | |
1300 | 1305 | | |
1301 | 1306 | | |
1302 | 1307 | | |
| |||
0 commit comments