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-08-17 21:33:06 -07:00
2015-08-17 15:58:57 -07:00
2014-09-18 10:54:36 +02:00
2015-08-13 22:43:21 -07:00
2015-04-03 12:11:15 -04:00
2015-07-29 22:44:04 -07:00
2015-07-28 23:38:13 -07:00
2015-05-28 11:23:20 +08:00
2015-08-13 22:43:21 -07:00
2015-07-24 22:46:11 -07:00
2015-06-24 02:15:54 -07:00
2015-08-18 19:11:19 -07:00
2015-08-13 22:43:20 -07:00
2015-04-16 12:11:19 -04:00
2015-05-13 15:59:13 -04:00
2015-08-10 14:03:54 -07:00
2015-04-03 12:11:15 -04:00
2015-08-19 22:13:20 -07:00
2015-05-04 14:49:23 -04:00
2015-08-10 21:17:29 -07:00
2015-07-10 23:25:24 -07:00
2015-07-26 21:00:15 -07:00
2015-07-23 00:41:16 -07:00
2013-12-29 16:34:25 -05:00
2015-07-09 15:12:20 -07:00
2014-09-08 16:42:42 -07:00
2015-05-25 00:08:48 -04:00
2015-08-13 22:43:21 -07:00
2015-08-10 14:03:54 -07:00
2015-07-21 10:39:05 -07:00
2015-04-03 12:11:15 -04:00
2015-08-13 22:43:21 -07:00
2015-06-24 02:58:51 -07:00
2015-08-18 19:11:20 -07:00
2015-08-10 14:03:54 -07:00
2015-05-28 06:23:32 +02:00
2015-04-03 12:11:15 -04:00
2015-08-12 16:40:22 -07:00
2015-08-10 14:03:54 -07:00
2015-04-07 15:25:55 -04:00
2015-06-11 00:09:12 -07:00
2015-06-11 00:09:12 -07:00
2015-06-16 14:12:34 -04:00
2015-07-09 21:09:10 -07:00
2015-07-21 22:36:33 -07:00
2014-09-19 17:15:31 -04:00
2015-04-13 18:18:05 -04:00
2015-08-17 21:33:05 -07:00
2015-06-07 15:19:52 -07:00
2015-05-30 17:37:44 -07:00
2015-07-09 14:22:52 -07:00
2015-07-09 14:22:52 -07:00
2015-07-09 14:22:52 -07:00
2015-07-09 14:22:52 -07:00
2015-06-10 23:28:33 -07:00
2015-06-15 19:49:22 -07:00
2015-06-23 02:38:10 -07:00
2015-07-09 14:22:52 -07:00
2015-07-09 14:22:52 -07:00
2015-07-09 14:22:52 -07:00
2015-07-09 14:22:52 -07:00
2015-07-23 00:41:16 -07:00
2015-08-13 16:23:11 -07:00
2014-05-03 19:23:07 -04:00
2015-02-12 18:54:10 -08:00
2015-07-09 14:22:52 -07:00
2015-07-09 15:12:20 -07:00
2015-06-11 16:33:10 -07:00
2015-08-13 16:52:20 -07:00
2014-09-01 18:12:45 -07:00
2015-07-09 14:22:52 -07:00
2015-07-09 21:44:38 -07:00
2015-07-09 14:22:52 -07:00
2015-04-29 17:10:38 -04:00
2015-07-09 14:22:52 -07:00
2015-05-05 19:50:09 -04:00
2015-01-28 22:18:37 -08:00
2015-07-27 01:06:53 -07:00
2015-06-15 19:49:22 -07:00
2015-03-02 13:06:31 -05:00
2015-04-03 12:11:15 -04:00
2015-05-11 10:50:18 -04:00
2015-08-13 22:43:20 -07:00
2014-05-23 16:28:53 -04:00
2015-04-07 15:25:55 -04:00
2013-12-26 13:43:21 -05:00
2015-03-25 14:07:04 -04:00
2015-04-07 15:25:55 -04:00
2015-08-11 12:41:35 +02:00
2014-06-30 07:49:47 +02:00
2013-12-18 16:58:20 -05:00
2013-05-31 17:19:05 -07:00