Nikolay Aleksandrov
18041e3174
vrf: vrf_master_ifindex_rcu is not always called with rcu read lock
While running net-next I hit this:
[ 634.073119] ===============================
[ 634.073150] [ INFO: suspicious RCU usage. ]
[ 634.073182] 4.2.0-rc6+ #45 Not tainted
[ 634.073213] -------------------------------
[ 634.073244] include/net/vrf.h:38 suspicious rcu_dereference_check()
usage!
[ 634.073274]
other info that might help us debug this:
[ 634.073307]
rcu_scheduler_active = 1, debug_locks = 1
[ 634.073338] 2 locks held by swapper/0/0:
[ 634.073369] #0: (((&n->timer))){+.-...}, at: [<ffffffff8112bc35>]
call_timer_fn+0x5/0x480
[ 634.073412] #1: (slock-AF_INET){+.-...}, at: [<ffffffff8174f0f5>]
icmp_send+0x155/0x5f0
[ 634.073450]
stack backtrace:
[ 634.073483] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.2.0-rc6+ #45
[ 634.073514] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS
VirtualBox 12/01/2006
[ 634.073545] 0000000000000000 0593ba8242d9ace4 ffff88002fc03b48
ffffffff81803f1b
[ 634.073612] 0000000000000000 ffffffff81e12500 ffff88002fc03b78
ffffffff811003c5
[ 634.073642] 0000000000000000 ffff88002ec4e600 ffffffff81f00f80
ffff88002fc03cf0
[ 634.073669] Call Trace:
[ 634.073694] <IRQ> [<ffffffff81803f1b>] dump_stack+0x4c/0x65
[ 634.073728] [<ffffffff811003c5>] lockdep_rcu_suspicious+0xc5/0x100
[ 634.073763] [<ffffffff8174eb56>] icmp_route_lookup+0x176/0x5c0
[ 634.073793] [<ffffffff8174f2fb>] ? icmp_send+0x35b/0x5f0
[ 634.073818] [<ffffffff8174f274>] ? icmp_send+0x2d4/0x5f0
[ 634.073844] [<ffffffff8174f3ce>] icmp_send+0x42e/0x5f0
[ 634.073873] [<ffffffff8170b662>] ipv4_link_failure+0x22/0xa0
[ 634.073899] [<ffffffff8174bdda>] arp_error_report+0x3a/0x80
[ 634.073926] [<ffffffff816d6100>] ? neigh_lookup+0x2c0/0x2c0
[ 634.073952] [<ffffffff816d396e>] neigh_invalidate+0x8e/0x110
[ 634.073984] [<ffffffff816d62ae>] neigh_timer_handler+0x1ae/0x290
[ 634.074013] [<ffffffff816d6100>] ? neigh_lookup+0x2c0/0x2c0
[ 634.074013] [<ffffffff8112bce3>] call_timer_fn+0xb3/0x480
[ 634.074013] [<ffffffff8112bc35>] ? call_timer_fn+0x5/0x480
[ 634.074013] [<ffffffff816d6100>] ? neigh_lookup+0x2c0/0x2c0
[ 634.074013] [<ffffffff8112c2bc>] run_timer_softirq+0x20c/0x430
[ 634.074013] [<ffffffff810af50e>] __do_softirq+0xde/0x630
[ 634.074013] [<ffffffff810afc97>] irq_exit+0x117/0x120
[ 634.074013] [<ffffffff81810976>] smp_apic_timer_interrupt+0x46/0x60
[ 634.074013] [<ffffffff8180e950>] apic_timer_interrupt+0x70/0x80
[ 634.074013] <EOI> [<ffffffff8106b9d6>] ? native_safe_halt+0x6/0x10
[ 634.074013] [<ffffffff81101d8d>] ? trace_hardirqs_on+0xd/0x10
[ 634.074013] [<ffffffff81027d43>] default_idle+0x23/0x200
[ 634.074013] [<ffffffff8102852f>] arch_cpu_idle+0xf/0x20
[ 634.074013] [<ffffffff810f89ba>] default_idle_call+0x2a/0x40
[ 634.074013] [<ffffffff810f8dcc>] cpu_startup_entry+0x39c/0x4c0
[ 634.074013] [<ffffffff817f9cad>] rest_init+0x13d/0x150
[ 634.074013] [<ffffffff81f69038>] start_kernel+0x4a8/0x4c9
[ 634.074013] [<ffffffff81f68120>] ?
early_idt_handler_array+0x120/0x120
[ 634.074013] [<ffffffff81f68339>] x86_64_start_reservations+0x2a/0x2c
[ 634.074013] [<ffffffff81f68485>] x86_64_start_kernel+0x14a/0x16d
It would seem vrf_master_ifindex_rcu() can be called without RCU held in
other contexts as well so introduce a new helper which acquires rcu and
returns the ifindex.
Also add curly braces around both the "if" and "else" parts as per the
style guide.
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-19 22:13:20 -07:00
..
2015-04-11 22:28:27 -04:00
2015-08-10 21:36:13 +02:00
2015-02-20 17:35:14 -05:00
2014-12-10 15:33:16 -05:00
2013-04-08 17:16:57 -04:00
2015-07-20 14:58:19 +02:00
2015-08-04 23:57:45 -07:00
2015-06-11 23:37:37 +02:00
2012-06-17 16:29:38 -07:00
2015-06-14 12:55:49 -07:00
2015-07-08 13:50:42 -07:00
2015-08-11 22:05:36 +02:00
2015-07-31 23:52:20 -07:00
2015-07-31 15:21:30 -07:00
2014-10-25 08:07:30 +02:00
2013-07-31 17:50:01 -07:00
2015-06-10 22:49:20 -07:00
2015-05-11 10:50:17 -04:00
2014-09-18 10:54:36 +02:00
2015-03-04 00:23:23 -05:00
2015-06-28 16:55:44 -07:00
2015-02-24 16:05:48 -05:00
2014-11-10 13:27:49 -05:00
2015-07-27 01:05:24 -07:00
2015-05-11 10:59:32 -04:00
2014-01-13 17:39:11 +01:00
2015-07-17 15:39:41 +02:00
2015-08-10 20:43:06 +02:00
2015-08-17 21:33:06 -07:00
2015-02-11 14:46:37 -05:00
2015-07-20 12:41:30 -07:00
2015-05-13 14:31:43 -04:00
2015-04-09 00:02:26 -04:00
2014-02-09 17:32:50 -08:00
2013-12-06 12:37:56 -05:00
2015-03-06 21:50:02 -05:00
2013-12-10 21:50:00 -05:00
2013-09-20 14:49:32 -04:00
2015-04-07 15:25:55 -04:00
2013-09-20 14:49:32 -04:00
2014-02-09 17:32:49 -08:00
2014-02-09 17:32:49 -08:00
2015-08-18 14:17:21 -07:00
2013-01-09 23:59:53 -08:00
2015-07-31 15:20:22 -07:00
2015-03-09 16:06:10 -04:00
2015-07-21 10:39:05 -07:00
2013-11-07 19:28:58 -05:00
2014-02-04 20:19:51 -08:00
2015-07-21 10:39:06 -07:00
2013-03-26 12:32:13 -04:00
2015-06-04 15:44:31 -07:00
2015-08-13 22:43:20 -07:00
2014-02-12 07:02:11 +01:00
2014-11-12 15:01:35 -05:00
2013-09-20 14:49:33 -04:00
2014-09-30 01:02:26 -04:00
2015-03-12 14:39:40 -04:00
2015-05-13 15:59:13 -04:00
2015-08-10 14:03:54 -07:00
2015-01-18 01:56:32 -05:00
2014-11-05 16:30:03 -05:00
2013-09-20 14:49:33 -04:00
2014-02-06 09:34:58 +01:00
2015-06-12 11:42:29 +02:00
2015-03-23 22:12:09 -04:00
2015-03-20 12:40:25 -04:00
2015-03-18 22:00:35 -04:00
2015-05-11 10:50:18 -04:00
2015-05-31 21:49:14 -07:00
2014-05-07 15:30:52 -04:00
2015-07-26 21:00:15 -07:00
2015-07-09 15:12:20 -07:00
2015-06-06 23:57:12 -07:00
2015-07-09 15:12:20 -07:00
2015-03-31 13:58:35 -04:00
2014-08-24 18:09:23 -07:00
2015-07-21 10:39:04 -07:00
2015-05-25 13:25:34 -04:00
2015-04-07 15:29:08 -04:00
2015-07-31 23:52:20 -07:00
2015-08-10 14:03:54 -07:00
2015-03-12 14:39:40 -04:00
2015-07-29 22:44:04 -07:00
2015-07-31 17:07:12 -07:00
2014-11-24 04:28:49 -05:00
2015-02-28 21:31:12 +01:00
2013-09-21 14:01:38 -04:00
2014-10-14 02:18:27 +02:00
2013-09-21 14:01:38 -04:00
2013-09-21 14:01:38 -04:00
2014-12-10 15:21:24 -05:00
2015-05-11 10:50:17 -04:00
2013-09-21 14:01:38 -04:00
2014-01-01 22:22:43 -05:00
2013-09-21 14:01:38 -04:00
2013-09-21 14:01:38 -04:00
2014-12-10 15:21:24 -05:00
2013-09-21 14:01:38 -04:00
2014-01-03 20:56:48 -05:00
2015-08-19 17:37:51 -07:00
2015-08-13 11:31:45 +02:00
2015-07-23 17:10:50 +02:00
2013-12-06 12:37:56 -05:00
2014-09-22 16:23:15 -04:00
2015-07-21 10:39:05 -07:00
2014-11-05 23:52:33 -08:00
2013-10-01 17:06:14 -04:00
2015-03-04 00:23:23 -05:00
2015-08-10 13:46:21 -07:00
2015-06-18 21:14:29 +02:00
2013-09-21 14:01:39 -04:00
2014-08-07 20:55:21 -04:00
2015-03-31 13:58:35 -04:00
2014-02-08 10:36:58 -05:00
2013-09-21 14:01:39 -04:00
2015-08-10 20:43:06 +02:00
2013-09-21 14:01:39 -04:00
2015-03-02 13:06:31 -05:00
2014-10-06 18:02:32 -04:00
2015-01-13 17:51:08 -05:00
2014-05-23 16:28:53 -04:00
2013-09-23 01:51:08 -04:00
2013-09-23 01:51:08 -04:00
2013-09-23 01:51:08 -04:00
2014-01-21 23:17:20 -08:00
2014-12-17 11:49:55 +01:00
2015-05-05 16:02:34 -04:00
2013-09-23 01:51:08 -04:00
2015-08-13 22:43:21 -07:00
2015-07-21 10:39:07 -07:00
2015-07-08 13:50:41 -07:00
2013-09-23 01:51:09 -04:00
2014-06-02 11:00:41 -07:00
2014-10-15 07:48:18 +02:00
2015-07-31 23:52:20 -07:00
2013-12-19 18:51:20 -05:00
2013-09-23 01:51:09 -04:00
2015-08-11 12:03:19 -07:00
2013-10-21 18:43:02 -04:00
2015-03-12 22:58:12 -04:00
2015-07-09 14:22:52 -07:00
2015-07-09 15:12:20 -07:00
2014-01-19 19:53:18 -08:00
2014-05-22 14:57:15 -04:00
2015-04-07 15:29:08 -04:00
2015-03-02 13:06:31 -05:00
2015-02-04 01:34:15 -05:00
2015-08-19 22:13:20 -07:00
2013-07-27 22:14:06 -07:00
2015-08-07 11:46:34 -07:00
2013-09-23 16:29:40 -04:00
2014-09-05 17:35:28 -07:00
2013-09-23 16:29:41 -04:00
2015-08-11 12:41:35 +02:00