linux/net
Guangguan Wang 7a6927814b net/smc: check return value of sock_recvmsg when draining clc data
[ Upstream commit c5b8ee5022 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-12-27 13:58:47 +01:00
..
6lowpan 6lowpan: Remove redundant initialisation. 2023-03-29 08:22:52 +01:00
9p 9p/xen: fix release of IRQ 2024-12-09 10:32:57 +01:00
802 treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
8021q net: gro: fix udp bad offset in socket lookup by adding {inner_}network_offset to napi_gro_cb 2024-05-17 12:02:07 +02:00
appletalk appletalk: Fix Use-After-Free in atalk_ioctl 2023-12-20 17:01:50 +01:00
atm atm: Fix Use-After-Free in do_vcc_ioctl 2023-12-20 17:01:48 +01:00
ax25 ax25: Replace kfree() in ax25_dev_free() with ax25_dev_put() 2024-06-21 14:38:14 +02:00
batman-adv batman-adv: Do not let TT changes list grows indefinitely 2024-12-19 18:11:27 +01:00
bluetooth Bluetooth: SCO: Add support for 16 bits transparent voice setting 2024-12-19 18:11:34 +01:00
bpf bpf, test_run: Fix LIVE_FRAME frame update after a page has been recycled 2024-11-08 16:28:19 +01:00
bpfilter net: Use umd_cleanup_helper() 2023-05-31 13:06:57 +02:00
bridge bridge: Handle error of rtnl_register_module(). 2024-10-17 15:24:29 +02:00
caif sock: Remove ->sendpage*() in favour of sendmsg(MSG_SPLICE_PAGES) 2023-06-24 15:50:13 -07:00
can net: af_can: do not leave a dangling sk pointer in can_create() 2024-12-14 20:00:04 +01:00
ceph libceph: init the cursor when preparing sparse read in msgr2 2024-10-17 15:24:10 +02:00
core net: defer final 'struct net' free in netns dismantle 2024-12-19 18:11:28 +01:00
dcb net: dcb: choose correct policy to parse DCB_ATTR_BCN 2023-08-01 21:07:46 -07:00
dccp dccp: Fix memory leak in dccp_feat_change_recv 2024-12-14 19:59:36 +01:00
devlink devlink: fix port new reply cmd type 2024-03-26 18:20:11 -04:00
dns_resolver keys, dns: Fix size check of V1 server-list header 2024-01-25 15:35:41 -08:00
dsa net: dsa: fix netdev_priv() dereference before check on non-DSA netdevice events 2024-10-10 11:58:07 +02:00
ethernet ethernet: Add helper for assigning packet type when dest address does not match device address 2024-05-02 16:32:46 +02:00
ethtool ethtool: Fix wrong mod state in case of verbose and no_mask bitset 2024-12-14 19:59:39 +01:00
handshake net/handshake: Fix handshake_req_destroy_test1 2024-02-23 09:24:50 +01:00
hsr net: hsr: avoid potential out-of-bound access in fill_frame_info() 2024-12-14 19:59:34 +01:00
ieee802154 net: ieee802154: do not leave a dangling sk pointer in ieee802154_create() 2024-12-14 20:00:04 +01:00
ife net: sched: ife: fix potential use-after-free 2024-01-01 12:42:30 +00:00
ipv4 tcp: check space before adding MPTCP SYN options 2024-12-19 18:11:21 +01:00
ipv6 net: inet6: do not leave a dangling sk pointer in inet6_create() 2024-12-14 20:00:04 +01:00
iucv s390/iucv: MSG_PEEK causes memory leak in iucv_sock_destruct() 2024-12-09 10:32:33 +01:00
kcm kcm: Serialise kcm_sendmsg() for the same socket. 2024-08-29 17:33:46 +02:00
key Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-08-18 12:44:56 -07:00
l2tp ipv6: introduce dst_rt6_info() helper 2024-12-14 19:59:35 +01:00
l3mdev l3mdev: l3mdev_master_upper_ifindex_by_index_rcu should be using netdev_master_upper_dev_get_rcu 2022-04-15 14:27:24 -07:00
lapb net: lapb: Use list_for_each_entry() to simplify code in lapb_iface.c 2021-06-08 16:31:25 -07:00
llc llc: Improve setsockopt() handling of malformed user input 2024-12-09 10:32:35 +01:00
mac80211 wifi: mac80211: fix station NSS capability initialization order 2024-12-19 18:11:26 +01:00
mac802154 mac802154: Fix potential RCU dereference issue in mac802154_scan_worker 2024-10-10 11:57:59 +02:00
mctp mctp: Handle error of rtnl_register_module(). 2024-10-17 15:24:29 +02:00
mpls ipv6: introduce dst_rt6_info() helper 2024-12-14 19:59:35 +01:00
mptcp mptcp: fix possible integer overflow in mptcp_reset_tout_timer 2024-12-09 10:31:42 +01:00
ncsi net/ncsi: Fix the multi thread manner of NCSI driver 2024-06-21 14:38:14 +02:00
netfilter netfilter: nf_tables: do not defer rule destruction via call_rcu 2024-12-19 18:11:32 +01:00
netlabel calipso: fix memory leak in netlbl_calipso_add_pass() 2024-01-25 15:35:14 -08:00
netlink sock_diag: add module pointer to "struct sock_diag_handler" 2024-12-09 10:32:09 +01:00
netrom netrom: Fix a memory leak in nr_heartbeat_expiry() 2024-06-27 13:49:06 +02:00
nfc nfc: llcp: fix nfc_llcp_setsockopt() unsafe copies 2024-08-19 06:04:28 +02:00
nsh nsh: Restore skb->{protocol,data,mac_header} for outer header in nsh_gso_segment(). 2024-05-17 12:02:02 +02:00
openvswitch net: ovs: fix ovs_drop_reasons error 2024-08-29 17:33:50 +02:00
packet af_packet: avoid erroring out after sock_init_data() in packet_create() 2024-12-14 20:00:04 +01:00
phonet phonet: Handle error of rtnl_register_module(). 2024-10-17 15:24:30 +02:00
psample psample: Require 'CAP_NET_ADMIN' when joining "packets" group 2023-12-13 18:45:10 +01:00
qrtr net: qrtr: Update packets cloning when broadcasting 2024-10-04 16:29:41 +02:00
rds net:rds: Fix possible deadlock in rds_message_put 2024-08-19 06:04:27 +02:00
rfkill net: rfkill: gpio: Add check for clk_enable() 2024-12-09 10:32:11 +01:00
rose net/rose: fix races in rose_kill_by_device() 2024-01-01 12:42:31 +00:00
rxrpc rxrpc: Improve setsockopt() handling of malformed user input 2024-12-09 10:32:35 +01:00
sched net: sched: fix ordering of qlen adjustment 2024-12-27 13:58:41 +01:00
sctp ipv6: introduce dst_rt6_info() helper 2024-12-14 19:59:35 +01:00
smc net/smc: check return value of sock_recvmsg when draining clc data 2024-12-27 13:58:47 +01:00
strparser strparser: pad sk_skb_cb to avoid straddling cachelines 2022-07-08 18:38:44 -07:00
sunrpc sunrpc: fix one UAF issue caused by sunrpc kernel tcp socket 2024-12-09 10:33:00 +01:00
switchdev net: bridge: switchdev: Skip MDB replays of deferred events on offload 2024-03-01 13:35:06 +01:00
tipc tipc: fix NULL deref in cleanup_bearer() 2024-12-19 18:11:27 +01:00
tls tls: fix missing memory barrier in tls_init 2024-06-12 11:12:50 +02:00
unix splice: do not checksum AF_UNIX sockets 2024-12-19 18:11:21 +01:00
vmw_vsock bpf, vsock: Invoke proto::close on close() 2024-12-14 19:59:47 +01:00
wireless wifi: cfg80211: sme: init n_channels before channels[] access 2024-12-19 18:11:27 +01:00
x25 net/x25: fix incorrect parameter validation in the x25_getsockopt() function 2024-03-26 18:19:41 -04:00
xdp xsk: fix OOB map writes when deleting elements 2024-12-14 19:59:57 +01:00
xfrm ipv6: introduce dst_rt6_info() helper 2024-12-14 19:59:35 +01:00
compat.c net/compat: Update msg_control_is_user when setting a kernel pointer 2023-04-14 11:09:27 +01:00
devres.c net: devres: Correct a grammatical error 2021-06-11 12:55:28 -07:00
Kconfig bpf: Add fd-based tcx multi-prog infra with link support 2023-07-19 10:07:27 -07:00
Kconfig.debug net: make NET_(DEV|NS)_REFCNT_TRACKER depend on NET 2022-09-20 14:23:56 -07:00
Makefile net/handshake: Create a NETLINK service for handling handshake requests 2023-04-19 18:48:48 -07:00
socket.c net: explicitly clear the sk pointer, when pf->create fails 2024-10-17 15:24:35 +02:00
sysctl_net.c sysctl: treewide: drop unused argument ctl_table_root::set_ownership(table) 2024-08-11 12:47:13 +02:00