From: "Denis V. Lunev" <den@openvz.org>
To: andrey.zhadchenko@virtuozzo.com
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.1 2/2] dm-ploop: fix flip_upper_deltas walking past the BAT of the lower delta
Date: Wed, 4 Nov 2026 22:46:35 +0100 [thread overview]
Message-ID: <20261104214635.2063009-3-den@openvz.org> (raw)
In-Reply-To: <20261104214635.2063009-1-den@openvz.org>
From: Denis V. Lunev <den@openvz.org>
ploop_check_delta_before_flip() walks the live BAT pages together with
the BAT pages of the lower delta, and means to stop at the page that
holds the last entry of the lower delta. It takes that entry from i
after the scan of the page, when i is already one past end, so the stop
never matches. Once the live BAT has more pages than the lower delta, as
after a grow of the device, the walk runs off the md tree of the lower
delta and dereferences a NULL page: the flip oopses. The reverse merge
of the ploop library grows the lower delta to the size of the top before
it flips, so only a flip outside the library gets there.
Take the last entry of the page from end.
Fixes: 6ddad5a4d226 ("dm-ploop: Add ploop target driver")
https://virtuozzo.atlassian.net/browse/VSTOR-153445
Feature: dm-ploop: ploop target driver
Signed-off-by: Denis V. Lunev <den@openvz.org>
---
drivers/md/dm-ploop-cmd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/dm-ploop-cmd.c b/drivers/md/dm-ploop-cmd.c
index d6abbdc3c7e3..74674011a888 100644
--- a/drivers/md/dm-ploop-cmd.c
+++ b/drivers/md/dm-ploop-cmd.c
@@ -1154,7 +1154,7 @@ static int ploop_check_delta_before_flip(struct ploop *ploop, struct file *file)
if (stop)
break;
- clu = ploop_page_clu_idx_to_bat_clu(md->id, i);
+ clu = ploop_page_clu_idx_to_bat_clu(md->id, end);
if (clu == nr_be - 1) {
stop = true;
goto unmap;
--
2.53.0
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-11-04 21:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 21:46 [Devel] [PATCH hci-8.1 0/2] dm-ploop: fix flip_upper_deltas panicking the host in its pre-flip check Denis V. Lunev
2026-11-04 21:46 ` [Devel] [PATCH hci-8.1 1/2] dm-ploop: fix flip_upper_deltas returning with two md_locks held Denis V. Lunev
2026-11-04 21:50 ` no-reply
2026-11-04 21:46 ` Denis V. Lunev [this message]
2026-11-04 21:50 ` [Devel] [PATCH hci-8.1 2/2] dm-ploop: fix flip_upper_deltas walking past the BAT of the lower delta no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261104214635.2063009-3-den@openvz.org \
--to=den@openvz.org \
--cc=andrey.zhadchenko@virtuozzo.com \
--cc=devel@openvz.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox