android_kernel_msm-6.1_noth.../net
D. Wythe 94a0ae698b net/smc: avoid data corruption caused by decline
[ Upstream commit e6d71b437abc2f249e3b6a1ae1a7228e09c6e563 ]

We found a data corruption issue during testing of SMC-R on Redis
applications.

The benchmark has a low probability of reporting a strange error as
shown below.

"Error: Protocol error, got "\xe2" as reply type byte"

Finally, we found that the retrieved error data was as follows:

0xE2 0xD4 0xC3 0xD9 0x04 0x00 0x2C 0x20 0xA6 0x56 0x00 0x16 0x3E 0x0C
0xCB 0x04 0x02 0x01 0x00 0x00 0x20 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xE2

It is quite obvious that this is a SMC DECLINE message, which means that
the applications received SMC protocol message.
We found that this was caused by the following situations:

client                  server
        ¦  clc proposal
        ------------->
        ¦  clc accept
        <-------------
        ¦  clc confirm
        ------------->
wait llc confirm
			send llc confirm
        ¦failed llc confirm
        ¦   x------
(after 2s)timeout
                        wait llc confirm rsp

wait decline

(after 1s) timeout
                        (after 2s) timeout
        ¦   decline
        -------------->
        ¦   decline
        <--------------

As a result, a decline message was sent in the implementation, and this
message was read from TCP by the already-fallback connection.

This patch double the client timeout as 2x of the server value,
With this simple change, the Decline messages should never cross or
collide (during Confirm link timeout).

This issue requires an immediate solution, since the protocol updates
involve a more long-term solution.

Fixes: 0fb0b02bd6 ("net/smc: adapt SMC client code to use the LLC flow")
Signed-off-by: D. Wythe <alibuda@linux.alibaba.com>
Reviewed-by: Wen Gu <guwen@linux.alibaba.com>
Reviewed-by: Wenjia Zhang <wenjia@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-12-03 07:32:08 +01:00
..
6lowpan
9p 9p: v9fs_listxattr: fix %s null argument warning 2023-11-28 17:07:01 +00:00
802
8021q
appletalk
atm
ax25
batman-adv
bluetooth Bluetooth: Fix double free in hci_conn_cleanup 2023-11-28 17:06:56 +00:00
bpf
bpfilter
bridge netfilter: nf_conntrack_bridge: initialize err to 0 2023-11-28 17:07:05 +00:00
caif
can
ceph
core net: annotate data-races around sk->sk_dst_pending_confirm 2023-11-28 17:06:56 +00:00
dcb
dccp dccp/tcp: Call security_inet_conn_request() after setting IPv6 addresses. 2023-11-20 11:52:16 +01:00
devlink
dns_resolver
dsa
ethernet
ethtool
hsr hsr: Prevent use after free in prp_create_tagged_frame() 2023-11-20 11:52:15 +01:00
ieee802154
ife
ipv4 ipv4: Correct/silence an endian warning in __ip_do_redirect 2023-12-03 07:32:07 +01:00
ipv6 dccp/tcp: Call security_inet_conn_request() after setting IPv6 addresses. 2023-11-20 11:52:16 +01:00
iucv
kcm
key
l2tp
l3mdev
lapb
llc llc: verify mac len before reading mac header 2023-11-20 11:52:15 +01:00
mac80211 wifi: mac80211: don't return unset power in ieee80211_get_tx_power() 2023-11-28 17:06:55 +00:00
mac802154
mctp
mpls
mptcp mptcp: fix setsockopt(IP_TOS) subflow locking 2023-11-28 17:07:20 +00:00
ncsi Revert ncsi: Propagate carrier gain/loss events to the NCSI controller 2023-11-28 17:07:18 +00:00
netfilter netfilter: nf_tables: split async and sync catchall in two functions 2023-11-28 17:07:12 +00:00
netlabel
netlink
netrom
nfc
nsh
openvswitch
packet
phonet
psample
qrtr
rds
rfkill
rose
rxrpc
sched net: sched: cls_u32: Fix allocation size in u32_init() 2023-11-08 14:10:57 +01:00
sctp
smc net/smc: avoid data corruption caused by decline 2023-12-03 07:32:08 +01:00
strparser
sunrpc svcrdma: Drop connection after an RDMA Read error 2023-11-28 17:07:11 +00:00
switchdev
tipc tipc: Fix kernel-infoleak due to uninitialized TLV value 2023-11-28 17:07:05 +00:00
tls tls: Use size_add() in call to struct_size() 2023-11-20 11:51:52 +01:00
unix af_unix: fix use-after-free in unix_stream_read_actor() 2023-11-28 17:07:05 +00:00
vmw_vsock vsock: read from socket's error queue 2023-11-28 17:06:56 +00:00
wireless wifi: cfg80211: add flush functions for wiphy work 2023-11-20 11:51:51 +01:00
x25
xdp
xfrm
compat.c
devres.c
Kconfig
Kconfig.debug
Makefile
socket.c
sysctl_net.c