OSDN Git Service

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)
commitf61bca58f6c36e666c2b807697f25e5e98708162
treef02f6529ea09b2bb02f173e11e5c8c53abe69ab9
parent8ef659f1a840c953a59442ff1400ec73baf3b601
net/smc: move unhash before release of clcsock

Commit <26d92e951fe0>
("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