Message ID | 20210505194048.8377-1-xiyou.wangcong@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 8621436671f3a4bba5db57482e1ee604708bf1eb |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net,v2] smc: disallow TCP_ULP in smc_setsockopt() | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Clearly marked for net |
netdev/subject_prefix | success | Link |
netdev/cc_maintainers | fail | 3 blamed authors not CCed: borisp@mellanox.com davem@davemloft.net davejwatson@fb.com; 4 maintainers not CCed: borisp@mellanox.com davejwatson@fb.com davem@davemloft.net kuba@kernel.org |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 0 this patch: 0 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 16 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 0 this patch: 0 |
netdev/header_inline | success | Link |
Hello: This patch was applied to netdev/net.git (refs/heads/master): On Wed, 5 May 2021 12:40:48 -0700 you wrote: > From: Cong Wang <cong.wang@bytedance.com> > > syzbot is able to setup kTLS on an SMC socket which coincidentally > uses sk_user_data too. Later, kTLS treats it as psock so triggers a > refcnt warning. The root cause is that smc_setsockopt() simply calls > TCP setsockopt() which includes TCP_ULP. I do not think it makes > sense to setup kTLS on top of SMC sockets, so we should just disallow > this setup. > > [...] Here is the summary with links: - [net,v2] smc: disallow TCP_ULP in smc_setsockopt() https://git.kernel.org/netdev/net/c/8621436671f3 You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index be3e80b3e27f..5eff7cccceff 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c @@ -2161,6 +2161,9 @@ static int smc_setsockopt(struct socket *sock, int level, int optname, struct smc_sock *smc; int val, rc; + if (level == SOL_TCP && optname == TCP_ULP) + return -EOPNOTSUPP; + smc = smc_sk(sk); /* generic setsockopts reaching us here always apply to the @@ -2185,7 +2188,6 @@ static int smc_setsockopt(struct socket *sock, int level, int optname, if (rc || smc->use_fallback) goto out; switch (optname) { - case TCP_ULP: case TCP_FASTOPEN: case TCP_FASTOPEN_CONNECT: case TCP_FASTOPEN_KEY: