Page MenuHomeFreeBSD

rsu: add a runtime TX buffer bound check for a kernel buffer overflow
ClosedPublic

Authored by markj on Mon, Aug 17, 8:17 PM.
Tags
None
Referenced Files
F170875642: D58898.id184551.diff
Mon, Sep 7, 5:25 AM
F170843338: D58898.diff
Sun, Sep 6, 11:58 PM
Unknown Object (File)
Sun, Sep 6, 12:51 AM
Unknown Object (File)
Sat, Sep 5, 8:24 PM
Unknown Object (File)
Sat, Sep 5, 8:24 PM
Unknown Object (File)
Sat, Sep 5, 7:15 AM
Unknown Object (File)
Fri, Sep 4, 11:01 PM
Unknown Object (File)
Thu, Sep 3, 5:48 PM
Subscribers

Details

Summary

The rsu driver currently relies on a KASSERT to prove that the mbuf payload
plus TX descriptor fits in the per-transfer USB TX buffer. On production
kernels without INVARIANTS, an oversized raw 802.11 frame can reach
m_copydata() and overwrite past that buffer, causing local kernel memory
corruption.

This suggested patch replaces the assertion-only guard with a runtime size
check before the copy. Oversized frames return EMSGSIZE, leaving the existing
caller cleanup paths responsible for freeing m0, ni, and the unused
transfer buffer.

Reachable via root / bpf access

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 75658
Build 72541: arc lint + arc unit