]> git.baikalelectronics.ru Git - kernel.git/commit
net/smc: fix restoring of fallback changes
authorKarsten Graul <kgraul@linux.ibm.com>
Sat, 18 Jul 2020 13:06:18 +0000 (15:06 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 19 Jul 2020 22:30:23 +0000 (15:30 -0700)
commit5fb0f08b42175d9aa14a3d486dfa295971951718
treed5011e7cb053277f387c64a1c9d1425f96327b5a
parent2308578a841b8b1b1c04d0051dcfc3db3ec27e66
net/smc: fix restoring of fallback changes

When a listen socket is closed then all non-accepted sockets in its
accept queue are to be released. Inside __smc_release() the helper
smc_restore_fallback_changes() restores the changes done to the socket
without to check if the clcsocket has a file set. This can result in
a crash. Fix this by checking the file pointer first.

Reviewed-by: Ursula Braun <ubraun@linux.ibm.com>
Fixes: 1a6310936a41 ("net/smc: fix closing of fallback SMC sockets")
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/af_smc.c