Hannes Frederic Sowa
5d14d39515
ipv6: call udp_push_pending_frames when uncorking a socket with AF_INET pending data
[ Upstream commit 8822b64a0f ]
We accidentally call down to ip6_push_pending_frames when uncorking
pending AF_INET data on a ipv6 socket. This results in the following
splat (from Dave Jones):
skbuff: skb_under_panic: text:ffffffff816765f6 len:48 put:40 head:ffff88013deb6df0 data:ffff88013deb6dec tail:0x2c end:0xc0 dev:<NULL>
------------[ cut here ]------------
kernel BUG at net/core/skbuff.c:126!
invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
Modules linked in: dccp_ipv4 dccp 8021q garp bridge stp dlci mpoa snd_seq_dummy sctp fuse hidp tun bnep nfnetlink scsi_transport_iscsi rfcomm can_raw can_bcm af_802154 appletalk caif_socket can caif ipt_ULOG x25 rose af_key pppoe pppox ipx phonet irda llc2 ppp_generic slhc p8023 psnap p8022 llc crc_ccitt atm bluetooth
+netrom ax25 nfc rfkill rds af_rxrpc coretemp hwmon kvm_intel kvm crc32c_intel snd_hda_codec_realtek ghash_clmulni_intel microcode pcspkr snd_hda_codec_hdmi snd_hda_intel snd_hda_codec snd_hwdep usb_debug snd_seq snd_seq_device snd_pcm e1000e snd_page_alloc snd_timer ptp snd pps_core soundcore xfs libcrc32c
CPU: 2 PID: 8095 Comm: trinity-child2 Not tainted 3.10.0-rc7+ #37
task: ffff8801f52c2520 ti: ffff8801e6430000 task.ti: ffff8801e6430000
RIP: 0010:[<ffffffff816e759c>] [<ffffffff816e759c>] skb_panic+0x63/0x65
RSP: 0018:ffff8801e6431de8 EFLAGS: 00010282
RAX: 0000000000000086 RBX: ffff8802353d3cc0 RCX: 0000000000000006
RDX: 0000000000003b90 RSI: ffff8801f52c2ca0 RDI: ffff8801f52c2520
RBP: ffff8801e6431e08 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000001 R12: ffff88022ea0c800
R13: ffff88022ea0cdf8 R14: ffff8802353ecb40 R15: ffffffff81cc7800
FS: 00007f5720a10740(0000) GS:ffff880244c00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000005862000 CR3: 000000022843c000 CR4: 00000000001407e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600
Stack:
ffff88013deb6dec 000000000000002c 00000000000000c0 ffffffff81a3f6e4
ffff8801e6431e18 ffffffff8159a9aa ffff8801e6431e90 ffffffff816765f6
ffffffff810b756b 0000000700000002 ffff8801e6431e40 0000fea9292aa8c0
Call Trace:
[<ffffffff8159a9aa>] skb_push+0x3a/0x40
[<ffffffff816765f6>] ip6_push_pending_frames+0x1f6/0x4d0
[<ffffffff810b756b>] ? mark_held_locks+0xbb/0x140
[<ffffffff81694919>] udp_v6_push_pending_frames+0x2b9/0x3d0
[<ffffffff81694660>] ? udplite_getfrag+0x20/0x20
[<ffffffff8162092a>] udp_lib_setsockopt+0x1aa/0x1f0
[<ffffffff811cc5e7>] ? fget_light+0x387/0x4f0
[<ffffffff816958a4>] udpv6_setsockopt+0x34/0x40
[<ffffffff815949f4>] sock_common_setsockopt+0x14/0x20
[<ffffffff81593c31>] SyS_setsockopt+0x71/0xd0
[<ffffffff816f5d54>] tracesys+0xdd/0xe2
Code: 00 00 48 89 44 24 10 8b 87 d8 00 00 00 48 89 44 24 08 48 8b 87 e8 00 00 00 48 c7 c7 c0 04 aa 81 48 89 04 24 31 c0 e8 e1 7e ff ff <0f> 0b 55 48 89 e5 0f 0b 55 48 89 e5 0f 0b 55 48 89 e5 0f 0b 55
RIP [<ffffffff816e759c>] skb_panic+0x63/0x65
RSP <ffff8801e6431de8>
This patch adds a check if the pending data is of address family AF_INET
and directly calls udp_push_ending_frames from udp_v6_push_pending_frames
if that is the case.
This bug was found by Dave Jones with trinity.
(Also move the initialization of fl6 below the AF_INET check, even if
not strictly necessary.)
Cc: Dave Jones <davej@redhat.com>
Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2013-08-02 22:14:47 +02:00
..
2011-10-24 11:13:12 -05:00
2012-10-10 03:31:11 +01:00
2011-10-19 03:25:43 -04:00
2011-08-13 01:10:16 -07:00
2012-10-30 23:27:08 +00:00
2012-02-03 09:22:18 -08:00
2011-09-27 14:34:05 -04:00
2012-06-10 14:42:06 +01:00
2011-07-06 02:52:16 -07:00
2013-08-02 22:14:47 +02:00
2011-07-18 00:40:17 -07:00
2011-07-26 16:49:47 -07:00
2011-08-08 14:26:29 -04:00
2012-11-16 16:46:58 +00:00
2012-07-12 04:32:12 +01:00
2011-10-06 15:49:51 -04:00
2011-10-06 15:49:51 -04:00
2011-11-26 14:29:50 -05:00
2012-06-10 14:42:03 +01:00
2012-02-29 16:31:00 -08:00
2011-06-22 16:09:45 -04:00
2011-10-03 15:19:17 -04:00
2011-08-01 18:05:00 -07:00
2013-03-06 03:24:21 +00:00
2013-01-16 01:13:24 +00:00
2011-10-22 01:25:23 -04:00
2013-03-27 02:41:07 +00:00
2011-07-26 16:49:47 -07:00
2013-03-06 03:24:21 +00:00
2011-11-06 19:44:47 -08:00
2011-11-26 19:16:37 -05:00
2011-07-17 23:11:35 -07:00
2013-03-27 02:41:06 +00:00
2012-10-17 03:50:07 +01:00
2011-10-24 03:06:21 -04:00
2013-03-06 03:24:21 +00:00
2011-09-16 19:20:20 -04:00
2011-10-31 19:32:32 -04:00
2011-07-26 16:49:47 -07:00
2013-01-16 01:13:22 +00:00
2011-07-26 16:49:47 -07:00
2011-07-26 16:49:47 -07:00
2011-05-27 13:41:33 -04:00
2011-08-01 17:58:33 -07:00
2011-11-04 17:48:23 -04:00
2011-07-06 02:52:16 -07:00
2011-11-30 23:27:22 -05:00
2011-08-26 10:47:56 -04:00
2011-09-15 14:49:43 -04:00
2012-02-29 16:31:00 -08:00
2012-11-16 16:46:52 +00:00
2012-07-12 04:32:14 +01:00
2013-04-25 20:25:43 +01:00
2011-10-21 05:22:42 -04:00
2011-06-11 16:23:59 -07:00
2013-05-30 14:35:14 +01:00
2013-05-30 14:35:11 +01:00
2011-08-30 17:39:01 -04:00
2013-08-02 22:14:47 +02:00
2011-10-17 19:07:30 -04:00
2011-06-24 17:50:44 -07:00
2012-10-10 03:31:20 +01:00