net/sched: make psched_mtu() RTNL-less safe
authorPedro Tammela <pctammela@mojatatu.com>
Tue, 11 Jul 2023 02:16:34 +0000 (23:16 -0300)
committerJakub Kicinski <kuba@kernel.org>
Wed, 12 Jul 2023 22:59:33 +0000 (15:59 -0700)
commit150e33e62c1fa4af5aaab02776b6c3812711d478
treed2b769621b1ba460aae88201845b2185154ce6b4
parent1e9cb763e9bacf0c932aa948f50dcfca6f519a26
net/sched: make psched_mtu() RTNL-less safe

Eric Dumazet says[1]:
-------
Speaking of psched_mtu(), I see that net/sched/sch_pie.c is using it
without holding RTNL, so dev->mtu can be changed underneath.
KCSAN could issue a warning.
-------

Annotate dev->mtu with READ_ONCE() so KCSAN don't issue a warning.

[1] https://lore.kernel.org/all/CANn89iJoJO5VtaJ-2=_d2aOQhb0Xw8iBT_Cxqp2HyuS-zj6azw@mail.gmail.com/

v1 -> v2: Fix commit message

Fixes: d4b36210c2e6 ("net: pkt_sched: PIE AQM scheme")
Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/20230711021634.561598-1-pctammela@mojatatu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/pkt_sched.h