]> git.baikalelectronics.ru Git - kernel.git/commit
net/smc: prevent races between smc_lgr_terminate() and smc_conn_free()
authorKarsten Graul <kgraul@linux.ibm.com>
Wed, 30 Jan 2019 17:51:02 +0000 (18:51 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Feb 2019 22:45:44 +0000 (14:45 -0800)
commit6ada3b8a069822380ed27d8ac3c35b80b58f020a
tree552f02d5012cfa872e0255fa8640e373d8281e24
parenteb0035ceac4d1736f38ec6f679698f0770f41890
net/smc: prevent races between smc_lgr_terminate() and smc_conn_free()

To prevent races between smc_lgr_terminate() and smc_conn_free() add an
extra check of the lgr field before accessing it, and cancel a delayed
free_work when a new smc connection is created.
This fixes the problem that free_work cleared the lgr variable but
smc_lgr_terminate() or smc_conn_free() still access it in parallel.

Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/smc_core.c