β¬’ DragonFlyBSD Kernel Audit
← triage Β· dashboard
DF-2881

Duplicate-swap-device check compares vnodes, not devices β€” the same cdev swapped on twice via distinct devfs alias vnodes interleaves two swap stripes over the same physical blocks

Field Value
ID DF-2881
Status new
Severity Low
CVSS 3.1 CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:L/I:L/A:N
CWE CWE-1023 Incomplete Comparison
File sys/vm/vm_swap.c
Lines 281, 426
Area vm
Confidence likely
Discovered 2026-09-02
Pass 2 (GLM 5.3 second pass)
Bucket base:vm
Reported pending
Known CVE none
CVE match novel

Summary

sys_swapon's duplicate detection is sp->sw_vp == vp and sys_swapoff matches the same way. DFly devfs allocates one vnode per devfs node, and the disk layer explicitly creates alias nodes for the same cdev (serno/%s make_dev_alias, slice aliases). Swapping on /dev/da0s1b and /dev/serno/.s1b passes the EBUSY check and installs two swdevt slots pointing at one device; swapdev_strategy then maps interleaved segs of the two slots onto overlapping device offsets β€” one process's swapped pages overwrite another's swap blocks (silent cross-process memory corruption/disclosure) and swap accounting is corrupted. Root-only and needs a plausible operator mistake, hence Low. Fix: compare vp->v_rdev against a tracked sw_device instead of the vnode pointer.

Timeline

  • 2026-09-02 Discovered during pass-2 audit of vm_swap.c (GLM 5.3).

Discussion (0)

No comments yet.