]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r340260: Avoid buffer underwrite in icmp_error
authoremaste <emaste@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 29 Nov 2018 20:14:09 +0000 (20:14 +0000)
committeremaste <emaste@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 29 Nov 2018 20:14:09 +0000 (20:14 +0000)
commit93bd2ade11f2bf91b0d61f57a822932fb9326aff
treee8ca864997a72c0f65086587bfd4d028fd0e3080
parent4c6ca653b393007ad33b83f64d3a75244f9690bd
MFC r340260: Avoid buffer underwrite in icmp_error

icmp_error allocates either an mbuf (with pkthdr) or a cluster depending
on the size of data to be quoted in the ICMP reply, but the calculation
failed to account for the additional padding that m_align may apply.

Include the ip header in the size passed to m_align.  On 64-bit archs
this will have the net effect of moving everything 4 bytes later in the
mbuf or cluster.  This will result in slightly pessimal alignment for
the ICMP data copy.

Also add an assertion that we do not move m_data before the beginning of
the mbuf or cluster.

Reported by: A reddit user
Security: CVE-2018-17156
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@341258 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/netinet/ip_icmp.c