vinumio: divide-by-zero panic in set_drive_parms when device reports media_blksize==0
Summary
set_drive_parms at vinumio.c:118-120 drive->blocksize=BLKDEV_IOSIZE; drive->secsperblock=drive->blocksize/drive->partinfo.media_blksize. media_blksize from VOP_IOCTL(DIOCGPART) at vinumio.c:175-177 NO validation. init_drive checks fstype!=FS_VINUM at 187 never checks media_blksize. Device reporting 0 (buggy md(4), custom geom, disk image odd partinfo) -> #DE trap panic. Fix: validate !=0 before dividing.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-1735 Β· 2 files| File | Type | Description | Size | |
|---|---|---|---|---|
| fix.diff | suggested-fix | Validate media_blksize != 0 before dividing; return EFTYPE if zero. | 511 B | view raw |
| VERDICT.md | verdict | full analysis | 1.1 KB | β raw |
DF-1735 β Verdict
Severity: Low Status: REPRODUCED (source-only confirmation β driver/HW-gated, not runtime-triggered on QEMU guest) Impact: panic Confidence: certain
Verdict
REPRODUCED. The cited bug is confirmed real in the audited source at sys/dev/raid/vinum/vinumio.c:118-120.
Mechanism
set_drive_parms divides by drive->partinfo.media_blksize without validating !=0; a device reporting media_blksize=0 triggers #DE trap panic.
Fix
Validate media_blksize != 0 before dividing; return EFTYPE if zero.
The full git-apply-able diff is in fix.diff.
Build validation
fix.diff applies cleanly and compiles with -Werror as part of the batch module build
(all 51 fixes applied to /usr/src, kernel+modules built).
Notes
Source-only confirmation: this finding is in a device driver code path that requires specific hardware not present in the QEMU guest. The bug is confirmed by source tracing (cited path:line verified against sys/), and the fix compiles clean. No runtime trigger was attempted as the relevant device/module is HW-gated.
Fix verification
fixedVALIDATED via batch build rc=0.
vinum.ko built with -Werror.
Confirmed kernel references
- s
- y
- s
- /
- d
- e
- v
- /
- r
- a
- i
- d
- /
- v
- i
- n
- u
- m
- /
- v
- i
- n
- u
- m
- i
- o
- .
- c
- :
- 1
- 1
- 8
- -
- 1
- 2
- 0
Detail
Exploit chain
none
Evidence (decisive lines)
Source traced at sys/dev/raid/vinum/vinumio.c:118-120. Fix compiled clean.
PoC changes
authored fix.diff: validate media_blksize!=0 return EFTYPE
Verified recommended fix
Validate media_blksize != 0 before dividing. Matches finding proposal.
Verdict
REPRODUCED (source-only). set_drive_parms divides by media_blksize without !=0 check; device reporting 0 triggers #DE trap.
No comments yet.