summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_syscalls.c
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2001-03-08 19:03:26 +0000
committeriedowse <iedowse@FreeBSD.org>2001-03-08 19:03:26 +0000
commit9852c67f7c44b190f6a7c0c8b8a12205334411ab (patch)
treedf4def85f1ea1a92213e2397454c3c02c7e77718 /sys/kern/uipc_syscalls.c
parentfb925d8493457c06e0ec9cf4781746978ad8aa3d (diff)
downloadFreeBSD-src-9852c67f7c44b190f6a7c0c8b8a12205334411ab.zip
FreeBSD-src-9852c67f7c44b190f6a7c0c8b8a12205334411ab.tar.gz
It was possible for ip_forward() to supply to icmp_error()
an IP header with ip_len in network byte order. For certain values of ip_len, this could cause icmp_error() to write beyond the end of an mbuf, causing mbuf free-list corruption. This problem was observed during generation of ICMP redirects. We now make quite sure that the copy of the IP header kept for icmp_error() is stored in a non-shared mbuf header so that it will not be modified by ip_output(). Also: - Calculate the correct number of bytes that need to be retained for icmp_error(), instead of assuming that 64 is enough (it's not). - In icmp_error(), use m_copydata instead of bcopy() to copy from the supplied mbuf chain, in case the first 8 bytes of IP payload are not stored directly after the IP header. - Sanity-check ip_len in icmp_error(), and panic if it is less than sizeof(struct ip). Incoming packets with bad ip_len values are discarded in ip_input(), so this should only be triggered by bugs in the code, not by bad packets. This patch results from code and suggestions from Ruslan, Bosko, Jonathan Lemon and Matt Dillon, with important testing by Mike Tancsa, who could reproduce this problem at will. Reported by: Mike Tancsa <mike@sentex.net> Reviewed by: ru, bmilekic, jlemon, dillon
Diffstat (limited to 'sys/kern/uipc_syscalls.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud