⬢ DragonFlyBSD Kernel Audit
DF-2314 / leak_sample.txt
← back to finding ↓ download raw
DF-2314 leak sample: bytes captured as the device description (dev->desc,
returned by device_get_desc) from the REAL device_set_desc_copy() after the
len-0 ANSI tag walked buf[] backwards over groomed kernel-stack residue.

The crafted card stream contains ONLY these bytes:
  17 78 56 34 12 00 00 00 82 00 00 79   (logical dev 0x12345678, ANSI tag len 0)
NO "DF2314" bytes, NO 0x20 runs - everything below came from the kernel stack.

--- baseline run 1 (probe11: ANSI tag before LD; desc applied at pnp.c:449) ---
  desc len=18
  ascii: "            DF2314"
  hex  : 20 20 20 20 20 20 20 20 20 20 20 20 44 46 32 33 31 34
  (12 x 0x20 stack-residue bytes + 6-byte groom marker "DF2314" that exists
   nowhere in the stream; terminated by a 0x00 residue byte at buf[18])

--- baseline run 2 (probe17: walk + second LD tag, child[3]) ---
  desc=<            DF2314> len=18   (identical)

--- baseline run 3 (re-run of probe11, separate scenario invocation) ---
  desc=<            DF2314> len=18   (identical; deterministic under fixed groom)

--- stack window around buf (walk run, scenario 10; buf at pad+8044) ---
  walk: buf[0..11]=0x20 residue, buf[12..17]="DF2314", buf[18]=0x00,
        NUL write landed at buf[-12] (pad+8032): groom byte 0x20 -> 0x00
  ctrl: buf[0]=0x00 (code-written), buf[1..]=0x12 untouched groom

--- fixed kernel (large_len>0 guard) ---
  probe11 desc len=0 ascii="" ; smart walk: no NUL signature -> NO stack bytes
  reach the description anymore.

Interpretation: at real boot, the 100 bytes at buf[] are residues of earlier
boot-path kernel stack usage (frame pointers, kernel text/data pointers,
lengths) - device_set_desc_copy(strlen+strcpy) copies them into dev->desc and
device_print_child() prints them to the world-readable dmesg buffer.