HomeFreeBSD

Fix getsockopt() for IP_OPTIONS/IP_RETOPTS.

Description

Fix getsockopt() for IP_OPTIONS/IP_RETOPTS.

r336616 copies inp->inp_options using the m_dup() function.
However, this function expects an mbuf packet header at the beginning,
which is not true in this case.
Therefore, use m_copym() instead of m_dup().

This issue was found by syzkaller.
Reviewed by: mmacy@
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D18753

Details

Provenance
tuexenAuthored on
Differential Revision
D18753: Fix getsockopt(..., IPPROTO_IP, IP_OPTIONS, ..., ...)
Parents
rS342878: Add quirk for 128MB Creative Nomad.
Branches
Unknown
Tags
Unknown