David Ahern
386fd5da40
tcp: Check daddr_cache before use in tracepoint
Running perf in one window to capture tcp_retransmit_skb tracepoint:
$ perf record -e tcp:tcp_retransmit_skb -a
And causing a retransmission on an active TCP session (e.g., dropping
packets in the receiver, changing MTU on the interface to 500 and back
to 1500) triggers a panic:
[ 58.543144] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
[ 58.545300] IP: perf_trace_tcp_retransmit_skb+0xd0/0x145
[ 58.546770] PGD 0 P4D 0
[ 58.547472] Oops: 0000 [#1] SMP
[ 58.548328] Modules linked in: vrf
[ 58.549262] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.14.0-rc4+ #26
[ 58.551004] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014
[ 58.554560] task: ffffffff81a0e540 task.stack: ffffffff81a00000
[ 58.555817] RIP: 0010:perf_trace_tcp_retransmit_skb+0xd0/0x145
[ 58.557137] RSP: 0018:ffff88003fc03d68 EFLAGS: 00010282
[ 58.558292] RAX: 0000000000000000 RBX: ffffe8ffffc0ec80 RCX: ffff880038543098
[ 58.559850] RDX: 0400000000000000 RSI: ffff88003fc03d70 RDI: ffff88003fc14b68
[ 58.561099] RBP: ffff88003fc03da8 R08: 0000000000000000 R09: ffffea0000d3224a
[ 58.562005] R10: ffff88003fc03db8 R11: 0000000000000010 R12: ffff8800385428c0
[ 58.562930] R13: ffffe8ffffc0e478 R14: ffffffff81a93a40 R15: ffff88003d4f0c00
[ 58.563845] FS: 0000000000000000(0000) GS:ffff88003fc00000(0000) knlGS:0000000000000000
[ 58.564873] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 58.565613] CR2: 0000000000000008 CR3: 000000003d68f004 CR4: 00000000000606f0
[ 58.566538] Call Trace:
[ 58.566865] <IRQ>
[ 58.567140] __tcp_retransmit_skb+0x4ab/0x4c6
[ 58.567704] ? tcp_set_ca_state+0x22/0x3f
[ 58.568231] tcp_retransmit_skb+0x14/0xa3
[ 58.568754] tcp_retransmit_timer+0x472/0x5e3
[ 58.569324] ? tcp_write_timer_handler+0x1e9/0x1e9
[ 58.569946] tcp_write_timer_handler+0x95/0x1e9
[ 58.570548] tcp_write_timer+0x2a/0x58
Check that daddr_cache is non-NULL before de-referencing.
Fixes: e086101b15 ("tcp: add a tracepoint for tcp retransmission")
Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-10-18 14:15:14 +01:00
..
2015-04-08 09:39:59 -04:00
2017-01-09 11:10:02 +00:00
2016-12-25 17:21:22 +01:00
2016-02-26 10:52:48 +09:00
2017-08-23 12:49:55 -06:00
2017-09-11 09:45:52 -06:00
2017-10-16 21:10:20 +01:00
2017-08-31 11:42:41 -07:00
2017-08-18 16:36:29 +02:00
2017-02-10 16:02:26 +01:00
2015-03-12 12:18:51 -07:00
2015-04-15 16:35:19 -07:00
2017-02-22 16:41:27 -08:00
2016-09-02 20:05:05 +02:00
2016-07-14 22:16:05 -07:00
2016-10-25 14:40:39 +02:00
2017-07-30 22:30:11 -04:00
2017-09-12 20:05:58 -07:00
2016-03-20 13:44:34 -04:00
2015-09-01 14:32:44 -07:00
2016-01-08 11:38:13 -05:00
2017-07-06 07:02:25 -04:00
2017-09-06 17:27:24 -07:00
2017-06-09 11:52:09 +02:00
2017-06-09 11:52:08 +02:00
2015-10-20 21:56:10 -04:00
2016-07-26 16:19:19 -07:00
2017-05-31 21:01:03 +02:00
2016-08-17 11:13:07 +02:00
2015-04-07 12:31:12 -04:00
2017-04-29 00:20:49 +02:00
2016-09-29 10:03:38 +02:00
2016-03-24 10:52:25 -07:00
2017-09-14 18:54:14 +02:00
2016-07-15 08:08:13 -04:00
2016-09-13 15:23:12 +02:00
2016-11-24 11:55:43 -05:00
2015-04-08 09:40:01 -04:00
2017-08-30 14:02:01 +02:00
2017-09-13 18:53:16 -07:00
2015-03-25 08:57:22 -04:00
2016-07-15 15:55:01 -07:00
2015-01-13 17:51:08 -05:00
2015-11-06 17:50:42 -08:00
2017-07-10 16:32:32 -07:00
2016-04-01 17:03:37 -05:00
2016-03-17 15:09:34 -07:00
2017-06-20 15:31:43 -04:00
2016-09-16 23:55:30 +02:00
2016-07-15 15:52:41 -04:00
2017-08-16 14:10:10 -07:00
2015-03-25 08:57:22 -04:00
2017-07-24 16:04:12 -07:00
2017-06-05 14:30:49 +01:00
2017-09-29 11:02:57 +02:00
2016-04-11 16:57:09 -04:00
2017-05-31 21:01:03 +02:00
2017-06-13 18:51:11 +01:00
2015-08-05 12:27:09 -07:00
2016-07-13 15:53:43 -04:00
2016-02-07 14:13:05 -05:00
2016-12-19 09:05:20 -05:00
2017-03-03 09:45:01 -05:00
2015-06-02 08:03:25 -07:00
2015-08-31 10:47:14 -04:00
2017-10-18 14:15:14 +01:00
2015-08-03 23:15:50 +08:00
2017-05-05 15:54:45 +08:00
2017-02-27 13:26:17 -08:00
2016-03-08 11:19:28 -05:00
2017-01-05 18:10:04 -05:00
2017-04-14 22:37:02 -03:00
2015-12-18 13:53:31 -02:00
2017-02-22 16:41:29 -08:00
2016-08-02 02:57:29 +03:00
2016-11-10 13:53:32 -07:00
2017-07-29 09:00:03 -06:00
2017-10-18 12:12:18 +01:00
2017-08-31 09:45:55 -04:00