Add a missing return statement to g_concat_kernel_dump().

The error occurs when upper layers attempt an out-of-bounds write.

Submitted by:	Noah Bergbauer <noah.bergbauer@tum.de>
MFC after:	1 week
This commit is contained in:
Mark Johnston 2019-02-26 18:30:51 +00:00
parent 8e7127fd91
commit 3843d88ca8

View File

@ -238,8 +238,10 @@ g_concat_kernel_dump(struct bio *bp)
sc->sc_disks[i].d_end > gkd->offset)
break;
}
if (i == sc->sc_ndisks)
if (i == sc->sc_ndisks) {
g_io_deliver(bp, EOPNOTSUPP);
return;
}
disk = &sc->sc_disks[i];
gkd->offset -= disk->d_start;
if (gkd->length > disk->d_end - disk->d_start - gkd->offset)