Andrey Vagin
8142b227ef
netfilter: nf_conntrack: flush net_gre->keymap_list only from gre helper
nf_ct_gre_keymap_flush() removes a nf_ct_gre_keymap object from
net_gre->keymap_list and frees the object. But it doesn't clean
a reference on this object from ct_pptp_info->keymap[dir].
Then nf_ct_gre_keymap_destroy() may release the same object again.
So nf_ct_gre_keymap_flush() can be called only when we are sure that
when nf_ct_gre_keymap_destroy will not be called.
nf_ct_gre_keymap is created by nf_ct_gre_keymap_add() and the right way
to destroy it is to call nf_ct_gre_keymap_destroy().
This patch marks nf_ct_gre_keymap_flush() as static, so this patch can
break compilation of third party modules, which use
nf_ct_gre_keymap_flush. I'm not sure this is the right way to deprecate
this function.
[ 226.540793] general protection fault: 0000 [#1] SMP
[ 226.541750] Modules linked in: nf_nat_pptp nf_nat_proto_gre
nf_conntrack_pptp nf_conntrack_proto_gre ip_gre ip_tunnel gre
ppp_deflate bsd_comp ppp_async crc_ccitt ppp_generic slhc xt_nat
iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat
nf_conntrack veth tun bridge stp llc ppdev microcode joydev pcspkr
serio_raw virtio_console virtio_balloon floppy parport_pc parport
pvpanic i2c_piix4 virtio_net drm_kms_helper ttm ata_generic virtio_pci
virtio_ring virtio drm i2c_core pata_acpi [last unloaded: ip_tunnel]
[ 226.541776] CPU: 0 PID: 49 Comm: kworker/u4:2 Not tainted 3.14.0-rc8+ #101
[ 226.541776] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[ 226.541776] Workqueue: netns cleanup_net
[ 226.541776] task: ffff8800371e0000 ti: ffff88003730c000 task.ti: ffff88003730c000
[ 226.541776] RIP: 0010:[<ffffffff81389ba9>] [<ffffffff81389ba9>] __list_del_entry+0x29/0xd0
[ 226.541776] RSP: 0018:ffff88003730dbd0 EFLAGS: 00010a83
[ 226.541776] RAX: 6b6b6b6b6b6b6b6b RBX: ffff8800374e6c40 RCX: dead000000200200
[ 226.541776] RDX: 6b6b6b6b6b6b6b6b RSI: ffff8800371e07d0 RDI: ffff8800374e6c40
[ 226.541776] RBP: ffff88003730dbd0 R08: 0000000000000000 R09: 0000000000000000
[ 226.541776] R10: 0000000000000001 R11: ffff88003730d92e R12: 0000000000000002
[ 226.541776] R13: ffff88007a4c42d0 R14: ffff88007aef0000 R15: ffff880036cf0018
[ 226.541776] FS: 0000000000000000(0000) GS:ffff88007fc00000(0000) knlGS:0000000000000000
[ 226.541776] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[ 226.541776] CR2: 00007f07f643f7d0 CR3: 0000000036fd2000 CR4: 00000000000006f0
[ 226.541776] Stack:
[ 226.541776] ffff88003730dbe8 ffffffff81389c5d ffff8800374ffbe4 ffff88003730dc28
[ 226.541776] ffffffffa0162a43 ffffffffa01627c5 ffff88007a4c42d0 ffff88007aef0000
[ 226.541776] ffffffffa01651c0 ffff88007a4c45e0 ffff88007aef0000 ffff88003730dc40
[ 226.541776] Call Trace:
[ 226.541776] [<ffffffff81389c5d>] list_del+0xd/0x30
[ 226.541776] [<ffffffffa0162a43>] nf_ct_gre_keymap_destroy+0x283/0x2d0 [nf_conntrack_proto_gre]
[ 226.541776] [<ffffffffa01627c5>] ? nf_ct_gre_keymap_destroy+0x5/0x2d0 [nf_conntrack_proto_gre]
[ 226.541776] [<ffffffffa0162ab7>] gre_destroy+0x27/0x70 [nf_conntrack_proto_gre]
[ 226.541776] [<ffffffffa0117de3>] destroy_conntrack+0x83/0x200 [nf_conntrack]
[ 226.541776] [<ffffffffa0117d87>] ? destroy_conntrack+0x27/0x200 [nf_conntrack]
[ 226.541776] [<ffffffffa0117d60>] ? nf_conntrack_hash_check_insert+0x2e0/0x2e0 [nf_conntrack]
[ 226.541776] [<ffffffff81630142>] nf_conntrack_destroy+0x72/0x180
[ 226.541776] [<ffffffff816300d5>] ? nf_conntrack_destroy+0x5/0x180
[ 226.541776] [<ffffffffa011ef80>] ? kill_l3proto+0x20/0x20 [nf_conntrack]
[ 226.541776] [<ffffffffa011847e>] nf_ct_iterate_cleanup+0x14e/0x170 [nf_conntrack]
[ 226.541776] [<ffffffffa011f74b>] nf_ct_l4proto_pernet_unregister+0x5b/0x90 [nf_conntrack]
[ 226.541776] [<ffffffffa0162409>] proto_gre_net_exit+0x19/0x30 [nf_conntrack_proto_gre]
[ 226.541776] [<ffffffff815edf89>] ops_exit_list.isra.1+0x39/0x60
[ 226.541776] [<ffffffff815eecc0>] cleanup_net+0x100/0x1d0
[ 226.541776] [<ffffffff810a608a>] process_one_work+0x1ea/0x4f0
[ 226.541776] [<ffffffff810a6028>] ? process_one_work+0x188/0x4f0
[ 226.541776] [<ffffffff810a64ab>] worker_thread+0x11b/0x3a0
[ 226.541776] [<ffffffff810a6390>] ? process_one_work+0x4f0/0x4f0
[ 226.541776] [<ffffffff810af42d>] kthread+0xed/0x110
[ 226.541776] [<ffffffff8173d4dc>] ? _raw_spin_unlock_irq+0x2c/0x40
[ 226.541776] [<ffffffff810af340>] ? kthread_create_on_node+0x200/0x200
[ 226.541776] [<ffffffff8174747c>] ret_from_fork+0x7c/0xb0
[ 226.541776] [<ffffffff810af340>] ? kthread_create_on_node+0x200/0x200
[ 226.541776] Code: 00 00 55 48 8b 17 48 b9 00 01 10 00 00 00 ad de
48 8b 47 08 48 89 e5 48 39 ca 74 29 48 b9 00 02 20 00 00 00 ad de 48
39 c8 74 7a <4c> 8b 00 4c 39 c7 75 53 4c 8b 42 08 4c 39 c7 75 2b 48 89
42 08
[ 226.541776] RIP [<ffffffff81389ba9>] __list_del_entry+0x29/0xd0
[ 226.541776] RSP <ffff88003730dbd0>
[ 226.612193] ---[ end trace 985ae23ddfcc357c ]---
Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Patrick McHardy <kaber@trash.net>
Cc: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2014-04-08 10:56:12 +02:00
..
2014-01-30 17:20:32 -08:00
2014-03-07 09:18:23 +01:00
2014-02-17 12:37:09 -08:00
2014-02-19 12:07:55 -07:00
2014-03-19 14:41:58 +09:00
2014-02-06 10:22:56 +01:00
2014-02-19 14:58:17 +01:00
2014-01-24 17:17:30 -08:00
2014-02-15 10:58:17 +00:00
2014-01-25 10:49:30 -08:00
2014-04-01 15:38:47 -07:00
2014-03-28 16:29:35 -04:00
2014-02-13 20:48:02 -08:00
2014-03-17 13:44:14 -04:00
2014-04-08 10:56:12 +02:00
2014-03-09 12:45:08 +05:30
2014-04-02 16:23:38 -07:00
2014-03-26 16:58:11 +00:00
2014-02-22 18:14:13 +01:00
2014-04-02 16:23:38 -07:00
2014-01-24 22:39:54 +01:00
2014-01-30 10:18:43 -08:00
2014-04-02 20:53:45 -07:00
2014-04-01 15:14:04 -07:00
2014-02-22 17:13:01 -05:00
2014-02-12 17:21:22 +00:00
2014-02-28 19:44:55 -08:00
2014-02-05 12:54:53 -08:00
2014-02-11 08:40:45 -07:00
2014-03-30 17:02:06 -07:00
2014-03-13 09:38:42 -06:00
2014-04-01 19:19:15 -07:00
2014-02-24 14:46:32 -08:00
2014-01-30 16:56:54 -08:00
2014-02-14 00:27:58 -05:00
2014-01-23 16:36:56 -08:00
2014-02-11 10:38:30 -05:00
2014-01-30 17:07:18 -08:00
2014-02-09 15:11:47 +01:00
2014-01-21 20:18:26 -08:00
2014-01-21 16:19:48 -08:00
2014-04-02 12:51:41 -07:00
2014-02-13 12:34:05 +01:00
2014-01-23 18:11:00 -08:00
2014-01-23 18:11:00 -08:00
2014-02-07 15:40:17 -08:00
2014-02-18 12:45:38 -08:00
2014-02-18 12:38:37 -08:00
2014-03-26 16:41:41 +01:00
2014-03-11 11:52:47 +01:00
2014-03-13 15:56:44 +01:00
2014-04-01 16:28:19 -07:00
2014-02-13 10:08:52 +05:30
2014-01-21 16:19:41 -08:00
2014-01-29 20:27:23 -08:00
2014-02-17 16:46:48 +01:00
2014-02-17 16:50:37 +01:00
2014-03-05 18:15:37 +00:00
2014-02-24 14:46:38 -08:00
2014-02-12 17:33:03 -05:00
2014-03-19 14:41:58 +09:00
2014-01-25 03:14:36 -05:00
2014-03-10 11:44:42 -04:00
2014-03-31 00:45:09 -04:00
2014-03-07 10:19:57 -05:00
2014-01-21 23:17:20 -08:00
2014-02-28 15:12:09 -08:00
2014-03-10 11:44:42 -04:00
2014-02-18 12:20:45 -08:00
2014-02-25 11:18:06 +01:00
2014-03-20 13:21:05 -04:00
2014-03-03 11:32:08 +01:00
2014-01-23 16:36:52 -08:00
2014-03-10 17:26:19 -07:00
2014-02-20 14:54:28 +01:00
2014-02-19 17:22:44 +01:00
2014-02-17 17:12:47 +01:00
2014-04-02 16:24:28 -07:00
2014-04-01 19:06:50 +02:00
2014-03-20 12:35:45 +01:00
2014-03-04 07:55:47 -08:00
2014-01-23 16:36:50 -08:00
2014-01-23 16:36:50 -08:00
2014-03-08 22:15:52 -08:00
2014-01-29 20:40:08 +01:00
2014-01-26 22:48:35 +01:00
2014-04-02 16:23:38 -07:00
2014-03-20 11:53:20 -04:00
2014-03-26 16:41:28 -04:00
2014-01-23 18:08:10 -08:00
2014-02-13 20:24:13 -08:00
2014-02-19 17:22:44 +01:00
2014-02-13 18:12:04 -08:00
2014-02-26 14:42:09 -07:00
2014-02-25 15:25:45 -08:00
2014-01-27 21:02:39 -08:00
2014-02-21 21:49:07 +01:00
2014-03-14 13:43:33 +01:00
2014-03-31 00:45:09 -04:00
2014-04-01 11:22:57 -07:00
2014-03-20 16:28:09 -07:00
2014-03-08 22:08:29 -08:00
2014-03-06 16:30:46 +01:00
2014-02-19 14:58:17 +01:00
2014-01-25 08:55:09 +01:00
2014-01-21 16:19:45 -08:00
2014-03-21 13:43:13 +01:00
2014-03-19 16:30:23 -04:00
2014-02-13 20:21:59 -08:00
2014-03-31 14:13:25 -07:00
2014-02-28 15:36:37 -08:00
2014-01-23 16:36:51 -08:00
2014-01-23 16:36:51 -08:00
2014-01-21 16:19:44 -08:00
2014-01-21 16:19:49 -08:00
2014-04-02 20:53:45 -07:00
2014-04-02 12:26:43 -07:00
2014-01-21 16:19:44 -08:00
2014-01-23 16:36:50 -08:00
2014-03-10 17:26:19 -07:00
2014-04-01 16:28:19 -07:00
2014-03-04 13:51:06 -05:00
2014-01-27 21:02:39 -08:00
2014-03-11 12:14:56 +01:00
2014-04-03 14:31:34 -04:00
2014-04-03 14:29:12 -04:00
2014-03-29 17:58:37 -04:00
2014-01-31 15:39:07 -08:00
2014-03-01 13:51:53 -06:00
2014-04-01 16:25:51 -04:00
2014-01-25 03:14:05 -05:00
2014-03-07 10:24:49 -05:00
2014-02-05 10:04:37 -06:00
2014-03-11 17:26:47 +00:00
2014-03-07 16:02:46 +01:00
2014-03-11 17:27:12 +00:00
2014-04-02 14:27:15 -07:00
2014-02-06 13:48:51 -08:00
2014-01-23 16:36:50 -08:00
2014-01-23 16:36:55 -08:00
2014-04-01 18:49:04 -07:00
2014-02-06 17:31:52 +01:00
2014-03-19 15:11:19 -06:00
2014-01-23 20:17:18 +00:00
2014-01-23 16:36:50 -08:00
2014-02-17 16:40:09 -05:00
2014-02-20 14:54:28 +01:00
2014-02-11 00:36:00 +01:00
2014-03-02 00:18:15 +01:00
2014-03-20 13:25:54 +01:00
2014-01-25 23:58:17 -05:00
2014-01-28 08:38:04 -08:00
2014-01-23 14:48:35 +01:00
2014-01-25 11:17:34 -08:00
2014-04-01 16:43:18 -04:00
2014-03-21 14:21:13 -04:00
2014-01-23 16:36:58 -08:00
2014-01-21 23:17:20 -08:00
2014-02-17 15:01:52 -08:00
2014-03-31 11:05:24 -07:00
2014-03-20 17:12:25 -07:00
2014-03-20 17:12:25 -07:00
2014-01-21 23:17:20 -08:00
2014-04-01 16:13:21 -07:00
2014-03-20 22:09:09 -07:00
2014-01-28 13:20:09 -08:00
2014-04-01 11:00:07 -07:00
2014-03-31 00:45:09 -04:00
2014-03-10 08:30:02 +01:00
2014-02-28 16:27:18 -08:00
2014-03-17 16:20:49 -07:00
2014-01-27 21:02:39 -08:00
2014-04-02 20:53:45 -07:00
2014-01-25 11:17:34 -08:00
2014-03-10 17:26:19 -07:00
2014-02-24 14:47:15 -08:00
2014-01-22 21:57:05 -08:00
2014-01-27 21:02:40 -08:00
2014-02-15 11:55:28 -08:00
2014-02-17 15:01:37 -08:00
2014-01-21 08:28:07 +00:00
2014-01-21 17:05:27 -08:00
2014-03-26 16:49:31 -04:00
2014-03-04 09:12:24 +01:00
2014-03-25 20:54:57 -07:00
2014-02-26 17:08:40 -05:00
2014-02-23 09:04:27 -08:00
2014-03-03 21:11:05 -05:00
2014-02-18 12:50:26 -08:00
2014-04-02 20:53:45 -07:00
2014-03-14 22:41:36 -04:00
2014-03-04 15:38:16 -08:00
2014-04-01 17:06:09 -07:00
2014-01-25 09:10:41 +01:00
2014-02-07 11:27:30 -08:00
2014-01-23 16:37:04 -08:00
2014-02-27 12:20:31 +01:00
2014-02-28 14:08:26 -05:00
2014-04-01 11:00:07 -07:00
2014-02-22 02:02:28 +01:00
2014-01-30 16:56:55 -08:00