Page MenuHomeFreeBSD

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

Authored by tuexen on Jan 5 2019, 12:44 PM.
Tags
None
Referenced Files
F148496043: D18753.id52680.diff
Wed, Mar 18, 6:26 AM
F148484954: D18753.id52577.diff
Wed, Mar 18, 4:48 AM
F148451654: D18753.diff
Tue, Mar 17, 11:49 PM
Unknown Object (File)
Tue, Mar 17, 8:05 AM
Unknown Object (File)
Mon, Mar 16, 5:31 PM
Unknown Object (File)
Mon, Mar 9, 4:46 AM
Unknown Object (File)
Sun, Mar 8, 4:09 PM
Unknown Object (File)
Fri, Mar 6, 4:45 AM
Subscribers

Details

Summary

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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable