]> git.baikalelectronics.ru Git - kernel.git/commit
net/smc: move unhash before release of clcsock
authorUrsula Braun <ubraun@linux.ibm.com>
Thu, 11 Apr 2019 09:17:34 +0000 (11:17 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 11 Apr 2019 18:04:08 +0000 (11:04 -0700)
commit0df5f58d529a072d69195fa0ad24a0efefa41d87
treef02f6529ea09b2bb02f173e11e5c8c53abe69ab9
parenta2f80b5343b5270a4db73b8ce076c39bb386f16d
net/smc: move unhash before release of clcsock

Commit <01efeabb4356>
("net/smc: move unhash as early as possible in smc_release()")
fixes one occurrence in the smc code, but the same pattern exists
in other places. This patch covers the remaining occurrences and
makes sure, the unhash operation is done before the smc->clcsock is
released. This avoids a potential use-after-free in smc_diag_dump().

Reviewed-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/af_smc.c