From: Pravin B Shelar Date: Thu, 17 Dec 2015 21:56:39 +0000 (-0800) Subject: datapath: stt: Use RCU API to update stt-dev list. X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fovs.git;a=commitdiff_plain;h=8ab1170b06ddf33dfb06b0346d21f2e4380d8eea datapath: stt: Use RCU API to update stt-dev list. Following crash was reported for STT tunnel. I am not able to reproduce it, But the usage of wrong list manipulation API is likely culprit. ---8<--- IP: [] nf_ip_hook+0xfd/0x180 [openvswitch] Oops: 0000 [#1] PREEMPT SMP Hardware name: VMware, Inc. VMware Virtual Platform/440BX RIP: 0010:[] [] nf_ip_hook+0xfd/0x180 [openvswitch] RSP: 0018:ffff88043fd03cd0 EFLAGS: 00010206 RAX: 0000000000000000 RBX: ffff8801008e2200 RCX: 0000000000000034 RDX: 0000000000000110 RSI: ffff8801008e2200 RDI: ffff8801533a3880 RBP: ffff88043fd03d00 R08: ffffffff90646d10 R09: ffff880164b27000 R10: 0000000000000003 R11: ffff880155eb9dd8 R12: 0000000000000028 R13: ffff8802283dc580 R14: 00000000000076b4 R15: ffff880013b20000 FS: 00007ff5ba73b700(0000) GS:ffff88043fd00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000020 CR3: 000000037ff96000 CR4: 00000000000007e0 Stack: ffff8801533a3890 ffff88043fd03d80 ffffffff90646d10 0000000000000000 ffff880164b27000 ffff8801008e2200 ffff88043fd03d48 ffffffff9064050a ffffffff90d0f930 ffffffffc0e7ef80 0000000000000001 ffff8801008e2200 Call Trace: [] ? ip_rcv_finish+0x350/0x350 [] nf_iterate+0x9a/0xb0 [] ? ip_rcv_finish+0x350/0x350 [] nf_hook_slow+0x7c/0x120 [] ? ip_rcv_finish+0x350/0x350 [] ip_local_deliver+0x73/0x80 [] ip_rcv_finish+0x7d/0x350 [] ip_rcv+0x298/0x3d0 [] __netif_receive_skb_core+0x696/0x880 [] __netif_receive_skb+0x18/0x60 [] process_backlog+0xae/0x180 [] net_rx_action+0x152/0x270 [] __do_softirq+0xf5/0x320 [] do_softirq_own_stack+0x1c/0x30 Reported-by: Joe Stringer Signed-off-by: Pravin B Shelar Acked-by: Jesse Gross --- diff --git a/datapath/linux/compat/stt.c b/datapath/linux/compat/stt.c index 80649802f..dcd70ffc9 100644 --- a/datapath/linux/compat/stt.c +++ b/datapath/linux/compat/stt.c @@ -1770,7 +1770,7 @@ static int stt_configure(struct net *net, struct net_device *dev, if (err) return err; - list_add(&stt->next, &sn->stt_list); + list_add_rcu(&stt->next, &sn->stt_list); return 0; } @@ -1789,7 +1789,7 @@ static void stt_dellink(struct net_device *dev, struct list_head *head) { struct stt_dev *stt = netdev_priv(dev); - list_del(&stt->next); + list_del_rcu(&stt->next); unregister_netdevice_queue(dev, head); }