HomeFreeBSD

graid: Avoid tasting devices with small sector sizes

Description

graid: Avoid tasting devices with small sector sizes

The RAID metadata parsers effectively assume a sector size of 512 bytes
or larger, but md(4) devices can be created with a sector size that's
any power of 2. Add some seatbelts to graid tasting routines to ensure
that the requested sector(s) are large enough for the device to
plausibly contain RAID metadata.

Reported by: syzbot+f43583c9bf8357c8b56f@syzkaller.appspotmail.com
Reported by: syzbot+537dd9f22b91b698e161@syzkaller.appspotmail.com
Reported by: syzbot+51509dd48871c57c6e47@syzkaller.appspotmail.com
Reported by: syzbot+c882a31037ea2a54ff63@syzkaller.appspotmail.com
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 9e9ba9c73de9206d82b8390c47b07f71470d001a)

Details

Provenance
markjAuthored on Aug 31 2021, 9:09 PM
Parents
rG9c82ba247373: mdconfig: Add a regression test for mediasize rounding
Branches
Unknown
Tags
Unknown