Skip to content
Commit 26d92e95 authored by Cong Wang's avatar Cong Wang Committed by David S. Miller
Browse files

smc: move unhash as early as possible in smc_release()



In smc_release() we release smc->clcsock before unhash the smc
sock, but a parallel smc_diag_dump() may be still reading
smc->clcsock, therefore this could cause a use-after-free as
reported by syzbot.

Reported-and-tested-by: default avatar <syzbot+fbd1e5476e4c94c7b34e@syzkaller.appspotmail.com>
Fixes: 51f1de79

 ("net/smc: replace sock_put worker by socket refcounting")
Cc: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
Reported-by: default avatar <syzbot+0bf2e01269f1274b4b03@syzkaller.appspotmail.com>
Reported-by: default avatar <syzbot+e3132895630f957306bc@syzkaller.appspotmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7acf8b36
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment