Commit 7b2c3ea
can: bcm: add missing rcu list annotations and operations
sashiko-bot remarked the missing use of list_add_rcu() in
bcm_[rx|tx]_setup() to have a proper initialized bcm_op structure
when bcm_proc_show() traverses the bcm_op's under rcu_read_lock().
To cover all initial settings of the bcm_op's the list_add_rcu() calls
are moved to the end of the setup code.
While at it, also fix the mirroring removal side: bcm_release() called
bcm_remove_op() - which frees the op via call_rcu() - on ops that were
still linked in bo->tx_ops/bo->rx_ops, without list_del_rcu() first.
Unlink each op with list_del_rcu() before handing it to bcm_remove_op(),
matching the existing pattern in bcm_delete_tx_op()/bcm_delete_rx_op().
Reported-by: sashiko-reviews@lists.linux.dev
Closes: https://lore.kernel.org/linux-can/20260610094654.A1FFE1F00893@smtp.kernel.org/
Fixes: dac5e62 ("can: bcm: add missing rcu read protection for procfs content")
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://patch.msgid.link/20260714-bcm_fixes-v15-5-562f7e3e42da@hartkopp.net
Cc: stable@kernel.org
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>1 parent e6c24ba commit 7b2c3ea
1 file changed
Lines changed: 16 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
268 | | - | |
| 268 | + | |
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
| |||
1017 | 1017 | | |
1018 | 1018 | | |
1019 | 1019 | | |
| 1020 | + | |
1020 | 1021 | | |
1021 | 1022 | | |
1022 | 1023 | | |
| |||
1158 | 1159 | | |
1159 | 1160 | | |
1160 | 1161 | | |
1161 | | - | |
1162 | | - | |
| 1162 | + | |
1163 | 1163 | | |
1164 | 1164 | | |
1165 | 1165 | | |
| |||
1181 | 1181 | | |
1182 | 1182 | | |
1183 | 1183 | | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
1184 | 1188 | | |
1185 | 1189 | | |
1186 | 1190 | | |
| |||
1373 | 1377 | | |
1374 | 1378 | | |
1375 | 1379 | | |
1376 | | - | |
1377 | | - | |
1378 | | - | |
1379 | 1380 | | |
1380 | 1381 | | |
1381 | 1382 | | |
| |||
1449 | 1450 | | |
1450 | 1451 | | |
1451 | 1452 | | |
1452 | | - | |
1453 | 1453 | | |
1454 | 1454 | | |
1455 | 1455 | | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
1456 | 1459 | | |
1457 | 1460 | | |
1458 | 1461 | | |
| |||
1786 | 1789 | | |
1787 | 1790 | | |
1788 | 1791 | | |
1789 | | - | |
| 1792 | + | |
| 1793 | + | |
1790 | 1794 | | |
| 1795 | + | |
1791 | 1796 | | |
1792 | 1797 | | |
1793 | 1798 | | |
| |||
1818 | 1823 | | |
1819 | 1824 | | |
1820 | 1825 | | |
1821 | | - | |
| 1826 | + | |
| 1827 | + | |
1822 | 1828 | | |
| 1829 | + | |
1823 | 1830 | | |
1824 | 1831 | | |
1825 | 1832 | | |
| |||
0 commit comments