diff options
author | Kirk McKusick <mckusick@FreeBSD.org> | 2023-10-20 22:14:46 +0000 |
---|---|---|
committer | Kirk McKusick <mckusick@FreeBSD.org> | 2023-10-20 22:15:40 +0000 |
commit | 1e39a0886e0999520a7e7136e3f7d09e9cd9a5f2 (patch) | |
tree | 1f3b1aa0b2d57686ed84a98662b0234f4e212dd3 | |
parent | a113f9dd9886e48914ba48b1f02ecf3ad0fc00d3 (diff) | |
download | src-1e39a0886e0999520a7e7136e3f7d09e9cd9a5f2.tar.gz src-1e39a0886e0999520a7e7136e3f7d09e9cd9a5f2.zip |
Fix a bug in fsck_ffs(8) triggered by corrupted filesystems.
Add missing check for failed block read when checking information about
a snapshot file.
Reported-by: Andreas Bock
PR: 274404
MFC-after: 1 week
-rw-r--r-- | sbin/fsck_ffs/setup.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sbin/fsck_ffs/setup.c b/sbin/fsck_ffs/setup.c index 49e89f9221b0..d1d09d07b43a 100644 --- a/sbin/fsck_ffs/setup.c +++ b/sbin/fsck_ffs/setup.c @@ -299,6 +299,8 @@ checksnapinfo(struct inode *snapip) size = fragroundup(fs, DIP(snapip->i_dp, di_size) - lblktosize(fs, lbn)); bp = getdatablk(idesc.id_parent, size, BT_DATA); + if (bp->b_errs != 0) + return (0); snapblklist = (daddr_t *)bp->b_un.b_buf; /* * snapblklist[0] is the size of the list |