freebsd-nq/sys
Yaroslav Tykhiy a4eb4405e3 Disallow a particular kind of port theft described by the following scenario:
Alice is too lazy to write a server application in PF-independent
	manner.  Therefore she knocks up the server using PF_INET6 only
	and allows the IPv6 socket to accept mapped IPv4 as well.  An evil
	hacker known on IRC as cheshire_cat has an account in the same
	system.  He starts a process listening on the same port as used
	by Alice's server, but in PF_INET.  As a consequence, cheshire_cat
	will distract all IPv4 traffic supposed to go to Alice's server.

Such sort of port theft was initially enabled by copying the code that
implemented the RFC 2553 semantics on IPv4/6 sockets (see inet6(4)) for
the implied case of the same owner for both connections.  After this
change, the above scenario will be impossible.  In the same setting,
the user who attempts to start his server last will get EADDRINUSE.

Of course, using IPv4 mapped to IPv6 leads to security complications
in the first place, but there is no reason to make it even more unsafe.

This change doesn't apply to KAME since it affects a FreeBSD-specific
part of the code.  It doesn't modify the out-of-box behaviour of the
TCP/IP stack either as long as mapping IPv4 to IPv6 is off by default.

MFC after:	1 month
2004-07-28 13:03:07 +00:00
..
alpha Pass a thread argument into cpu_critical_{enter,exit}() rather than 2004-07-27 16:41:01 +00:00
amd64 Pass a thread argument into cpu_critical_{enter,exit}() rather than 2004-07-27 16:41:01 +00:00
arm Correct typo in prior commit: s/cd/td/ 2004-07-27 19:44:08 +00:00
boot Define our own memcpy here instead of relying on GCC to provide one. 2004-07-28 06:03:27 +00:00
cam Quirk for SEGRAND NP-900 USB MP3Player 2004-07-18 05:39:14 +00:00
coda Avoid casts as lvalues. 2004-07-28 06:05:41 +00:00
compat Use kernel_vmount() instead of vfs_nmount(). 2004-07-27 21:38:42 +00:00
conf Allow for aggressive function inlining. This might have to be fine-tuned 2004-07-28 06:07:02 +00:00
contrib Initialize s variable early to shut up GCC warnings. 2004-07-28 06:14:44 +00:00
crypto Use __FBSDID(). 2004-06-14 00:38:54 +00:00
ddb Damage control. Correcly advance symtab and strtab pointers, not 2004-07-28 08:59:08 +00:00
dev Avoid casts as lvalues. 2004-07-28 06:30:43 +00:00
doc Experimental support for using doxygen to generate kernel documentation. 2004-07-11 16:13:57 +00:00
fs Avoid casts as lvalues. 2004-07-28 06:30:43 +00:00
gdb Introduce the GDB debugger backend for the new KDB framework. The 2004-07-10 17:47:22 +00:00
geom Improve geom(8)'s 'list' command to show geoms and their providers and 2004-07-26 17:14:47 +00:00
gnu Rename suser_cred()'s PRISON_ROOT flag to SUSER_ALLOWJAIL. This is 2004-07-26 07:24:04 +00:00
i4b Fix a possible hang which apparently occurs during a warm boot (cold boot 2004-07-18 20:13:31 +00:00
i386 Avoid casts as lvalues. While here, avoid storing 32bit quantities in 2004-07-28 06:32:28 +00:00
ia64 Pass a thread argument into cpu_critical_{enter,exit}() rather than 2004-07-27 16:41:01 +00:00
isa Ignore more strange return values of the test_aux_port() function, 2004-07-16 22:04:29 +00:00
isofs/cd9660 Make VFS_ROOT() and vflush() take a thread argument. 2004-07-12 08:14:09 +00:00
kern Avoid casts as lvalues. 2004-07-28 06:42:41 +00:00
libkern Convert the vfsconf list to a TAILQ. 2004-07-27 22:32:01 +00:00
modules Add the ACPI Panasonic extras driver. 2004-07-21 14:47:54 +00:00
net Avoid casts as lvalues. 2004-07-28 06:59:55 +00:00
net80211 Add a new network interface flag, IFF_NEEDSGIANT, which will allow 2004-07-27 23:20:45 +00:00
netatalk Further function forward declaration white space tweaks. 2004-07-19 17:18:58 +00:00
netatm Avoid casts as lvalues. 2004-07-28 06:59:55 +00:00
netgraph Avoid casts as lvalues. 2004-07-28 06:59:55 +00:00
netinet Disallow a particular kind of port theft described by the following scenario: 2004-07-28 13:03:07 +00:00
netinet6 Disallow a particular kind of port theft described by the following scenario: 2004-07-28 13:03:07 +00:00
netipsec Add required includes for post-sorwakeup() change to fix FAST_IPSEC 2004-06-23 01:58:22 +00:00
netipx Avoid casts as lvalues. Declare local variable as u_char * instead of 2004-07-28 06:58:23 +00:00
netkey Merge next step in socket buffer locking: 2004-06-21 00:20:43 +00:00
netnatm Constify send and receive space constants in natm. 2004-06-24 03:11:29 +00:00
netncp Do the dreaded s/dev_t/struct cdev */ 2004-06-16 09:47:26 +00:00
netsmb Avoid casts as lvalues. 2004-07-28 06:59:55 +00:00
nfs Remove advertising clause from University of California Regent's 2004-04-07 05:00:01 +00:00
nfs4client Avoid casts as lvalues. 2004-07-28 06:59:55 +00:00
nfsclient Eliminate unused second argument to reassignbuf() and simplify it 2004-07-25 21:24:23 +00:00
nfsserver If debug.mpsafenet is non-zero, run the NFS server callout without 2004-07-24 02:32:27 +00:00
opencrypto Push acquisition of Giant from fdrop_closed() into fo_close() so that 2004-07-22 18:35:43 +00:00
pc98 Merged from sys/dev/sio/sio.c revision 1.450. 2004-07-24 15:13:42 +00:00
pccard Do the dreaded s/dev_t/struct cdev */ 2004-06-16 09:47:26 +00:00
pci Update for the KDB framework: 2004-07-10 21:47:53 +00:00
posix4
powerpc Pass a thread argument into cpu_critical_{enter,exit}() rather than 2004-07-27 16:41:01 +00:00
rpc fix array index out of bounds in rpc->rc_srtt[], rpc->rc_sdrtt[] 2004-07-15 22:21:25 +00:00
security Introduce SLOT_SET macro and use it in place of casts as lvalues. 2004-07-28 07:01:33 +00:00
sparc64 Pass a thread argument into cpu_critical_{enter,exit}() rather than 2004-07-27 16:41:01 +00:00
sys Remove (at least temporarily) the check that prevents us from including 2004-07-28 09:12:54 +00:00
tools Pass doxygen doc comments through to the output. 2004-07-11 16:14:24 +00:00
ufs Avoid using casts as lvalues. Introduce DIP_SET macro which sets proper 2004-07-28 06:41:27 +00:00
vm - Use atomic ops for updating the vmspace's refcnt and exitingcnt. 2004-07-27 03:53:41 +00:00
Makefile Try harder not to compile anything in sys/boot for arm. 2004-05-16 00:19:12 +00:00