diff options
author | D. Wythe <alibuda@linux.alibaba.com> | 2023-11-03 14:07:38 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-11-06 10:01:07 +0000 |
commit | 5211c9729484c923f8d2e06bd29f9322cc42bb8f (patch) | |
tree | 4b7ec90ea3cbc136dcb5253670e487b5cdac7cc9 /fs/afs/vl_probe.c | |
parent | d93f9528573e1d419b69ca5ff4130201d05f6b90 (diff) |
net/smc: fix dangling sock under state SMC_APPFINCLOSEWAIT
Considering scenario:
smc_cdc_rx_handler
__smc_release
sock_set_flag
smc_close_active()
sock_set_flag
__set_bit(DEAD) __set_bit(DONE)
Dues to __set_bit is not atomic, the DEAD or DONE might be lost.
if the DEAD flag lost, the state SMC_CLOSED will be never be reached
in smc_close_passive_work:
if (sock_flag(sk, SOCK_DEAD) &&
smc_close_sent_any_close(conn)) {
sk->sk_state = SMC_CLOSED;
} else {
/* just shutdown, but not yet closed locally */
sk->sk_state = SMC_APPFINCLOSEWAIT;
}
Replace sock_set_flags or __set_bit to set_bit will fix this problem.
Since set_bit is atomic.
Fixes: b38d732477e4 ("smc: socket closing and linkgroup cleanup")
Signed-off-by: D. Wythe <alibuda@linux.alibaba.com>
Reviewed-by: Dust Li <dust.li@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs/afs/vl_probe.c')
0 files changed, 0 insertions, 0 deletions