Skip to content
Commit 6413e780 authored by William Kucharski's avatar William Kucharski Committed by Sasha Levin
Browse files

RDMA/srpt: Do not register event handler until srpt device is fully setup

[ Upstream commit c21a8870 ]

Upon rare occasions, KASAN reports a use-after-free Write
in srpt_refresh_port().

This seems to be because an event handler is registered before the
srpt device is fully setup and a race condition upon error may leave a
partially setup event handler in place.

Instead, only register the event handler after srpt device initialization
is complete.

Fixes: a42d985b

 ("ib_srpt: Initial SRP Target merge for v3.3-rc1")
Signed-off-by: default avatarWilliam Kucharski <william.kucharski@oracle.com>
Link: https://lore.kernel.org/r/20240202091549.991784-2-william.kucharski@oracle.com
Reviewed-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 9af1658b
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