linux/net/smc
D. Wythe ec33f2e5a2 net/smc: fix mismatch between CLC header and proposal
The current CLC proposal message construction uses a mix of
`ini->smc_type_v1/v2` and `pclc_base->hdr.typev1/v2` to decide whether
to include optional extensions (IPv6 prefix extension for v1, and v2
extension). This leads to a critical inconsistency: when
`smc_clc_prfx_set()` fails - for example, in IPv6-only environments with
only link-local addresses, or when the local IP address and the outgoing
interface’s network address are not in the same subnet.

As a result, the proposal message is assembled using the stale
`ini->smc_type_v1` value—causing the IPv6 prefix extension to be
included even though the header indicates v1 is not supported.
The peer then receives a malformed CLC proposal where the header type
does not match the payload, and immediately resets the connection.

The fix ensures consistency between the CLC header flags and the actual
payload by synchronizing `ini->smc_type_v1` with `pclc_base->hdr.typev1`
when prefix setup fails.

Fixes: 8c3dca341a ("net/smc: build and send V2 CLC proposal")
Signed-off-by: D. Wythe <alibuda@linux.alibaba.com>
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
Link: https://patch.msgid.link/20251107024029.88753-1-alibuda@linux.alibaba.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-11-10 17:52:09 -08:00
..
af_smc.c dibs: Define dibs_client_ops and dibs_dev_ops 2025-09-23 11:13:22 +02:00
Kconfig dibs: Move event handling to dibs layer 2025-09-23 11:13:22 +02:00
Makefile dibs: Move data path to dibs layer 2025-09-23 11:13:22 +02:00
smc.h smc: Fix various oops due to inet_sock type confusion. 2025-07-14 17:12:42 -07:00
smc_cdc.c net/smc: adapt cursor update when sndbuf and peer DMB are merged 2024-04-30 13:24:48 +02:00
smc_cdc.h
smc_clc.c net/smc: fix mismatch between CLC header and proposal 2025-11-10 17:52:09 -08:00
smc_clc.h net/smc: check smcd_v2_ext_offset when receiving proposal msg 2024-12-15 12:34:59 +00:00
smc_close.c
smc_close.h
smc_core.c dibs: Local gid for dibs devices 2025-09-23 11:13:22 +02:00
smc_core.h net/smc: Decouple sf and attached send_buf in smc_loopback 2025-09-23 11:13:21 +02:00
smc_diag.c dibs: Local gid for dibs devices 2025-09-23 11:13:22 +02:00
smc_ib.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-09-04 13:33:00 -07:00
smc_ib.h
smc_inet.c net/smc: fix general protection fault in __smc_diag_dump 2025-10-20 17:46:06 -07:00
smc_inet.h net/smc: Introduce IPPROTO_SMC 2024-06-17 13:14:09 +01:00
smc_ism.c dibs: Move event handling to dibs layer 2025-09-23 11:13:22 +02:00
smc_ism.h dibs: Move data path to dibs layer 2025-09-23 11:13:22 +02:00
smc_llc.c net/smc: support SMC-R V2 for rdma devices with max_recv_sge equals to 1 2024-12-12 13:50:00 +01:00
smc_llc.h
smc_netlink.c
smc_netlink.h
smc_netns.h
smc_pnet.c dibs: Create class dibs 2025-09-23 11:13:22 +02:00
smc_pnet.h
smc_rx.c net/smc: fix data error when recvmsg with MSG_PEEK flag 2025-01-13 18:59:00 -08:00
smc_rx.h net/smc: fix data error when recvmsg with MSG_PEEK flag 2025-01-13 18:59:00 -08:00
smc_stats.c net/smc: introduce statistics for ringbufs usage of net namespace 2024-08-20 11:38:23 +02:00
smc_stats.h net/smc: introduce statistics for ringbufs usage of net namespace 2024-08-20 11:38:23 +02:00
smc_sysctl.c net/smc: add sysctl for smc_limit_hs 2024-09-10 12:11:04 +02:00
smc_sysctl.h
smc_tracepoint.c
smc_tracepoint.h tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
smc_tx.c net/smc: Decouple sf and attached send_buf in smc_loopback 2025-09-23 11:13:21 +02:00
smc_tx.h
smc_wr.c net/smc: support SMC-R V2 for rdma devices with max_recv_sge equals to 1 2024-12-12 13:50:00 +01:00
smc_wr.h