From ecf45690f2f4316b308eca3fd54af78a7c945726 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 24 Feb 2009 18:45:56 -0700 Subject: [PATCH] imsm: verify single sector mpb checksums If the mpb is only one sector do not skip the checksum verification. Signed-off-by: Dan Williams --- super-intel.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/super-intel.c b/super-intel.c index 388ada1a..3f83255a 100644 --- a/super-intel.c +++ b/super-intel.c @@ -1779,6 +1779,17 @@ static int load_imsm_mpb(int fd, struct intel_super *super, char *devname) sectors = mpb_sectors(anchor) - 1; free(anchor); if (!sectors) { + check_sum = __gen_imsm_checksum(super->anchor); + if (check_sum != __le32_to_cpu(super->anchor->check_sum)) { + if (devname) + fprintf(stderr, + Name ": IMSM checksum %x != %x on %s\n", + check_sum, + __le32_to_cpu(super->anchor->check_sum), + devname); + return 2; + } + rc = load_imsm_disk(fd, super, devname, 0); if (rc == 0) rc = parse_raid_devices(super); -- 2.47.2