HomeFreeBSD

Allocate a struct ifreq rather than using a (wrong) computed size for

Description

Allocate a struct ifreq rather than using a (wrong) computed size for
the BIOCSETIF ioctl.

The kernel always copies an entire struct ifreq and IPv4 addresses will
always fit in an ifreq.

On systems with pointers larger than 64-bits, the computed size will be
less than the size of struct ifreq, potentially resulting in the kernel
attempting to copyin memory from outside the allocation.

Reviewed by: jhb
Obtained from: CheriBSD
MFC after: 1 week
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D8445

Details

Provenance
brooksAuthored on Nov 22 2016, 10:45 PM
Parents
rG295159dfa3ed: open(2): Clarify non-POSIX error when opening a symlink with O_NOFOLLOW.
Branches
Unknown
Tags
Unknown