drbd: use after free in drbd_create_device()
stable inclusion from stable-v5.10.156 commit 9ed51414aef6e59e832e2960f10766dce2d5b1a1 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I7MCG1 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9ed51414aef6e59e832e2960f10766dce2d5b1a1 -------------------------------- [ Upstream commit a7a15981 ] The drbd_destroy_connection() frees the "connection" so use the _safe() iterator to prevent a use after free. Fixes: b6f85ef9 ("drbd: Iterate over all connections") Signed-off-by: NDan Carpenter <error27@gmail.com> Reviewed-by: NChristoph Böhmwalder <christoph.boehmwalder@linbit.com> Link: https://lore.kernel.org/r/Y3Jd5iZRbNQ9w6gm@kiliSigned-off-by: NJens Axboe <axboe@kernel.dk> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: Nsanglipeng <sanglipeng1@jd.com> (cherry picked from commit 7233425e)
Showing
想要评论请 注册 或 登录