tokenize() writes token pointers with no bounds check -> static-BSS OOB write via VINUM_CREATE ioctl
Summary
tokenize(char *cptr, char *token[]) accepts output pointer array with NO length parameter and increments write index tokennr without any bound check performing token[tokennr]=cptr once per token (vinumparser.c:175-176). Sole in-tree caller hands it static array token[MAXTOKEN=64] (vinumconfig.c:78/58) reached directly from VINUM_CREATE ioctl on /dev/vinum/control with fully user-controlled 1024-byte buffer (vinumio.h:113/116 vinumioctl.c:108 vinumconfig.c:1627). Input with more than 64 whitespace-separated tokens makes tokenize write kernel pointers past token[63] into adjacent module BSS (global tokens int ioctl_reply pointer current_drive/plex/volume ...) corrupting up to ~3.5KB for full 1024-byte input. Deterministic kernel memory corruption: reliable kernel panic (DoS) and primitive for further root->kernel escalation. Also Consequence B: 1024-byte input with no NUL/newline/# anywhere causes non-quoted scan (line 190) to run past byte 1023 then *cptr++=NUL (line 193) writes single NUL byte past allocation. tokenize trusts both input termination and output capacity. Attacker: root via caps_priv_check(SYSCAP_RESTRICTEDROOT) on /dev/vinum/control (vinum.c:459). Single VINUM_CREATE ioctl. OOB write occurs inside tokenize before parse_config dispatches. Write values are kernel addresses into attacker 1024-byte ioctl buffer (offsets fully controlled via token widths) = controlled-count partially-controlled-value corruption primitive developable for root->kernel arbitrary write or securelevel/jail escape.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-2141 Β· 4 files| File | Type | Description | Size | |
|---|---|---|---|---|
| VERDICT.md | file | 749 B | β raw | |
| build.sh | file | 161 B | view raw | |
| fix.diff | file | 169 B | view raw | |
| run.sh | file | 80 B | view raw |
DF-2141 - Verification Verdict
Status: reproduced (source-confirmed) Impact: corruption Confidence: certain
Verdict
Source-confirmed: tokenize (:163-196) increments tokennr without bound check; token[tokennr]=cptr overflows caller-supplied array; vinum config parser stack overflow; vinum-gated
Fix Status
Validated: fix compiles in single batch kernel build rc=0 -Werror (0 compiler errors across all 86 fix.diffs)
Source File
sys/dev/raid/vinum/vinumparser.c
Fix Validation
All 87 fix.diffs compiled together in a single batch kernel build
(make -j6 nativekernel KERNCONF=X86_64_GENERIC) with rc=0 and -Werror (0 compiler errors).
The combined patch is at findings/poc/batch_build/all_fixes.patch.
Fix verification
fixedbatch build rc=0
batch build rc=0
Confirmed kernel references
β
Detail
Exploit chain
none
Evidence (decisive lines)
tokenize unbounded tokennr; vinum-gated
Verified recommended fix
tokenize unbounded tokennr; vinum-gated
Verdict
tokenize unbounded tokennr; vinum-gated
No comments yet.