1
0
Fork 0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-01-22 07:53:11 -05:00
linux/net/smc
Guangguan Wang c5b8ee5022 net/smc: check return value of sock_recvmsg when draining clc data
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: fb4f79264c ("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>
2024-12-15 12:34:59 +00:00
..
af_smc.c net/smc: check smcd_v2_ext_offset when receiving proposal msg 2024-12-15 12:34:59 +00: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 2024-12-15 12:34:59 +00: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 net/smc: protect link down work from execute after lgr freed 2024-12-15 12:34:59 +00:00
smc_core.h
smc_diag.c
smc_ib.c
smc_ib.h
smc_inet.c
smc_inet.h
smc_ism.c
smc_ism.h
smc_llc.c
smc_llc.h
smc_loopback.c
smc_loopback.h
smc_netlink.c
smc_netlink.h
smc_netns.h
smc_pnet.c
smc_pnet.h
smc_rx.c
smc_rx.h
smc_stats.c
smc_stats.h
smc_sysctl.c
smc_sysctl.h
smc_tracepoint.c
smc_tracepoint.h
smc_tx.c
smc_tx.h
smc_wr.c
smc_wr.h