linux-stable/net
Dave Jones 501e89d3ae x25: Fix NULL dereference in x25_recvmsg
commit cb101ed2 in 3.0 introduced a bug in x25_recvmsg()
When passed bogus junk from userspace, x25->neighbour can be NULL,
as shown in this oops..

BUG: unable to handle kernel NULL pointer dereference at 000000000000001c
IP: [<ffffffffa05482bd>] x25_recvmsg+0x4d/0x280 [x25]
PGD 1015f3067 PUD 105072067 PMD 0
Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
CPU 0
Pid: 27928, comm: iknowthis Not tainted 3.1.0+ #2 Gigabyte Technology Co., Ltd. GA-MA78GM-S2H/GA-MA78GM-S2H
RIP: 0010:[<ffffffffa05482bd>]  [<ffffffffa05482bd>] x25_recvmsg+0x4d/0x280 [x25]
RSP: 0018:ffff88010c0b7cc8  EFLAGS: 00010282
RAX: 0000000000000000 RBX: ffff88010c0b7d78 RCX: 0000000000000c02
RDX: ffff88010c0b7d78 RSI: ffff88011c93dc00 RDI: ffff880103f667b0
RBP: ffff88010c0b7d18 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffff880103f667b0
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
FS:  00007f479ce7f700(0000) GS:ffff88012a600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 000000000000001c CR3: 000000010529e000 CR4: 00000000000006f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process iknowthis (pid: 27928, threadinfo ffff88010c0b6000, task ffff880103faa4f0)
Stack:
 0000000000000c02 0000000000000c02 ffff88010c0b7d18 ffffff958153cb37
 ffffffff8153cb60 0000000000000c02 ffff88011c93dc00 0000000000000000
 0000000000000c02 ffff88010c0b7e10 ffff88010c0b7de8 ffffffff815372c2
Call Trace:
 [<ffffffff8153cb60>] ? sock_update_classid+0xb0/0x180
 [<ffffffff815372c2>] sock_aio_read.part.10+0x142/0x150
 [<ffffffff812d6752>] ? inode_has_perm+0x62/0xa0
 [<ffffffff815372fd>] sock_aio_read+0x2d/0x40
 [<ffffffff811b05e2>] do_sync_read+0xd2/0x110
 [<ffffffff812d3796>] ? security_file_permission+0x96/0xb0
 [<ffffffff811b0a91>] ? rw_verify_area+0x61/0x100
 [<ffffffff811b103d>] vfs_read+0x16d/0x180
 [<ffffffff811b109d>] sys_read+0x4d/0x90
 [<ffffffff81657282>] system_call_fastpath+0x16/0x1b
Code: 8b 66 20 4c 8b 32 48 89 d3 48 89 4d b8 45 89 c7 c7 45 cc 95 ff ff ff 4d 85 e4 0f 84 ed 01 00 00 49 8b 84 24 18 05 00 00 4c 89 e7
 78 1c 01 45 19 ed 31 f6 e8 d5 37 ff e0 41 0f b6 44 24 0e 41

