freebsd-dev/sys
Kristof Provost f18598a43e 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
2016-09-24 07:09:43 +00:00
..
amd64 Change the efi_get_table interface to a void ** so we can return the 2016-09-22 19:04:51 +00:00
arm Also implement platform_cpu_reset on bcm2836 2016-09-23 15:28:15 +00:00
arm64 Add a way for the architecture to specify the calling ABI for methods 2016-09-21 10:35:44 +00:00
boot Use 32-bit value for .text padding, for linker portability 2016-09-23 13:18:59 +00:00
bsm
cam Protect ccbq access with devq->send_mtx in the XPT_ABORT handler. 2016-09-21 00:08:42 +00:00
cddl Re-check the systrace probe ID before calling dtrace_probe(). 2016-09-22 23:22:53 +00:00
compat cloudabi: use fget_cap instead of hand-rolling capability read 2016-09-23 23:08:23 +00:00
conf Add kernel interfaces to call EFI Runtime Services. 2016-09-21 11:31:58 +00:00
contrib Update Annapurna Alpine HAL 2016-09-20 09:19:22 +00:00
crypto Fix typo in skein amd64 assembly 2016-09-08 02:38:55 +00:00
ddb Silently ignore unexpected single-step traps (except for turning 2016-09-17 11:43:51 +00:00
dev Fix ds1307 probing 2016-09-24 05:27:12 +00:00
fs Mount msdosfs with longnames support by default. 2016-09-23 19:05:07 +00:00
gdb
geom Use g_wither_provider() where applicable. 2016-09-23 21:29:40 +00:00
gnu Revert and redo r306083. 2016-09-22 15:17:36 +00:00
i386 Regenerate syscall provider argument strings. 2016-09-22 04:50:03 +00:00
isa
kern Add the foundation copyrights to procctl kernel sources. 2016-09-23 12:32:20 +00:00
kgssapi
libkern
mips Set the standard freebsd brand note for ELF binaries on MIPS, 2016-09-22 12:48:01 +00:00
modules bhnd(4): Implement common API for IOST/IOCTL register access and core reset 2016-09-24 04:08:16 +00:00
net bridge: Fix fragment handling and memory leak 2016-09-24 07:09:43 +00:00
net80211 [net80211] don't add IBSS node table entries for neighbors from other SSIDs. 2016-09-21 19:48:07 +00:00
netgraph Avoid panic from ng_uncallout when unpluggin ethernet cable with active 2016-08-08 19:31:01 +00:00
netinet capsicum: propagate rights on accept(2) 2016-09-22 09:58:46 +00:00
netinet6 Rename ndpr_refcnt to ndpr_addrcnt. 2016-09-24 01:14:25 +00:00
netipsec Remove the 4.3BSD compatible macro m_copy(), use m_copym() instead. 2016-09-15 07:41:48 +00:00
netnatm
netpfil Move opcode rewriter init and destroy handlers into non-VENT code. 2016-09-18 17:35:17 +00:00
netsmb
nfs Hide the boottime and bootimebin globals, provide the getboottime(9) 2016-07-27 11:08:59 +00:00
nfsclient
nfsserver
nlm When sleeping waiting for either local or remote advisory lock, 2016-06-26 20:08:42 +00:00
ofed Do not free an uninitialized pointer on soaccept failure in the iWARP 2016-08-26 08:25:28 +00:00
opencrypto opencrypto AES-ICM: Fix heap corruption typo 2016-08-01 22:57:03 +00:00
pc98 Remove the ie(4) driver for Intel 82586 ISA Ethernet adapters. 2016-08-20 00:49:29 +00:00
powerpc Revert part of r306065 2016-09-21 22:09:17 +00:00
riscv Various changes to pmap_ts_referenced() 2016-09-10 16:49:25 +00:00
rpc Hide the boottime and bootimebin globals, provide the getboottime(9) 2016-07-27 11:08:59 +00:00
security Don't check aq64_minfree which is unsigned for negative values. 2016-09-08 19:47:57 +00:00
sparc64 Various changes to pmap_ts_referenced() 2016-09-10 16:49:25 +00:00
sys Mount msdosfs with longnames support by default. 2016-09-23 19:05:07 +00:00
teken
tests
tools Consider CROSS_BINUTILS_PREFIX environment variable so we use correct 2016-08-10 13:49:17 +00:00
ufs Be more strict when selecting between snapshot/regular mount. 2016-09-19 15:58:33 +00:00
vm Various changes to pmap_ts_referenced() 2016-09-10 16:49:25 +00:00
x86 Detect x2APIC mode on boot and obey it. 2016-09-19 15:58:45 +00:00
xdr
xen xen: Correct typo in #undef for symbol NBPL 2016-06-06 14:55:46 +00:00
Makefile