Commit 7233425e authored by Dan Carpenter's avatar Dan Carpenter Committed by sanglipeng
Browse files

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: default avatarDan Carpenter <error27@gmail.com>
Reviewed-by: default avatarChristoph Böhmwalder <christoph.boehmwalder@linbit.com>
Link: https://lore.kernel.org/r/Y3Jd5iZRbNQ9w6gm@kili


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent cd2d2610
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment