Page MenuHomeFreeBSD

ipfilter: Plug OOB read in ip_nat proxy
Needs ReviewPublic

Authored by cy on Wed, Oct 22, 11:31 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 30, 3:18 PM
Unknown Object (File)
Thu, Oct 30, 2:12 PM
Unknown Object (File)
Tue, Oct 28, 5:34 PM
Unknown Object (File)
Tue, Oct 28, 5:30 PM
Unknown Object (File)
Mon, Oct 27, 5:18 PM
Unknown Object (File)
Sun, Oct 26, 10:40 AM
Unknown Object (File)
Sun, Oct 26, 10:37 AM
Unknown Object (File)
Sun, Oct 26, 1:26 AM

Details

Reviewers
emaste
markj
Summary

ipf_nat_putent() copies an ap_session_t from ipnn->ipn_data and then
uses aps->aps_psiz to allocate and copy a variable-length payload. The
code does not verify that the user-supplied buffer (ipnn->ipn_data)
actually contains at least sizeof(*aps) + aps->aps_psiz bytes. Even if
aps->aps_psiz itself is legitimate (e.g., originating from previously
saved kernel state), a truncated IPFOBJ_NATSAVE object can cause the
subsequent copy to read past the end of ipnn->ipn_data, resulting in an
out-of-bounds read in the kernel.

Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
MFC after: 1 day

Diff Detail

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

Event Timeline

cy requested review of this revision.Wed, Oct 22, 11:31 PM
sys/netpfil/ipfilter/netinet/ip_nat.c
2091

ipn_dsize is signed. Should we check whether it's negative?