net/smc: fix mismatch between CLC header and proposal
Subsystems (5)
D. Wythe
maintainerPATCH v2 1/1 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.
---
v2: Update ini->smc_type_v1 on prefix setup failure to avoid stale values,
as suggested by Alexandra Winter.
net/smc/smc_clc.c | 1 + 1 file changed, 1 insertion(+)
net/smc/smc_clc.c +1 -0
@@ -890,6 +890,7 @@ int smc_clc_send_proposal(struct smc_sock *smc, struct smc_init_info *ini)return SMC_CLC_DECL_CNFERR ; } pclc_base->hdr.typev1 =SMC_TYPE_N ; + ini->smc_type_v1 =SMC_TYPE_N ; }else { pclc_base->iparea_offset =htons (sizeof (*pclc_smcd)); plen += sizeof(*pclc_prfx) +
Signature · 1 line
2.45.0
Quoted 2 lines · D. Wythe
Fixes 8c3dca341aea ("net/smc: build and send V2 CLC proposal")Signed-off-by D. Wythe <[email protected]>
Thank you, D. Wythe
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Fri, 7 Nov 2025 10:40:29 +0800 you wrote:
The current CLC proposal message construction uses a mix of
ini->smc_type_v1/v2andpclc_base->hdr.typev1/v2to decide whether to include optional extensions (IPv6 prefix extension for v1, and v2 extension). This leads to a critical inconsistency: whensmc_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.[...]
Here is the summary with links:
- [net,v2] net/smc: fix mismatch between CLC header and proposal
https://git.kernel.org/netdev/net/c/ec33f2e5a2d0
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html