linux-stable/net/smc
Tony Lu 42dafeb5da net/smc: Keep smc_close_final rc during active close
commit 00e158fb91 upstream.

When smc_close_final() returns error, the return code overwrites by
kernel_sock_shutdown() in smc_close_active(). The return code of
smc_close_final() is more important than kernel_sock_shutdown(), and it
will pass to userspace directly.

Fix it by keeping both return codes, if smc_close_final() raises an
error, return it or kernel_sock_shutdown()'s.

Link: https://lore.kernel.org/linux-s390/1f67548e-cbf6-0dce-82b5-10288a4583bd@linux.ibm.com/
Fixes: 606a63c978 ("net/smc: Ensure the active closing peer first closes clcsock")
Suggested-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Tony Lu <tonylu@linux.alibaba.com>
Reviewed-by: Wen Gu <guwen@linux.alibaba.com>
Acked-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-08 08:46:55 +01:00
..
af_smc.c net/smc: Don't call clcsock shutdown twice when smc shutdown 2021-12-08 08:46:49 +01:00
Kconfig
Makefile
smc.h net/smc: fix TCP fallback socket release 2019-01-09 17:14:46 +01:00
smc_cdc.c
smc_cdc.h
smc_clc.c
smc_clc.h
smc_close.c net/smc: Keep smc_close_final rc during active close 2021-12-08 08:46:55 +01:00
smc_close.h
smc_core.c net/smc: prevent races between smc_lgr_terminate() and smc_conn_free() 2019-12-05 15:37:57 +01:00
smc_core.h
smc_diag.c net/smc: fix leak of kernel memory to user space 2020-02-28 16:36:09 +01:00
smc_ib.c net/smc: check for valid ib_client_data 2020-03-20 10:54:20 +01:00
smc_ib.h
smc_llc.c
smc_llc.h
smc_pnet.c
smc_pnet.h
smc_rx.c
smc_rx.h
smc_tx.c net/smc: make sure EPOLLOUT is raised 2019-09-06 10:20:50 +02:00
smc_tx.h
smc_wr.c net/smc: use after free fix in smc_wr_tx_put_slot() 2019-12-17 20:38:01 +01:00
smc_wr.h