freebsd-nq/sys
Robert Watson d4b509bd7f Until this change, the UDP input code used global variables udp_in,
udp_in6, and udp_ip6 to pass socket address state between udp_input(),
udp_append(), and soappendaddr_locked().  While file in the default
configuration, when running with multiple netisrs or direct ithread
dispatch, this can result in races wherein user processes using
recvmsg() get back the wrong source IP/port.  To correct this and
related races:

- Eliminate udp_ip6, which is believed to be generated but then never
  used.  Eliminate ip_2_ip6_hdr() as it is now unneeded.

- Eliminate setting, testing, and existence of 'init' status fields
  for the IPv6 structures.  While with multiple UDP delivery this
  could lead to amortization of IPv4 -> IPv6 conversion when
  delivering an IPv4 UDP packet to an IPv6 socket, it added
  substantial complexity and side effects.

- Move global structures into the stack, declaring udp_in in
  udp_input(), and udp_in6 in udp_append() to be used if a conversion
  is required.  Pass &udp_in into udp_append().

- Re-annotate comments to reflect updates.

With this change, UDP appears to operate correctly in the presence of
substantial inbound processing parallelism.  This solution avoids
introducing additional synchronization, but does increase the
potential stack depth.

Discovered by:	kris (Bug Magnet)
MFC after:	3 weeks
2004-11-04 01:25:23 +00:00
..
alpha Reduce annoying SCSI probing delay from 15 to 5 seconds in all GENRIC kernels. 2004-11-02 20:57:20 +00:00
amd64 Don't use atomic ops to increment interrupt stats. This was only done on 2004-11-03 18:03:06 +00:00
arm Reduce annoying SCSI probing delay from 15 to 5 seconds in all GENRIC kernels. 2004-11-02 20:57:20 +00:00
boot Add a loader menu option to set hint.atkbd.0.flags=0x1 which allows USB 2004-10-30 13:45:13 +00:00
cam Remove references to the second byte of a CCB containing the LUN, as this 2004-10-13 09:31:04 +00:00
coda Do not use devsw() but si_devsw direction. This is still bogus but a 2004-09-23 12:19:24 +00:00
compat Rebuild from FreeBSD32 syscalls.master:1.42. 2004-10-23 20:05:42 +00:00
conf Reduce annoying SCSI probing delay from 15 to 5 seconds in all GENRIC kernels. 2004-11-02 20:57:20 +00:00
contrib Improved interface handling. This should fix the use of renamed interfaces 2004-11-03 17:21:12 +00:00
crypto For variables that are only checked with defined(), don't provide 2004-10-24 15:33:08 +00:00
ddb - Change the ddb paging "support" to use a variable (db_lines_per_page) to 2004-11-01 22:15:15 +00:00
dev The ehci_dump() function shouldn't be declared static, as it is 2004-11-03 15:12:18 +00:00
doc Experimental support for using doxygen to generate kernel documentation. 2004-07-11 16:13:57 +00:00
fs Make a more whole-hearted attempt at GEOM'ifying NTFS. 2004-11-03 21:36:41 +00:00
gdb Comment-out the debugging printf I left in in case there were some 2004-08-10 19:32:33 +00:00
geom Stop dumping the MBR entries under bootverbose 2004-11-03 09:08:33 +00:00
gnu Move EXT2FS to GEOM backing instead of DEVFS. 2004-10-29 10:42:30 +00:00
i4b Mark i4b IPR and SPPP drivers as NET_NEEDS_GIANT(), as they both 2004-10-12 09:25:52 +00:00
i386 Don't use atomic ops to increment interrupt stats. This was only done on 2004-11-03 18:03:06 +00:00
ia64 - Change the ddb paging "support" to use a variable (db_lines_per_page) to 2004-11-01 22:15:15 +00:00
isa Stop printing the VGA registers during verbose boot, in order to not 2004-11-03 09:07:44 +00:00
isofs/cd9660 Move CD9660 to GEOM backing instead of DEVFS. 2004-10-29 10:41:44 +00:00
kern Revert most of 1.109. Although it improved the situation on one particular 2004-11-03 22:11:20 +00:00
libkern Don't attempt to profile __udivsi3() and friends, as mcount() uses them. 2004-10-01 16:44:08 +00:00
modules IPDIVERT is a module now and tell the other parts of the kernel about it. 2004-10-25 20:02:34 +00:00
net Utilize m_uiotombuf() in device write method, instead of home-grown 2004-10-31 17:39:46 +00:00
net80211 Add a new network interface flag, IFF_NEEDSGIANT, which will allow 2004-07-27 23:20:45 +00:00
netatalk Push acquisition of the accept mutex out of sofree() into the caller 2004-10-18 22:19:43 +00:00
netatm Push acquisition of the accept mutex out of sofree() into the caller 2004-10-18 22:19:43 +00:00
netgraph Fix kernel build (caused by recent ng_{un}timeout API change) 2004-11-03 18:00:49 +00:00
netinet Until this change, the UDP input code used global variables udp_in, 2004-11-04 01:25:23 +00:00
netinet6 fixed a bug that incorrect IPsec request level may be returned for proto AH 2004-10-28 09:24:45 +00:00
netipsec Remove extraneous SECPOLICY_LOCK_DESTROY calls that cause the mutex to be 2004-10-02 00:19:05 +00:00
netipx Push acquisition of the accept mutex out of sofree() into the caller 2004-10-18 22:19:43 +00:00
netkey Merge netipsec/key.c:1.17 into KAME pfkey implementation: 2004-09-30 00:49:55 +00:00
netnatm Push acquisition of the accept mutex out of sofree() into the caller 2004-10-18 22:19:43 +00:00
netncp Add missing zero flag argument. 2004-10-12 08:22:08 +00:00
netsmb Avoid casts as lvalues. 2004-07-28 06:59:55 +00:00
nfs
nfs4client comment out debug printf. 2004-10-27 23:19:34 +00:00
nfsclient Move the buffer method vector (buf->b_op) to the bufobj. 2004-10-24 20:03:41 +00:00
nfsserver Add b_bufobj to struct buf which eventually will eliminate the need for b_vp. 2004-10-22 08:47:20 +00:00
opencrypto Don't acquire Giant in cryptof_close(), as the code is intended to be 2004-08-10 03:26:17 +00:00
pc98 - Change the ddb paging "support" to use a variable (db_lines_per_page) to 2004-11-01 22:15:15 +00:00
pccard Move PNP IDs back into oldcard files 2004-08-13 06:57:31 +00:00
pci * Correct an off-by-one reading vpd ro data. 2004-11-01 17:21:04 +00:00
posix4
powerpc Reduce annoying SCSI probing delay from 15 to 5 seconds in all GENRIC kernels. 2004-11-02 20:57:20 +00:00
rpc Prefer C99's __func__ over GCC's __FUNCTION__. 2004-09-23 18:25:46 +00:00
security Disable use of synchronization early in the boot by the MAC Framework; 2004-10-30 14:20:59 +00:00
sparc64 The synchronization provided by vm object locking has eliminated the 2004-11-03 20:17:31 +00:00
sys Restore TTYDEF_LFLAG to set echo bits. 2004-11-03 19:16:55 +00:00
tools Pass doxygen doc comments through to the output. 2004-07-11 16:14:24 +00:00
ufs Move UFS from DEVFS backing to GEOM backing. 2004-10-29 10:15:56 +00:00
vm The synchronization provided by vm object locking has eliminated the 2004-11-03 20:17:31 +00:00
Makefile Add a NO_BOOT knob to prevent building the boot blocks and loader. 2004-08-19 09:54:28 +00:00