]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r340260 (emaste):
authorgjb <gjb@FreeBSD.org>
Thu, 8 Nov 2018 21:58:23 +0000 (21:58 +0000)
committergjb <gjb@FreeBSD.org>
Thu, 8 Nov 2018 21:58:23 +0000 (21:58 +0000)
commit341c5eff7e4440bd794fc66a03d7675b086d39e6
tree3b55be942cfff524a73a10fc38beb280b04d3d9d
parent599b5b69f6f46f90b676e13aa81f0d40ea1b2552
MFC r340260 (emaste):
 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.

Approved by: re (kib)
Security: CVE-2018-17156
Sponsored by: The FreeBSD Foundation
sys/netinet/ip_icmp.c