# DF-2366 - Verification Verdict

**Status:** reproduced
**Impact:** none (hardening)
**Confidence:** certain

## Mechanism
rc4_init never validates keylen. The schedule loop reads key[k] BEFORE the wrap check (j += perm[i] + key[k]; ... if (++k >= keylen) k = 0), so for keylen<=0 the loop reads key[0] 256 times while k stays 0; a caller passing a zero-length (or shorter-than-1) key buffer gets a 1-byte out-of-bounds read that also poisons the permutation.

## Verdict
REPRODUCED: userland replica of the verbatim rc4_init loop with key pointing into a PROT_NONE guard page and keylen=0 faults deterministically on the key[0] read (SIGSEGV, exit 139; kernel logged the same signal for the guest binary). In the kernel the identical instruction reads one byte past the caller buffer. In-tree callers (netgraph mppc RC4 compression: ng_mppc.c rc4_init with KEYLEN(cfg.bits), 8-16 bytes) never pass keylen<=0, so this is defense-in-depth; no reachable fault found.

## Threat / reachability
Any future rc4_init caller with user-controlled keylen (or 0) reads OOB; currently latent.

## Privilege escalation assessment
n/a (no reachable caller)

## Fix
Early-return on keylen<=0 before touching the key buffer.

## Kernel references
- `sys/crypto/rc4/rc4.c:71`
- `sys/crypto/rc4/rc4.c:74`
- `sys/netgraph7/mppc/ng_mppc.c:843`

## Fix status (batch validation)
Applied with the 36 sibling fix.diffs of this batch in findings/poc/_batch41/all_fixes.patch; single in-guest `make -j6 nativekernel KERNCONF=X86_64_GENERIC` completed RC=0 with zero errors under -Werror (full log: findings/poc/_batch41/fix_build8.log). Behavior A/B intentionally skipped for this Info-tier item.
