kernel-hacking-2024-linux-s.../net/core
Tom Herbert b0f77d0eae net: fix problem in reading sock TX queue
Fix problem in reading the tx_queue recorded in a socket.  In
dev_pick_tx, the TX queue is read by doing a check with
sk_tx_queue_recorded on the socket, followed by a sk_tx_queue_get.
The problem is that there is not mutual exclusion across these
calls in the socket so it it is possible that the queue in the
sock can be invalidated after sk_tx_queue_recorded is called so
that sk_tx_queue get returns -1, which sets 65535 in queue_index
and thus dev_pick_tx returns 65536 which is a bogus queue and
can cause crash in dev_queue_xmit.

We fix this by only calling sk_tx_queue_get which does the proper
checks.  The interface is that sk_tx_queue_get returns the TX queue
if the sock argument is non-NULL and TX queue is recorded, else it
returns -1.  sk_tx_queue_recorded is no longer used so it can be
completely removed.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-14 20:50:29 -07:00
..
datagram.c net: fix lock_sock_bh/unlock_sock_bh 2010-05-27 00:30:53 -07:00
dev.c net: fix problem in reading sock TX queue 2010-07-14 20:50:29 -07:00
dev_addr_lists.c
drop_monitor.c tracing: Let tracepoints have data passed to tracepoint callbacks 2010-05-14 09:50:34 -04:00
dst.c
ethtool.c ethtool: Fix potential user buffer overflow for ETHTOOL_{G, S}RXFH 2010-06-29 01:00:29 -07:00
fib_rules.c
filter.c
flow.c
gen_estimator.c pkt_sched: gen_estimator: add a new lock 2010-06-10 22:53:52 -07:00
gen_stats.c
iovec.c
kmap_skb.h
link_watch.c
Makefile
neighbour.c net/core: neighbour update Oops 2010-07-14 18:02:16 -07:00
net-sysfs.c net: Expose all network devices in a namespaces in sysfs 2010-05-21 09:37:34 -07:00
net-sysfs.h net: Expose all network devices in a namespaces in sysfs 2010-05-21 09:37:34 -07:00
net-traces.c
net_namespace.c
netevent.c
netpoll.c
pktgen.c pktgen: Fix accuracy of inter-packet delay. 2010-06-10 23:08:11 -07:00
request_sock.c
rtnetlink.c netlink: bug fix: wrong size was calculated for vfinfo list blob 2010-05-28 03:42:43 -07:00
scm.c
skbuff.c net: rxhash already set in __copy_skb_header 2010-06-13 17:16:54 -07:00
sock.c net: fix lock_sock_bh/unlock_sock_bh 2010-05-27 00:30:53 -07:00
stream.c
sysctl_net_core.c net: Consistent skb timestamping 2010-05-15 23:57:10 -07:00
user_dma.c
utils.c