]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
smc: Use __sk_dst_get() and dst_dev_rcu() in smc_clc_prfx_match().
authorKuniyuki Iwashima <kuniyu@google.com>
Tue, 16 Sep 2025 21:47:21 +0000 (21:47 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 18 Sep 2025 01:10:22 +0000 (18:10 -0700)
commit235f81045c008169cc4e1955b4a64e118eebe61b
tree9cb3378d26a4eff57793fd51dc31bcc684b4526f
parent935d783e5de9b64587f3adb25641dd8385e64ddb
smc: Use __sk_dst_get() and dst_dev_rcu() in smc_clc_prfx_match().

smc_clc_prfx_match() is called from smc_listen_work() and
not under RCU nor RTNL.

Using sk_dst_get(sk)->dev could trigger UAF.

Let's use __sk_dst_get() and dst_dev_rcu().

Note that the returned value of smc_clc_prfx_match() is not
used in the caller.

Fixes: a046d57da19f ("smc: CLC handshake (incl. preparation steps)")
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20250916214758.650211-4-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/smc/smc_clc.c