diff options
author | pjd <pjd@FreeBSD.org> | 2011-10-19 23:44:38 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2011-10-19 23:44:38 +0000 |
commit | 2b80d6e6ddf9cf57a225d67c5555f73a2563b7e0 (patch) | |
tree | 32d4394f30f465c747e129c06c3164327e59f494 /sys/boot/zfs | |
parent | 5418d81b3820c4a900f2188badcafc9868750457 (diff) | |
download | FreeBSD-src-2b80d6e6ddf9cf57a225d67c5555f73a2563b7e0.zip FreeBSD-src-2b80d6e6ddf9cf57a225d67c5555f73a2563b7e0.tar.gz |
Always pass data size for checksum verification function, as using
physical block size declared in bp may not always be what we want.
For example in case of gang block header physical block size declared
in bp is much larger than SPA_GANGBLOCKSIZE (512 bytes) and checksum
calculation failed. This bug could lead to accessing unallocated
memory and resets/failures during boot.
MFC after: 3 days
Diffstat (limited to 'sys/boot/zfs')
-rw-r--r-- | sys/boot/zfs/zfsimpl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/boot/zfs/zfsimpl.c b/sys/boot/zfs/zfsimpl.c index b8d1606..dd721ed 100644 --- a/sys/boot/zfs/zfsimpl.c +++ b/sys/boot/zfs/zfsimpl.c @@ -347,7 +347,7 @@ vdev_read_phys(vdev_t *vdev, const blkptr_t *bp, void *buf, rc = vdev->v_phys_read(vdev, vdev->v_read_priv, offset, buf, psize); if (rc) return (rc); - if (bp && zio_checksum_error(bp, buf, offset)) + if (bp && zio_checksum_verify(bp, buf, offset, psize)) return (EIO); return (0); |