Commit 4c61d80
net: ethtool: Fix suspicious rcu_dereference usage
The __ethtool_get_ts_info function can be called with or without the
rtnl lock held. When the rtnl lock is not held, using rtnl_dereference()
triggers a warning due to the lack of lock context.
Add an rcu_read_lock() to ensure the lock is acquired and to maintain
synchronization.
Reported-by: syzbot+a344326c05c98ba19682@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/netdev/676147f8.050a0220.37aaf.0154.GAE@google.com/
Fixes: b9e3f7d ("net: ethtool: tsinfo: Enhance tsinfo to support several hwtstamp by net topology")
Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20241220083741.175329-1-kory.maincent@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent 3f8f2e9 commit 4c61d80
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
870 | 870 | | |
871 | 871 | | |
872 | 872 | | |
873 | | - | |
| 873 | + | |
| 874 | + | |
874 | 875 | | |
875 | 876 | | |
876 | 877 | | |
| |||
887 | 888 | | |
888 | 889 | | |
889 | 890 | | |
| 891 | + | |
890 | 892 | | |
891 | 893 | | |
892 | 894 | | |
| 895 | + | |
893 | 896 | | |
894 | 897 | | |
895 | 898 | | |
| |||
0 commit comments