android_kernel_xiaomi_sm7250/net
Tom Quetchenbach 8d390efd90 tcp: tcp_probe buffer overflow and incorrect return value
tcp_probe has a bounds-checking bug that causes many programs (less,
python) to crash reading /proc/net/tcp_probe. When it outputs a log
line to the reader, it only checks if that line alone will fit in the
reader's buffer, rather than that line and all the previous lines it
has already written.

tcpprobe_read also returns the wrong value if copy_to_user fails--it
just passes on the return value of copy_to_user (number of bytes not
copied), which makes a failure look like a success.

This patch fixes the buffer overflow and sets the return value to
-EFAULT if copy_to_user fails.

Patch is against latest net-2.6; tested briefly and seems to fix the
crashes in less and python.

Signed-off-by: Tom Quetchenbach <virtualphtn@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-24 21:11:58 -07:00
..
9p Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-04-03 14:33:42 -07:00
802
8021q [VLAN]: Handle vlan devices net namespace changing. 2008-04-16 00:57:01 -07:00
appletalk
atm Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2008-04-14 02:30:23 -07:00
ax25 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2008-04-14 02:30:23 -07:00
bluetooth Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-04-02 22:35:23 -07:00
bridge Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6.26 2008-04-14 03:50:43 -07:00
can CAN: use hrtimers in can-bcm protocol 2008-04-15 19:29:14 -07:00
core ethtool: EEPROM dump no longer works for tg3 and natsemi 2008-04-24 20:55:56 -07:00
dccp [DCCP]: Convert do_gettimeofday() to getnstimeofday(). 2008-04-21 14:28:45 -07:00
decnet
econet
ethernet [NET]: Return more appropriate error from eth_validate_addr(). 2008-04-13 22:45:40 -07:00
ieee80211 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2008-04-14 02:30:23 -07:00
ipv4 tcp: tcp_probe buffer overflow and incorrect return value 2008-04-24 21:11:58 -07:00
ipv6 [NETNS]: Remove empty ->init callback. 2008-04-21 14:33:16 -07:00
ipx
irda [IRDA]: Remove irlan_eth_send_gratuitous_arp() 2008-04-15 00:29:24 -07:00
iucv iucv: Delay bus registration until core is ready. 2008-04-10 02:12:45 -07:00
key af_key: Fix af_key.c compiler warning 2008-04-24 20:38:31 -07:00
lapb
llc Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-04-02 22:35:23 -07:00
mac80211 mac80211: fix use before check of Qdisc length 2008-04-23 21:25:35 -04:00
netfilter netfilter: Fix SIP conntrack build with NAT disabled. 2008-04-19 17:53:52 -07:00
netlabel [NETLABEL]: Fix NULL deref in netlbl_unlabel_staticlist_gen() if ifindex not found 2008-04-17 23:22:54 -07:00
netlink Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6 2008-04-18 18:18:30 -07:00
netrom
packet
rfkill rfkill: Fix device type check when toggling states 2008-04-15 15:04:35 -04:00
rose [ROSE]: Fix soft lockup wrt. rose_node_list_lock 2008-04-20 15:58:07 -07:00
rxrpc Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 2008-04-17 23:56:30 -07:00
sched Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 2008-04-17 23:56:30 -07:00
sctp [NET]: Fix heavy stack usage in seq_file output routines. 2008-04-24 01:02:16 -07:00
sunrpc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.26 2008-04-18 18:02:35 -07:00
tipc [TIPC]: Cleanup of TIPC reference table code 2008-04-16 18:22:20 -07:00
unix [AF_UNIX] Initialise UNIX sockets before general device initcalls 2008-04-24 00:59:25 -07:00
wanrouter
wireless Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2008-04-14 02:30:23 -07:00
x25
xfrm [IPSEC]: Fix catch-22 with algorithm IDs above 31 2008-04-22 00:46:42 -07:00
compat.c
Kconfig
Makefile
nonet.c
socket.c net: Unexport move_addr_to_{kernel,user} 2008-04-23 03:37:49 -07:00
sysctl_net.c
TUNABLE