linux/net/smc
Cong Wang 8621436671 smc: disallow TCP_ULP in smc_setsockopt()
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.

It is hard to find a commit to blame, but we can apply this patch
since the beginning of TCP_ULP.

Reported-and-tested-by: syzbot+b54a1ce86ba4a623b7f0@syzkaller.appspotmail.com
Fixes: 734942cc4e ("tcp: ULP infrastructure")
Cc: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-05-05 12:52:45 -07:00
..
af_smc.c smc: disallow TCP_ULP in smc_setsockopt() 2021-05-05 12:52:45 -07:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile net/smc: Introduce generic netlink interface for diagnostic purposes 2020-12-01 17:56:12 -08:00
smc_cdc.c net: smc: convert tasklets to use new tasklet_setup() API 2020-11-07 10:41:15 -08:00
smc_cdc.h net/smc: pre-fetch send buffer outside of send_lock 2020-05-30 18:12:25 -07:00
smc_clc.c net/smc: Add support for obtaining system information 2020-12-01 17:56:13 -08:00
smc_clc.h net/smc: Add support for obtaining system information 2020-12-01 17:56:13 -08:00
smc_close.c net/smc: check variable before dereferencing in smc_close.c 2020-09-16 17:30:16 -07:00
smc_close.h net/smc: remove close abort worker 2019-10-22 11:23:44 -07:00
smc_core.c net/smc: use memcpy instead of snprintf to avoid out of bounds read 2021-01-12 20:22:01 -08:00
smc_core.h net: smc: Remove repeated struct declaration 2021-04-01 15:52:38 -07:00
smc_diag.c net/smc: Introduce SMCR get link command 2020-12-01 17:56:13 -08:00
smc_ib.c net/smc: use memcpy instead of snprintf to avoid out of bounds read 2021-01-12 20:22:01 -08:00
smc_ib.h net/smc: Add support for obtaining SMCR device list 2020-12-01 17:56:13 -08:00
smc_ism.c net/smc: use memcpy instead of snprintf to avoid out of bounds read 2021-01-12 20:22:01 -08:00
smc_ism.h net/smc: Add support for obtaining SMCD device list 2020-12-01 17:56:13 -08:00
smc_llc.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-10-15 12:43:21 -07:00
smc_llc.h net/smc: move add link processing for new device into llc layer 2020-07-19 15:30:22 -07:00
smc_netlink.c net/smc: Add support for obtaining SMCR device list 2020-12-01 17:56:13 -08:00
smc_netlink.h net/smc: Add support for obtaining system information 2020-12-01 17:56:13 -08:00
smc_netns.h net/smc: introduce list of pnetids for Ethernet devices 2020-09-28 15:19:03 -07:00
smc_pnet.c net/smc: Add diagnostic information to smc ib-device 2020-12-01 17:56:12 -08:00
smc_pnet.h net/smc: determine proposed ISM devices 2020-09-28 15:19:03 -07:00
smc_rx.c fs: make the pipe_buf_operations ->confirm operation optional 2020-05-20 12:11:26 -04:00
smc_rx.h
smc_tx.c net/smc: use separate work queues for different worker types 2020-09-10 15:24:27 -07:00
smc_tx.h
smc_wr.c net: smc: convert tasklets to use new tasklet_setup() API 2020-11-07 10:41:15 -08:00
smc_wr.h net/smc: wait for departure of an IB message 2020-05-04 10:54:39 -07:00
smc.h net/smc: introduce CLC first contact extension 2020-09-28 15:19:03 -07:00