Page MenuHomeFreeBSD

Fix getsockopt(..., IPPROTO_IP, IP_OPTIONS, ..., ...)

Authored by tuexen on Jan 5 2019, 12:44 PM.



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().

Test Plan

Use the attached test program to verify that getsockopt(..., IPPROTO_IP, IP_OPTIONS, ..., ...) works. Without the patch, the system panics when running the test program.

This issue what found by running syzkaller.

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

tuexen created this revision.Jan 5 2019, 12:44 PM
mmacy accepted this revision.Jan 9 2019, 3:48 AM
This revision is now accepted and ready to land.Jan 9 2019, 3:48 AM
This revision was automatically updated to reflect the committed changes.