From: "Benjamin Marzinski" <bmarzins@redhat.com>
To: device-mapper development <dm-devel@redhat.com>
Subject: [PATCH v3 1/7] kpartx: don't keep creating recursive partitions
Date: Tue, 14 Feb 2017 20:16:51 -0600 [thread overview]
Message-ID: <1487125017-22049-2-git-send-email-bmarzins@redhat.com> (raw)
In-Reply-To: <1487125017-22049-1-git-send-email-bmarzins@redhat.com>
If the dos partition table is corrupted, kpartx can just keep creating
the same partitions until it runs out of partition numbers. This check
catches the recursion.
Signed-off-by: Cedric Buissart <cbuissar@redhat.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
kpartx/dos.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kpartx/dos.c b/kpartx/dos.c
index 64b27b6..4985152 100644
--- a/kpartx/dos.c
+++ b/kpartx/dos.c
@@ -46,7 +46,7 @@ read_extended_partition(int fd, struct partition *ep, int en,
for (i=0; i<2; i++) {
memcpy(&p, bp + 0x1be + i * sizeof (p), sizeof (p));
if (is_extended(p.sys_type)) {
- if (p.nr_sects && !moretodo) {
+ if (p.start_sect && p.nr_sects && !moretodo) {
next = start + sector_size_mul * le32_to_cpu(p.start_sect);
moretodo = 1;
}
--
1.8.3.1
next prev parent reply other threads:[~2017-02-15 2:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-15 2:16 [PATCH v3 0/7] misc patches Benjamin Marzinski
2017-02-15 2:16 ` Benjamin Marzinski [this message]
2017-02-27 6:03 ` [PATCH v3 1/7] kpartx: don't keep creating recursive partitions Christophe Varoqui
2017-02-15 2:16 ` [PATCH v3 2/7] libmultipath: add detect_checker option Benjamin Marzinski
2017-02-20 11:38 ` Martin Wilck
2017-02-15 2:16 ` [PATCH v3 3/7] libmultipath: cleanup orphan device states Benjamin Marzinski
2017-02-15 2:16 ` [PATCH v3 4/7] multipathd: don't update priority of failed paths Benjamin Marzinski
2017-02-15 2:16 ` [PATCH v3 5/7] multipathd: add messages on delayed path addition Benjamin Marzinski
2017-02-15 2:16 ` [PATCH v3 6/7] multipathd: allow resetting stats Benjamin Marzinski
2017-02-15 2:16 ` [PATCH v3 7/7] fix udev rules for failed multipath devices Benjamin Marzinski
2017-02-27 6:09 ` [PATCH v3 0/7] misc patches Christophe Varoqui
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=1487125017-22049-2-git-send-email-bmarzins@redhat.com \
--to=bmarzins@redhat.com \
--cc=dm-devel@redhat.com \
/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