* [PATCH net v2] net/smc: fix mismatch between CLC header and proposal
@ 2025-11-07 2:40 D. Wythe
2025-11-07 15:36 ` Alexandra Winter
0 siblings, 1 reply; 2+ messages in thread
From: D. Wythe @ 2025-11-07 2:40 UTC (permalink / raw)
To: mjambigi, wenjia, wintera, dust.li, tonylu, guwen
Cc: kuba, davem, netdev, linux-s390, linux-rdma, pabeni, edumazet,
sidraya, jaka
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: 8c3dca341aea ("net/smc: build and send V2 CLC proposal")
Signed-off-by: D. Wythe <alibuda@linux.alibaba.com>
---
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(+)
diff --git a/net/smc/smc_clc.c b/net/smc/smc_clc.c
index 157aace169d4..87c87edadde7 100644
--- a/net/smc/smc_clc.c
+++ b/net/smc/smc_clc.c
@@ -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) +
--
2.45.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH net v2] net/smc: fix mismatch between CLC header and proposal
2025-11-07 2:40 [PATCH net v2] net/smc: fix mismatch between CLC header and proposal D. Wythe
@ 2025-11-07 15:36 ` Alexandra Winter
0 siblings, 0 replies; 2+ messages in thread
From: Alexandra Winter @ 2025-11-07 15:36 UTC (permalink / raw)
To: D. Wythe, mjambigi, wenjia, dust.li, tonylu, guwen
Cc: kuba, davem, netdev, linux-s390, linux-rdma, pabeni, edumazet,
sidraya, jaka
On 07.11.25 03:40, D. Wythe wrote:
> Fixes: 8c3dca341aea ("net/smc: build and send V2 CLC proposal")
> Signed-off-by: D. Wythe <alibuda@linux.alibaba.com>
Thank you, D. Wythe
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-11-07 15:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-07 2:40 [PATCH net v2] net/smc: fix mismatch between CLC header and proposal D. Wythe
2025-11-07 15:36 ` Alexandra Winter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).