Commit 4c61d809 authored by Kory Maincent's avatar Kory Maincent Committed by Jakub Kicinski
Browse files

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: default avatar <syzbot+a344326c05c98ba19682@syzkaller.appspotmail.com>
Closes: https://lore.kernel.org/netdev/676147f8.050a0220.37aaf.0154.GAE@google.com/


Fixes: b9e3f7dc ("net: ethtool: tsinfo: Enhance tsinfo to support several hwtstamp by net topology")
Signed-off-by: default avatarKory Maincent <kory.maincent@bootlin.com>
Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20241220083741.175329-1-kory.maincent@bootlin.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 3f8f2e93
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment