kernel_samsung_a53x/net/smc
Guangguan Wang ce3b97bfca net/smc: check return value of sock_recvmsg when draining clc data
[ Upstream commit c5b8ee5022a19464783058dc6042e8eefa34e8cd ]

When receiving clc msg, the field length in smc_clc_msg_hdr indicates the
length of msg should be received from network and the value should not be
fully trusted as it is from the network. Once the value of length exceeds
the value of buflen in function smc_clc_wait_msg it may run into deadloop
when trying to drain the remaining data exceeding buflen.

This patch checks the return value of sock_recvmsg when draining data in
case of deadloop in draining.

Fixes: fb4f79264c0f ("net/smc: tolerate future SMCD versions")
Signed-off-by: Guangguan Wang <guangguan.wang@linux.alibaba.com>
Reviewed-by: Wen Gu <guwen@linux.alibaba.com>
Reviewed-by: D. Wythe <alibuda@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-01-15 16:29:41 +01:00
..
af_smc.c net/smc: check iparea_offset and ipv6_prefixes_cnt when receiving proposal msg 2025-01-15 16:29:41 +01:00
Kconfig
Makefile
smc.h
smc_cdc.c
smc_cdc.h
smc_clc.c net/smc: check return value of sock_recvmsg when draining clc data 2025-01-15 16:29:41 +01:00
smc_clc.h net/smc: check iparea_offset and ipv6_prefixes_cnt when receiving proposal msg 2025-01-15 16:29:41 +01:00
smc_close.c net/smc: put sk reference if close work was canceled 2024-11-18 11:43:08 +01:00
smc_close.h
smc_core.c Revert "net/smc: Allow SMC-D 1MB DMB allocations" 2024-11-24 00:23:56 +01:00
smc_core.h
smc_diag.c net/smc: fix illegal rmb_desc access in SMC-D connection dump 2024-11-18 12:12:59 +01:00
smc_ib.c
smc_ib.h
smc_ism.c
smc_ism.h
smc_llc.c
smc_llc.h
smc_netns.h
smc_pnet.c net/smc: Fix searching in list of known pnetids in smc_pnet_add_pnetid 2024-11-23 23:21:59 +01:00
smc_pnet.h
smc_rx.c
smc_rx.h
smc_tx.c
smc_tx.h
smc_wr.c
smc_wr.h