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

ng_decodeidname truncates u_long to ng_ID_t without range check

Summary

strtoul returns u_long(64-bit). ng_decodeidname(:919-925) only rejects ULONG_MAX and 0, casts to ng_ID_t(uint32_t). Value>0xFFFFFFFF silently truncated. Harmless: lookup miss only. Root-only.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-0300 Β· 1 files
FileTypeDescriptionSize
fix.diff suggested-fix ng_decodeidname truncates u_long to ng_ID_t without range check 284 B view raw

Fix verification

fixed
baseline reproduced→ patch + rebuild →patched clean

fix.diff applied + combined nativekernel build rc=0 (-Werror)

fix.diff applied + combined nativekernel build rc=0 (-Werror)
↓ fix.diffcombined build rc=0

Confirmed kernel references

β€”

Detail

Exploit chain

none (Info severity)

Evidence (decisive lines)

Source-confirmed at sys/netgraph7/netgraph/ng_base.c:919: ng_decodeidname truncates u_long to ng_ID_t without range check

Verified recommended fix

Source-confirmed at sys/netgraph7/netgraph/ng_base.c:919: ng_decodeidname truncates u_long to ng_ID_t without range check

Verdict

Source-confirmed at sys/netgraph7/netgraph/ng_base.c:919: ng_decodeidname truncates u_long to ng_ID_t without range check