linux/net
Al Viro 6dc0c2082b [BLUETOOTH]: Fix endianness bug in l2cap_sock_listen()
We loop through psm values, calling __l2cap_get_sock_by_addr(psm, ...)
until we get NULL; then we set ->psm of our socket to htobs(psm).
IOW, we find unused psm value and put it into our socket.  So far, so
good, but...  __l2cap_get_sock_by_addr() compares its argument with
->psm of sockets.  IOW, the entire thing works correctly only on
little-endian.  On big-endian we'll get "no socket with such psm"
on the first iteration, since we won't find a socket with ->psm == 0x1001.
We will happily conclude that 0x1001 is unused and slap htobs(0x1001)
(i.e. 0x110) into ->psm of our socket.  Of course, the next time around
the same thing will repeat and we'll just get a fsckload of sockets
with the same ->psm assigned.

Fix: pass htobs(psm) to __l2cap_get_sock_by_addr() there.  All other
callers are already passing little-endian values and all places that
store something in ->psm are storing little-endian.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-07-31 02:28:06 -07:00
..
9p 9p: Don't use binary sysctl numbers. 2007-07-22 12:43:28 -07:00
802 [NET]: Make all initialized struct seq_operations const. 2007-07-10 23:07:31 -07:00
8021q [8021Q]: vlan_ioctl_handler: fix return value 2007-07-24 15:37:11 -07:00
appletalk [NET]: Make all initialized struct seq_operations const. 2007-07-10 23:07:31 -07:00
atm [ATM]: Eliminate dead config variable CONFIG_BR2684_FAST_TRANS. 2007-07-18 01:46:52 -07:00
ax25 [NET] AX25: Fix whitespace errors. 2007-07-19 10:43:13 +09:00
bluetooth [BLUETOOTH]: Fix endianness bug in l2cap_sock_listen() 2007-07-31 02:28:06 -07:00
bridge net/* misc endianness annotations 2007-07-26 11:11:56 -07:00
core [NET]: kernel-doc fixes 2007-07-31 02:28:00 -07:00
dccp mm: Remove slab destructors from kmem_cache_create(). 2007-07-20 10:11:58 +09:00
decnet mm: Remove slab destructors from kmem_cache_create(). 2007-07-20 10:11:58 +09:00
econet [SK_BUFF]: Convert skb->tail to sk_buff_data_t 2007-04-25 22:26:28 -07:00
ethernet [ETH]: Validate address in eth_mac_addr 2007-07-11 19:41:18 -07:00
ieee80211 [PATCH] softmac: Channel is listed twice in scan output 2007-07-17 21:56:17 -04:00
ipv4 [TCP]: htcp - use measured rtt 2007-07-31 02:27:59 -07:00
ipv6 [IPV6]: Don't update ADVMSS on routes where the MTU is not also updated 2007-07-31 02:28:04 -07:00
ipx [NET]: Make all initialized struct seq_operations const. 2007-07-10 23:07:31 -07:00
irda [IrDA] Typo fix in irnetlink.c copyright 2007-07-21 19:06:53 -07:00
iucv [S390] Convert to smp_call_function_single. 2007-07-27 12:29:17 +02:00
key net/* misc endianness annotations 2007-07-26 11:11:56 -07:00
lapb [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
llc [NET]: Make all initialized struct seq_operations const. 2007-07-10 23:07:31 -07:00
mac80211 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2007-07-19 10:23:21 -07:00
netfilter netfilter endian regressions 2007-07-26 11:11:56 -07:00
netlabel SELinux: enable dynamic activation/deactivation of NetLabel/SELinux enforcement 2007-07-19 10:21:11 -04:00
netlink [GENETLINK]: Correctly report errors while registering a multicast group 2007-07-24 15:34:53 -07:00
netrom [NET] NETROM: Fix whitespace errors. 2007-07-19 10:44:32 +09:00
packet [NET] PACKET: Fix whitespace errors. 2007-07-19 10:44:35 +09:00
rfkill [NET] RFKILL: Fix whitespace errors. 2007-07-19 10:44:38 +09:00
rose [NET] ROSE: Fix whitespace errors. 2007-07-19 10:44:40 +09:00
rxrpc net/* misc endianness annotations 2007-07-26 11:11:56 -07:00
sched [PKT_SCHED]: Some typo fixes in net/sched/Kconfig 2007-07-18 02:00:04 -07:00
sctp mm: Remove slab destructors from kmem_cache_create(). 2007-07-20 10:11:58 +09:00
sunrpc net/* misc endianness annotations 2007-07-26 11:11:56 -07:00
tipc [TIPC]: fix tipc_link_create error handling 2007-07-31 02:28:02 -07:00
unix [AF_UNIX]: Rewrite garbage collector, fixes race. 2007-07-11 14:22:39 -07:00
wanrouter [NET]: Make all initialized struct seq_operations const. 2007-07-10 23:07:31 -07:00
wireless [PATCH] cfg80211: Radiotap parser 2007-07-12 16:07:24 -04:00
x25 [NET]: Make all initialized struct seq_operations const. 2007-07-10 23:07:31 -07:00
xfrm mm: Remove slab destructors from kmem_cache_create(). 2007-07-20 10:11:58 +09:00
compat.c O_CLOEXEC for SCM_RIGHTS 2007-07-16 09:05:45 -07:00
Kconfig 9p: Reorganization of 9p file system code 2007-07-14 15:13:40 -05:00
Makefile 9p: Reorganization of 9p file system code 2007-07-14 15:13:40 -05:00
nonet.c
socket.c mm: Remove slab destructors from kmem_cache_create(). 2007-07-20 10:11:58 +09:00
sysctl_net.c
TUNABLE