[PATCH] fix: incremental on invalid container causes segfault

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



counterpart of 417f346ee0 for incremental.
If md device has metadata_version="none" super_by_fd() matches supertype=super0. 
Call of load_container() dereferences null, so we have to forbid it.

Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@xxxxxxxxx>
---
 Incremental.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Incremental.c b/Incremental.c
index 8cae1ee..9399f5b 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -134,7 +134,7 @@ int Incremental(char *devname, int verbose, int runstop,
 	if (must_be_container(dfd)) {
 		if (!st)
 			st = super_by_fd(dfd, NULL);
-		if (st)
+		if (st && st->ss->load_container)
 			rv = st->ss->load_container(st, dfd, NULL);
 
 		close(dfd);
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux