From: Thomas Weißschuh Date: Sat, 30 Sep 2023 21:21:33 +0000 (+0200) Subject: libblkid: (drbd) validate size in standard minsz predicate X-Git-Tag: v2.40-rc1~221^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26c3e02a928493e2f51fd6f34f7bc2b2be282d51;p=thirdparty%2Futil-linux.git libblkid: (drbd) validate size in standard minsz predicate Signed-off-by: Thomas Weißschuh --- diff --git a/libblkid/src/superblocks/drbd.c b/libblkid/src/superblocks/drbd.c index f3601864e3..bf9b82b6db 100644 --- a/libblkid/src/superblocks/drbd.c +++ b/libblkid/src/superblocks/drbd.c @@ -131,10 +131,6 @@ static int probe_drbd_84(blkid_probe pr) off = pr->size - DRBD_MD_OFFSET; - /* Small devices cannot be drbd (?) */ - if (pr->size < 0x10000) - return 1; - md = (struct md_on_disk_08 *) blkid_probe_get_buffer(pr, off, @@ -172,14 +168,6 @@ static int probe_drbd_90(blkid_probe pr) off = pr->size - DRBD_MD_OFFSET; - /* - * Smaller ones are certainly not DRBD9 devices. - * Recent utils even refuse to generate larger ones, - * keep this as a sufficient lower bound. - */ - if (pr->size < 0x10000) - return 1; - md = (struct meta_data_on_disk_9 *) blkid_probe_get_buffer(pr, off, @@ -226,6 +214,12 @@ const struct blkid_idinfo drbd_idinfo = .name = "drbd", .usage = BLKID_USAGE_RAID, .probefunc = probe_drbd, + /* + * Smaller ones are certainly not DRBD9 devices. + * Recent utils even refuse to generate larger ones, + * keep this as a sufficient lower bound. + */ + .minsz = 0x10000, .magics = BLKID_NONE_MAGIC };