diff options
author | kp <kp@FreeBSD.org> | 2016-09-24 07:09:43 +0000 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-09-27 14:11:10 -0300 |
commit | 5fc1b195c4ab71aaf651429b2c50ee5cc5e7c5fb (patch) | |
tree | c1103422150c61b4ec569ea29f0297870196b82d /contrib/ntp/ntpd/refclock_bancomm.c | |
parent | 96aef5e8573233292ae9fc73f77cf0cdf92dc41a (diff) | |
download | FreeBSD-src-5fc1b195c4ab71aaf651429b2c50ee5cc5e7c5fb.zip FreeBSD-src-5fc1b195c4ab71aaf651429b2c50ee5cc5e7c5fb.tar.gz |
bridge: Fix fragment handling and memory leak
Fragmented UDP and ICMP packets were corrupted if a firewall with reassembling
feature (like pf'scrub) is enabled on the bridge. This patch fixes corrupted
packet problem and the panic (triggered easly with low RAM) as explain in PR
185633.
bridge_pfil and bridge_fragment relationship:
bridge_pfil() receive (IN direction) packets and sent it to the firewall The
firewall can be configured for reassembling fragmented packet (like pf'scrubing)
in one mbuf chain when bridge_pfil() need to send this reassembled packet to the
outgoing interface, it needs to re-fragment it by using bridge_fragment()
bridge_fragment() had to split this mbuf (using ip_fragment) first then
had to M_PREPEND each packet in the mbuf chain for adding Ethernet
header.
But M_PREPEND can sometime create a new mbuf on the begining of the mbuf chain,
then the "main" pointer of this mbuf chain should be updated and this case is
tottaly forgotten. The original bridge_fragment code (Revision 158140,
2006 April 29) came from OpenBSD, and the call to bridge_enqueue was
embedded. But on FreeBSD, bridge_enqueue() is done after bridge_fragment(),
then the original OpenBSD code can't work as-it of FreeBSD.
PR: 185633
Submitted by: Olivier Cochard-Labbé
Differential Revision: https://reviews.freebsd.org/D7780
(cherry picked from commit a8a1202774e288fb88de8422397f7ff398f7e3fb)
Diffstat (limited to 'contrib/ntp/ntpd/refclock_bancomm.c')
0 files changed, 0 insertions, 0 deletions