From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konstantin Khorenko Date: Wed, 19 Aug 2026 18:57:13 +0200 Subject: [Devel] [PATCH RHEL10 COMMIT] dm-ploop: fix NULL deref in ploop_destroy() when ploop_ctr() failed early In-Reply-To: <20260819165629.497296-2-khorenko@virtuozzo.com> Message-ID: <202608191657.67JGvDGx497372@f0.sw.ru> List-Id: The commit is pushed to "branch-rh10-6.12.0-211.39.1.16.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git after rh10-6.12.0-211.39.1.16.6.vz10 ------> commit 34e8c5f7f782ec22e77bd1752695cafb0cb98282 Author: Konstantin Khorenko Date: Wed Aug 19 18:33:20 2026 +0200 dm-ploop: fix NULL deref in ploop_destroy() when ploop_ctr() failed early ploop_ctr() can fail early on setting up the ploop->kt_allocator, so ploop_destroy() must check it for NULL before dereferencing. Fixes: 9429d1119a69 ("dm-ploop: make filespace preallocations async") Feature: dm-ploop: ploop target driver https://virtuozzo.atlassian.net/browse/VSTOR-137234 Signed-off-by: Konstantin Khorenko Reviewed-by: Pavel Tikhomirov --- drivers/md/dm-ploop-target.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm-ploop-target.c b/drivers/md/dm-ploop-target.c index 7dab95402def7..3b589579741c6 100644 --- a/drivers/md/dm-ploop-target.c +++ b/drivers/md/dm-ploop-target.c @@ -188,7 +188,9 @@ static void ploop_destroy(struct ploop *ploop) /* waits for the thread to stop */ kthread_stop(ploop->kt_worker->task); - kthread_stop(ploop->kt_allocator->task); + /* kt_allocator may be NULL if ploop_ctr() failed early */ + if (ploop->kt_allocator) + kthread_stop(ploop->kt_allocator->task); WARN_ON(!llist_empty(&ploop->pios[PLOOP_LIST_PREPARE])); WARN_ON(!llist_empty(&ploop->llresubmit_pios));