summaryrefslogtreecommitdiff
path: root/rust/helpers
diff options
context:
space:
mode:
authorVincent Mailhol <mailhol@kernel.org>2025-09-23 15:37:08 +0900
committerMarc Kleine-Budde <mkl@pengutronix.de>2025-09-23 10:04:58 +0200
commitc67732d067860850b767c81736b49f88a946bffb (patch)
tree295f7fb0622dac2602415bfb25f007632c4ad0e6 /rust/helpers
parentc0b595230cc19833f3a3def766a5e9865b80f8fa (diff)
can: annotate mtu accesses with READ_ONCE()
As hinted in commit 501a90c94510 ("inet: protect against too small mtu values."), net_device->mtu is vulnerable to race conditions if it is written and read without holding the RTNL. At the moment, all the writes are done while the interface is down, either in the devices' probe() function or in can_changelink(). So there are no such issues yet. But upcoming changes will allow to modify the MTU while the CAN XL devices are up. In preparation to the introduction of CAN XL, annotate all the net_device->mtu accesses which are not yet guarded by the RTNL with a READ_ONCE(). Note that all the write accesses are already either guarded by the RTNL or are already annotated and thus need no changes. Signed-off-by: Vincent Mailhol <mailhol@kernel.org> Link: https://patch.msgid.link/20250923-can-fix-mtu-v3-1-581bde113f52@kernel.org Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'rust/helpers')
0 files changed, 0 insertions, 0 deletions