Signed-off-by: Dave Jones <davej@redhat.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-02 00:49:49 -04:00
..
9p net/9p: Convert net/9p protocol dumps to tracepoints 2011-10-24 11:13:12 -05:00
802 rcu: convert uses of rcu_assign_pointer(x, NULL) to RCU_INIT_POINTER 2011-08-02 04:29:23 -07:00
8021q vlan: Don't propagate flag changes on down interfaces. 2011-11-01 17:51:03 -04:00
appletalk net: add skb frag size accessors 2011-10-19 03:10:46 -04:00
atm Merge branch 'master' of github.com:davem330/net 2011-09-22 03:23:13 -04:00
ax25
batman-adv Merge branch 'batman-adv/maint' of git://git.open-mesh.org/linux-merge 2011-10-30 03:05:07 -04:00
bluetooth Merge branch 'master' of ra.kernel.org:/pub/scm/linux/kernel/git/davem/net 2011-10-24 18:18:09 -04:00
bridge netfilter: Remove unnecessary OOM logging messages 2011-11-01 09:19:49 +01:00
caif caif: Fix BUG() with network namespaces 2011-10-25 19:22:23 -04:00
can can: remove references to berlios mailinglist 2011-10-17 19:22:46 -04:00
ceph libceph: force resend of osd requests if we skip an osdmap 2011-10-25 16:10:17 -07:00
core neigh: Kill bogus SMP protected debugging message. 2011-11-01 17:45:55 -04:00
dcb dcb: add DCBX mode to event notifier attributes 2011-10-06 15:49:51 -04:00
dccp ipv6: tcp: fix TCLASS value in ACK messages sent from TIME_WAIT 2011-10-27 00:44:35 -04:00
decnet rcu: convert uses of rcu_assign_pointer(x, NULL) to RCU_INIT_POINTER 2011-08-02 04:29:23 -07:00
dns_resolver
dsa net: remove use of ndo_set_multicast_list in drivers 2011-08-17 20:22:03 -07:00
econet
ethernet net: don't clear IFF_XMIT_DST_RELEASE in ether_setup 2011-09-15 14:49:44 -04:00
ieee802154 6LoWPAN: fix skb_copy call 2011-09-15 15:36:35 -04:00
ipv4 net: make the tcp and udp file_operations for the /proc stuff const 2011-11-01 17:56:14 -04:00
ipv6 net: make the tcp and udp file_operations for the /proc stuff const 2011-11-01 17:56:14 -04:00
ipx
irda Merge branch 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty 2011-10-26 15:11:09 +02:00
iucv net: more accurate skb truesize 2011-10-13 16:05:07 -04:00
key
l2tp Merge branch 'master' of ra.kernel.org:/pub/scm/linux/kernel/git/davem/net 2011-10-24 18:18:09 -04:00
lapb wan: make LAPB callbacks const 2011-09-16 19:20:20 -04:00
llc
mac80211 Merge branch 'pm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm 2011-10-25 15:18:39 +02:00
netfilter netfilter: do not propagate nf_queue errors in nf_hook_slow 2011-11-01 09:57:21 +01:00
netlabel Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net 2011-08-20 10:39:12 -07:00
netlink af_unix: dont send SCM_CREDENTIALS by default 2011-09-28 13:29:50 -04:00
netrom
nfc treewide: use __printf not __attribute__((format(printf,...))) 2011-10-31 17:30:54 -07:00
packet macvlan: handle fragmented multicast frames 2011-10-18 23:22:07 -04:00
phonet rcu: convert uses of rcu_assign_pointer(x, NULL) to RCU_INIT_POINTER 2011-08-02 04:29:23 -07:00
rds treewide: use __printf not __attribute__((format(printf,...))) 2011-10-31 17:30:54 -07:00
rfkill net:rfkill: add a gpio setup function into GPIO rfkill 2011-10-03 15:19:19 -04:00
rose
rxrpc
sched net_sched: cls_flow: use skb_header_pointer() 2011-10-24 18:40:14 -04:00
sctp ipv6: tcp: fix TCLASS value in ACK messages sent from TIME_WAIT 2011-10-27 00:44:35 -04:00
sunrpc treewide: use __printf not __attribute__((format(printf,...))) 2011-10-31 17:30:54 -07:00
tipc tipc: Remove unused link event tracking code 2011-09-17 22:55:15 -04:00
unix af_unix: dont send SCM_CREDENTIALS by default 2011-09-28 13:29:50 -04:00
wanrouter
wimax
wireless nl80211: Add sta_flags to the station info 2011-10-14 14:48:23 -04:00
x25 x25: Fix NULL dereference in x25_recvmsg 2011-11-02 00:49:49 -04:00
xfrm net: add skb frag size accessors 2011-10-19 03:10:46 -04:00
compat.c
Kconfig
Makefile
nonet.c
socket.c Merge branch 'master' of github.com:davem330/net 2011-09-22 03:23:13 -04:00
sysctl_net.c