HomeFreeBSD

ipfilter: Plug ip_nat kernel information leak

Description

ipfilter: Plug ip_nat kernel information leak

ipf_nat_getent() allocates a variable-sized nat_save_t buffer with
KMALLOCS() (which does not zero memory) and then copies only a subset
of fields into it before returning the object to userland using
ipf_outobjsz(). Because the structure is not fully initialized on all
paths, uninitialized kernel heap bytes can be copied back to user space,
resulting in an information leak.

We fix this by zeroing out the data structure immediately after
allocation.

Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Reviewed by: emaste
Differential revision: https://reviews.freebsd.org/D53274

(cherry picked from commit 6535e9308a26e17023831fe68fb71d2febf2a002)

Details

Provenance
cyAuthored on Wed, Oct 22, 3:59 PM
Reviewer
emaste
Differential Revision
D53274: ipfilter: Plug ip_nat kernel information leak
Parents
rG2ebb4779c40a: ipfilter: Plug ip_htable kernel information leak
Branches
Unknown
Tags
Unknown