<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/net/l2tp, branch v3.18.78</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>l2tp: fix race condition in l2tp_tunnel_delete</title>
<updated>2017-10-21T15:07:25+00:00</updated>
<author>
<name>Sabrina Dubroca</name>
<email>sd@queasysnail.net</email>
</author>
<published>2017-09-26T14:16:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=5eaafe649af94c12164bb43f81d85cbc7cfe6778'/>
<id>5eaafe649af94c12164bb43f81d85cbc7cfe6778</id>
<content type='text'>
[ Upstream commit 62b982eeb4589b2e6d7c01a90590e3a4c2b2ca19 ]

If we try to delete the same tunnel twice, the first delete operation
does a lookup (l2tp_tunnel_get), finds the tunnel, calls
l2tp_tunnel_delete, which queues it for deletion by
l2tp_tunnel_del_work.

The second delete operation also finds the tunnel and calls
l2tp_tunnel_delete. If the workqueue has already fired and started
running l2tp_tunnel_del_work, then l2tp_tunnel_delete will queue the
same tunnel a second time, and try to free the socket again.

Add a dead flag to prevent firing the workqueue twice. Then we can
remove the check of queue_work's result that was meant to prevent that
race but doesn't.

Reproducer:

    ip l2tp add tunnel tunnel_id 3000 peer_tunnel_id 4000 local 192.168.0.2 remote 192.168.0.1 encap udp udp_sport 5000 udp_dport 6000
    ip l2tp add session name l2tp1 tunnel_id 3000 session_id 1000 peer_session_id 2000
    ip link set l2tp1 up
    ip l2tp del tunnel tunnel_id 3000
    ip l2tp del tunnel tunnel_id 3000

Fixes: f8ccac0e4493 ("l2tp: put tunnel socket release on a workqueue")
Reported-by: Jianlin Shi &lt;jishi@redhat.com&gt;
Signed-off-by: Sabrina Dubroca &lt;sd@queasysnail.net&gt;
Acked-by: Guillaume Nault &lt;g.nault@alphalink.fr&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 62b982eeb4589b2e6d7c01a90590e3a4c2b2ca19 ]

If we try to delete the same tunnel twice, the first delete operation
does a lookup (l2tp_tunnel_get), finds the tunnel, calls
l2tp_tunnel_delete, which queues it for deletion by
l2tp_tunnel_del_work.

The second delete operation also finds the tunnel and calls
l2tp_tunnel_delete. If the workqueue has already fired and started
running l2tp_tunnel_del_work, then l2tp_tunnel_delete will queue the
same tunnel a second time, and try to free the socket again.

Add a dead flag to prevent firing the workqueue twice. Then we can
remove the check of queue_work's result that was meant to prevent that
race but doesn't.

Reproducer:

    ip l2tp add tunnel tunnel_id 3000 peer_tunnel_id 4000 local 192.168.0.2 remote 192.168.0.1 encap udp udp_sport 5000 udp_dport 6000
    ip l2tp add session name l2tp1 tunnel_id 3000 session_id 1000 peer_session_id 2000
    ip link set l2tp1 up
    ip l2tp del tunnel tunnel_id 3000
    ip l2tp del tunnel tunnel_id 3000

Fixes: f8ccac0e4493 ("l2tp: put tunnel socket release on a workqueue")
Reported-by: Jianlin Shi &lt;jishi@redhat.com&gt;
Signed-off-by: Sabrina Dubroca &lt;sd@queasysnail.net&gt;
Acked-by: Guillaume Nault &lt;g.nault@alphalink.fr&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>l2tp: Avoid schedule while atomic in exit_net</title>
<updated>2017-10-21T15:07:25+00:00</updated>
<author>
<name>Ridge Kennedy</name>
<email>ridge.kennedy@alliedtelesis.co.nz</email>
</author>
<published>2017-02-22T01:59:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=88db37f8e4de97702da5f53c09cdbff0382f9bdd'/>
<id>88db37f8e4de97702da5f53c09cdbff0382f9bdd</id>
<content type='text'>
[ Upstream commit 12d656af4e3d2781b9b9f52538593e1717e7c979 ]

While destroying a network namespace that contains a L2TP tunnel a
"BUG: scheduling while atomic" can be observed.

Enabling lockdep shows that this is happening because l2tp_exit_net()
is calling l2tp_tunnel_closeall() (via l2tp_tunnel_delete()) from
within an RCU critical section.

l2tp_exit_net() takes rcu_read_lock_bh()
  &lt;&lt; list_for_each_entry_rcu() &gt;&gt;
  l2tp_tunnel_delete()
    l2tp_tunnel_closeall()
      __l2tp_session_unhash()
        synchronize_rcu() &lt;&lt; Illegal inside RCU critical section &gt;&gt;

BUG: sleeping function called from invalid context
in_atomic(): 1, irqs_disabled(): 0, pid: 86, name: kworker/u16:2
INFO: lockdep is turned off.
CPU: 2 PID: 86 Comm: kworker/u16:2 Tainted: G        W  O    4.4.6-at1 #2
Hardware name: Xen HVM domU, BIOS 4.6.1-xs125300 05/09/2016
Workqueue: netns cleanup_net
 0000000000000000 ffff880202417b90 ffffffff812b0013 ffff880202410ac0
 ffffffff81870de8 ffff880202417bb8 ffffffff8107aee8 ffffffff81870de8
 0000000000000c51 0000000000000000 ffff880202417be0 ffffffff8107b024
Call Trace:
 [&lt;ffffffff812b0013&gt;] dump_stack+0x85/0xc2
 [&lt;ffffffff8107aee8&gt;] ___might_sleep+0x148/0x240
 [&lt;ffffffff8107b024&gt;] __might_sleep+0x44/0x80
 [&lt;ffffffff810b21bd&gt;] synchronize_sched+0x2d/0xe0
 [&lt;ffffffff8109be6d&gt;] ? trace_hardirqs_on+0xd/0x10
 [&lt;ffffffff8105c7bb&gt;] ? __local_bh_enable_ip+0x6b/0xc0
 [&lt;ffffffff816a1b00&gt;] ? _raw_spin_unlock_bh+0x30/0x40
 [&lt;ffffffff81667482&gt;] __l2tp_session_unhash+0x172/0x220
 [&lt;ffffffff81667397&gt;] ? __l2tp_session_unhash+0x87/0x220
 [&lt;ffffffff8166888b&gt;] l2tp_tunnel_closeall+0x9b/0x140
 [&lt;ffffffff81668c74&gt;] l2tp_tunnel_delete+0x14/0x60
 [&lt;ffffffff81668dd0&gt;] l2tp_exit_net+0x110/0x270
 [&lt;ffffffff81668d5c&gt;] ? l2tp_exit_net+0x9c/0x270
 [&lt;ffffffff815001c3&gt;] ops_exit_list.isra.6+0x33/0x60
 [&lt;ffffffff81501166&gt;] cleanup_net+0x1b6/0x280
 ...

This bug can easily be reproduced with a few steps:

 $ sudo unshare -n bash  # Create a shell in a new namespace
 # ip link set lo up
 # ip addr add 127.0.0.1 dev lo
 # ip l2tp add tunnel remote 127.0.0.1 local 127.0.0.1 tunnel_id 1 \
    peer_tunnel_id 1 udp_sport 50000 udp_dport 50000
 # ip l2tp add session name foo tunnel_id 1 session_id 1 \
    peer_session_id 1
 # ip link set foo up
 # exit  # Exit the shell, in turn exiting the namespace
 $ dmesg
 ...
 [942121.089216] BUG: scheduling while atomic: kworker/u16:3/13872/0x00000200
 ...

To fix this, move the call to l2tp_tunnel_closeall() out of the RCU
critical section, and instead call it from l2tp_tunnel_del_work(), which
is running from the l2tp_wq workqueue.

Fixes: 2b551c6e7d5b ("l2tp: close sessions before initiating tunnel delete")
Signed-off-by: Ridge Kennedy &lt;ridge.kennedy@alliedtelesis.co.nz&gt;
Acked-by: Guillaume Nault &lt;g.nault@alphalink.fr&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 12d656af4e3d2781b9b9f52538593e1717e7c979 ]

While destroying a network namespace that contains a L2TP tunnel a
"BUG: scheduling while atomic" can be observed.

Enabling lockdep shows that this is happening because l2tp_exit_net()
is calling l2tp_tunnel_closeall() (via l2tp_tunnel_delete()) from
within an RCU critical section.

l2tp_exit_net() takes rcu_read_lock_bh()
  &lt;&lt; list_for_each_entry_rcu() &gt;&gt;
  l2tp_tunnel_delete()
    l2tp_tunnel_closeall()
      __l2tp_session_unhash()
        synchronize_rcu() &lt;&lt; Illegal inside RCU critical section &gt;&gt;

BUG: sleeping function called from invalid context
in_atomic(): 1, irqs_disabled(): 0, pid: 86, name: kworker/u16:2
INFO: lockdep is turned off.
CPU: 2 PID: 86 Comm: kworker/u16:2 Tainted: G        W  O    4.4.6-at1 #2
Hardware name: Xen HVM domU, BIOS 4.6.1-xs125300 05/09/2016
Workqueue: netns cleanup_net
 0000000000000000 ffff880202417b90 ffffffff812b0013 ffff880202410ac0
 ffffffff81870de8 ffff880202417bb8 ffffffff8107aee8 ffffffff81870de8
 0000000000000c51 0000000000000000 ffff880202417be0 ffffffff8107b024
Call Trace:
 [&lt;ffffffff812b0013&gt;] dump_stack+0x85/0xc2
 [&lt;ffffffff8107aee8&gt;] ___might_sleep+0x148/0x240
 [&lt;ffffffff8107b024&gt;] __might_sleep+0x44/0x80
 [&lt;ffffffff810b21bd&gt;] synchronize_sched+0x2d/0xe0
 [&lt;ffffffff8109be6d&gt;] ? trace_hardirqs_on+0xd/0x10
 [&lt;ffffffff8105c7bb&gt;] ? __local_bh_enable_ip+0x6b/0xc0
 [&lt;ffffffff816a1b00&gt;] ? _raw_spin_unlock_bh+0x30/0x40
 [&lt;ffffffff81667482&gt;] __l2tp_session_unhash+0x172/0x220
 [&lt;ffffffff81667397&gt;] ? __l2tp_session_unhash+0x87/0x220
 [&lt;ffffffff8166888b&gt;] l2tp_tunnel_closeall+0x9b/0x140
 [&lt;ffffffff81668c74&gt;] l2tp_tunnel_delete+0x14/0x60
 [&lt;ffffffff81668dd0&gt;] l2tp_exit_net+0x110/0x270
 [&lt;ffffffff81668d5c&gt;] ? l2tp_exit_net+0x9c/0x270
 [&lt;ffffffff815001c3&gt;] ops_exit_list.isra.6+0x33/0x60
 [&lt;ffffffff81501166&gt;] cleanup_net+0x1b6/0x280
 ...

This bug can easily be reproduced with a few steps:

 $ sudo unshare -n bash  # Create a shell in a new namespace
 # ip link set lo up
 # ip addr add 127.0.0.1 dev lo
 # ip l2tp add tunnel remote 127.0.0.1 local 127.0.0.1 tunnel_id 1 \
    peer_tunnel_id 1 udp_sport 50000 udp_dport 50000
 # ip l2tp add session name foo tunnel_id 1 session_id 1 \
    peer_session_id 1
 # ip link set foo up
 # exit  # Exit the shell, in turn exiting the namespace
 $ dmesg
 ...
 [942121.089216] BUG: scheduling while atomic: kworker/u16:3/13872/0x00000200
 ...

To fix this, move the call to l2tp_tunnel_closeall() out of the RCU
critical section, and instead call it from l2tp_tunnel_del_work(), which
is running from the l2tp_wq workqueue.

Fixes: 2b551c6e7d5b ("l2tp: close sessions before initiating tunnel delete")
Signed-off-by: Ridge Kennedy &lt;ridge.kennedy@alliedtelesis.co.nz&gt;
Acked-by: Guillaume Nault &lt;g.nault@alphalink.fr&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>l2tp: fix racy SOCK_ZAPPED flag check in l2tp_ip{,6}_bind()</title>
<updated>2017-05-08T05:44:10+00:00</updated>
<author>
<name>Guillaume Nault</name>
<email>g.nault@alphalink.fr</email>
</author>
<published>2016-11-18T21:13:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=dc57f1e18b8f484d013fd21bc89b7a5b88c3d460'/>
<id>dc57f1e18b8f484d013fd21bc89b7a5b88c3d460</id>
<content type='text'>
commit 32c231164b762dddefa13af5a0101032c70b50ef upstream.

Lock socket before checking the SOCK_ZAPPED flag in l2tp_ip6_bind().
Without lock, a concurrent call could modify the socket flags between
the sock_flag(sk, SOCK_ZAPPED) test and the lock_sock() call. This way,
a socket could be inserted twice in l2tp_ip6_bind_table. Releasing it
would then leave a stale pointer there, generating use-after-free
errors when walking through the list or modifying adjacent entries.

BUG: KASAN: use-after-free in l2tp_ip6_close+0x22e/0x290 at addr ffff8800081b0ed8
Write of size 8 by task syz-executor/10987
CPU: 0 PID: 10987 Comm: syz-executor Not tainted 4.8.0+ #39
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.8.2-0-g33fbe13 by qemu-project.org 04/01/2014
 ffff880031d97838 ffffffff829f835b ffff88001b5a1640 ffff8800081b0ec0
 ffff8800081b15a0 ffff8800081b6d20 ffff880031d97860 ffffffff8174d3cc
 ffff880031d978f0 ffff8800081b0e80 ffff88001b5a1640 ffff880031d978e0
Call Trace:
 [&lt;ffffffff829f835b&gt;] dump_stack+0xb3/0x118 lib/dump_stack.c:15
 [&lt;ffffffff8174d3cc&gt;] kasan_object_err+0x1c/0x70 mm/kasan/report.c:156
 [&lt;     inline     &gt;] print_address_description mm/kasan/report.c:194
 [&lt;ffffffff8174d666&gt;] kasan_report_error+0x1f6/0x4d0 mm/kasan/report.c:283
 [&lt;     inline     &gt;] kasan_report mm/kasan/report.c:303
 [&lt;ffffffff8174db7e&gt;] __asan_report_store8_noabort+0x3e/0x40 mm/kasan/report.c:329
 [&lt;     inline     &gt;] __write_once_size ./include/linux/compiler.h:249
 [&lt;     inline     &gt;] __hlist_del ./include/linux/list.h:622
 [&lt;     inline     &gt;] hlist_del_init ./include/linux/list.h:637
 [&lt;ffffffff8579047e&gt;] l2tp_ip6_close+0x22e/0x290 net/l2tp/l2tp_ip6.c:239
 [&lt;ffffffff850b2dfd&gt;] inet_release+0xed/0x1c0 net/ipv4/af_inet.c:415
 [&lt;ffffffff851dc5a0&gt;] inet6_release+0x50/0x70 net/ipv6/af_inet6.c:422
 [&lt;ffffffff84c4581d&gt;] sock_release+0x8d/0x1d0 net/socket.c:570
 [&lt;ffffffff84c45976&gt;] sock_close+0x16/0x20 net/socket.c:1017
 [&lt;ffffffff817a108c&gt;] __fput+0x28c/0x780 fs/file_table.c:208
 [&lt;ffffffff817a1605&gt;] ____fput+0x15/0x20 fs/file_table.c:244
 [&lt;ffffffff813774f9&gt;] task_work_run+0xf9/0x170
 [&lt;ffffffff81324aae&gt;] do_exit+0x85e/0x2a00
 [&lt;ffffffff81326dc8&gt;] do_group_exit+0x108/0x330
 [&lt;ffffffff81348cf7&gt;] get_signal+0x617/0x17a0 kernel/signal.c:2307
 [&lt;ffffffff811b49af&gt;] do_signal+0x7f/0x18f0
 [&lt;ffffffff810039bf&gt;] exit_to_usermode_loop+0xbf/0x150 arch/x86/entry/common.c:156
 [&lt;     inline     &gt;] prepare_exit_to_usermode arch/x86/entry/common.c:190
 [&lt;ffffffff81006060&gt;] syscall_return_slowpath+0x1a0/0x1e0 arch/x86/entry/common.c:259
 [&lt;ffffffff85e4d726&gt;] entry_SYSCALL_64_fastpath+0xc4/0xc6
Object at ffff8800081b0ec0, in cache L2TP/IPv6 size: 1448
Allocated:
PID = 10987
 [ 1116.897025] [&lt;ffffffff811ddcb6&gt;] save_stack_trace+0x16/0x20
 [ 1116.897025] [&lt;ffffffff8174c736&gt;] save_stack+0x46/0xd0
 [ 1116.897025] [&lt;ffffffff8174c9ad&gt;] kasan_kmalloc+0xad/0xe0
 [ 1116.897025] [&lt;ffffffff8174cee2&gt;] kasan_slab_alloc+0x12/0x20
 [ 1116.897025] [&lt;     inline     &gt;] slab_post_alloc_hook mm/slab.h:417
 [ 1116.897025] [&lt;     inline     &gt;] slab_alloc_node mm/slub.c:2708
 [ 1116.897025] [&lt;     inline     &gt;] slab_alloc mm/slub.c:2716
 [ 1116.897025] [&lt;ffffffff817476a8&gt;] kmem_cache_alloc+0xc8/0x2b0 mm/slub.c:2721
 [ 1116.897025] [&lt;ffffffff84c4f6a9&gt;] sk_prot_alloc+0x69/0x2b0 net/core/sock.c:1326
 [ 1116.897025] [&lt;ffffffff84c58ac8&gt;] sk_alloc+0x38/0xae0 net/core/sock.c:1388
 [ 1116.897025] [&lt;ffffffff851ddf67&gt;] inet6_create+0x2d7/0x1000 net/ipv6/af_inet6.c:182
 [ 1116.897025] [&lt;ffffffff84c4af7b&gt;] __sock_create+0x37b/0x640 net/socket.c:1153
 [ 1116.897025] [&lt;     inline     &gt;] sock_create net/socket.c:1193
 [ 1116.897025] [&lt;     inline     &gt;] SYSC_socket net/socket.c:1223
 [ 1116.897025] [&lt;ffffffff84c4b46f&gt;] SyS_socket+0xef/0x1b0 net/socket.c:1203
 [ 1116.897025] [&lt;ffffffff85e4d685&gt;] entry_SYSCALL_64_fastpath+0x23/0xc6
Freed:
PID = 10987
 [ 1116.897025] [&lt;ffffffff811ddcb6&gt;] save_stack_trace+0x16/0x20
 [ 1116.897025] [&lt;ffffffff8174c736&gt;] save_stack+0x46/0xd0
 [ 1116.897025] [&lt;ffffffff8174cf61&gt;] kasan_slab_free+0x71/0xb0
 [ 1116.897025] [&lt;     inline     &gt;] slab_free_hook mm/slub.c:1352
 [ 1116.897025] [&lt;     inline     &gt;] slab_free_freelist_hook mm/slub.c:1374
 [ 1116.897025] [&lt;     inline     &gt;] slab_free mm/slub.c:2951
 [ 1116.897025] [&lt;ffffffff81748b28&gt;] kmem_cache_free+0xc8/0x330 mm/slub.c:2973
 [ 1116.897025] [&lt;     inline     &gt;] sk_prot_free net/core/sock.c:1369
 [ 1116.897025] [&lt;ffffffff84c541eb&gt;] __sk_destruct+0x32b/0x4f0 net/core/sock.c:1444
 [ 1116.897025] [&lt;ffffffff84c5aca4&gt;] sk_destruct+0x44/0x80 net/core/sock.c:1452
 [ 1116.897025] [&lt;ffffffff84c5ad33&gt;] __sk_free+0x53/0x220 net/core/sock.c:1460
 [ 1116.897025] [&lt;ffffffff84c5af23&gt;] sk_free+0x23/0x30 net/core/sock.c:1471
 [ 1116.897025] [&lt;ffffffff84c5cb6c&gt;] sk_common_release+0x28c/0x3e0 ./include/net/sock.h:1589
 [ 1116.897025] [&lt;ffffffff8579044e&gt;] l2tp_ip6_close+0x1fe/0x290 net/l2tp/l2tp_ip6.c:243
 [ 1116.897025] [&lt;ffffffff850b2dfd&gt;] inet_release+0xed/0x1c0 net/ipv4/af_inet.c:415
 [ 1116.897025] [&lt;ffffffff851dc5a0&gt;] inet6_release+0x50/0x70 net/ipv6/af_inet6.c:422
 [ 1116.897025] [&lt;ffffffff84c4581d&gt;] sock_release+0x8d/0x1d0 net/socket.c:570
 [ 1116.897025] [&lt;ffffffff84c45976&gt;] sock_close+0x16/0x20 net/socket.c:1017
 [ 1116.897025] [&lt;ffffffff817a108c&gt;] __fput+0x28c/0x780 fs/file_table.c:208
 [ 1116.897025] [&lt;ffffffff817a1605&gt;] ____fput+0x15/0x20 fs/file_table.c:244
 [ 1116.897025] [&lt;ffffffff813774f9&gt;] task_work_run+0xf9/0x170
 [ 1116.897025] [&lt;ffffffff81324aae&gt;] do_exit+0x85e/0x2a00
 [ 1116.897025] [&lt;ffffffff81326dc8&gt;] do_group_exit+0x108/0x330
 [ 1116.897025] [&lt;ffffffff81348cf7&gt;] get_signal+0x617/0x17a0 kernel/signal.c:2307
 [ 1116.897025] [&lt;ffffffff811b49af&gt;] do_signal+0x7f/0x18f0
 [ 1116.897025] [&lt;ffffffff810039bf&gt;] exit_to_usermode_loop+0xbf/0x150 arch/x86/entry/common.c:156
 [ 1116.897025] [&lt;     inline     &gt;] prepare_exit_to_usermode arch/x86/entry/common.c:190
 [ 1116.897025] [&lt;ffffffff81006060&gt;] syscall_return_slowpath+0x1a0/0x1e0 arch/x86/entry/common.c:259
 [ 1116.897025] [&lt;ffffffff85e4d726&gt;] entry_SYSCALL_64_fastpath+0xc4/0xc6
Memory state around the buggy address:
 ffff8800081b0d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8800081b0e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
&gt;ffff8800081b0e80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
                                                    ^
 ffff8800081b0f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8800081b0f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb

==================================================================

The same issue exists with l2tp_ip_bind() and l2tp_ip_bind_table.

Fixes: c51ce49735c1 ("l2tp: fix oops in L2TP IP sockets for connect() AF_UNSPEC case")
Reported-by: Baozeng Ding &lt;sploving1@gmail.com&gt;
Reported-by: Andrey Konovalov &lt;andreyknvl@google.com&gt;
Tested-by: Baozeng Ding &lt;sploving1@gmail.com&gt;
Signed-off-by: Guillaume Nault &lt;g.nault@alphalink.fr&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Amit Pundir &lt;amit.pundir@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 32c231164b762dddefa13af5a0101032c70b50ef upstream.

Lock socket before checking the SOCK_ZAPPED flag in l2tp_ip6_bind().
Without lock, a concurrent call could modify the socket flags between
the sock_flag(sk, SOCK_ZAPPED) test and the lock_sock() call. This way,
a socket could be inserted twice in l2tp_ip6_bind_table. Releasing it
would then leave a stale pointer there, generating use-after-free
errors when walking through the list or modifying adjacent entries.

BUG: KASAN: use-after-free in l2tp_ip6_close+0x22e/0x290 at addr ffff8800081b0ed8
Write of size 8 by task syz-executor/10987
CPU: 0 PID: 10987 Comm: syz-executor Not tainted 4.8.0+ #39
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.8.2-0-g33fbe13 by qemu-project.org 04/01/2014
 ffff880031d97838 ffffffff829f835b ffff88001b5a1640 ffff8800081b0ec0
 ffff8800081b15a0 ffff8800081b6d20 ffff880031d97860 ffffffff8174d3cc
 ffff880031d978f0 ffff8800081b0e80 ffff88001b5a1640 ffff880031d978e0
Call Trace:
 [&lt;ffffffff829f835b&gt;] dump_stack+0xb3/0x118 lib/dump_stack.c:15
 [&lt;ffffffff8174d3cc&gt;] kasan_object_err+0x1c/0x70 mm/kasan/report.c:156
 [&lt;     inline     &gt;] print_address_description mm/kasan/report.c:194
 [&lt;ffffffff8174d666&gt;] kasan_report_error+0x1f6/0x4d0 mm/kasan/report.c:283
 [&lt;     inline     &gt;] kasan_report mm/kasan/report.c:303
 [&lt;ffffffff8174db7e&gt;] __asan_report_store8_noabort+0x3e/0x40 mm/kasan/report.c:329
 [&lt;     inline     &gt;] __write_once_size ./include/linux/compiler.h:249
 [&lt;     inline     &gt;] __hlist_del ./include/linux/list.h:622
 [&lt;     inline     &gt;] hlist_del_init ./include/linux/list.h:637
 [&lt;ffffffff8579047e&gt;] l2tp_ip6_close+0x22e/0x290 net/l2tp/l2tp_ip6.c:239
 [&lt;ffffffff850b2dfd&gt;] inet_release+0xed/0x1c0 net/ipv4/af_inet.c:415
 [&lt;ffffffff851dc5a0&gt;] inet6_release+0x50/0x70 net/ipv6/af_inet6.c:422
 [&lt;ffffffff84c4581d&gt;] sock_release+0x8d/0x1d0 net/socket.c:570
 [&lt;ffffffff84c45976&gt;] sock_close+0x16/0x20 net/socket.c:1017
 [&lt;ffffffff817a108c&gt;] __fput+0x28c/0x780 fs/file_table.c:208
 [&lt;ffffffff817a1605&gt;] ____fput+0x15/0x20 fs/file_table.c:244
 [&lt;ffffffff813774f9&gt;] task_work_run+0xf9/0x170
 [&lt;ffffffff81324aae&gt;] do_exit+0x85e/0x2a00
 [&lt;ffffffff81326dc8&gt;] do_group_exit+0x108/0x330
 [&lt;ffffffff81348cf7&gt;] get_signal+0x617/0x17a0 kernel/signal.c:2307
 [&lt;ffffffff811b49af&gt;] do_signal+0x7f/0x18f0
 [&lt;ffffffff810039bf&gt;] exit_to_usermode_loop+0xbf/0x150 arch/x86/entry/common.c:156
 [&lt;     inline     &gt;] prepare_exit_to_usermode arch/x86/entry/common.c:190
 [&lt;ffffffff81006060&gt;] syscall_return_slowpath+0x1a0/0x1e0 arch/x86/entry/common.c:259
 [&lt;ffffffff85e4d726&gt;] entry_SYSCALL_64_fastpath+0xc4/0xc6
Object at ffff8800081b0ec0, in cache L2TP/IPv6 size: 1448
Allocated:
PID = 10987
 [ 1116.897025] [&lt;ffffffff811ddcb6&gt;] save_stack_trace+0x16/0x20
 [ 1116.897025] [&lt;ffffffff8174c736&gt;] save_stack+0x46/0xd0
 [ 1116.897025] [&lt;ffffffff8174c9ad&gt;] kasan_kmalloc+0xad/0xe0
 [ 1116.897025] [&lt;ffffffff8174cee2&gt;] kasan_slab_alloc+0x12/0x20
 [ 1116.897025] [&lt;     inline     &gt;] slab_post_alloc_hook mm/slab.h:417
 [ 1116.897025] [&lt;     inline     &gt;] slab_alloc_node mm/slub.c:2708
 [ 1116.897025] [&lt;     inline     &gt;] slab_alloc mm/slub.c:2716
 [ 1116.897025] [&lt;ffffffff817476a8&gt;] kmem_cache_alloc+0xc8/0x2b0 mm/slub.c:2721
 [ 1116.897025] [&lt;ffffffff84c4f6a9&gt;] sk_prot_alloc+0x69/0x2b0 net/core/sock.c:1326
 [ 1116.897025] [&lt;ffffffff84c58ac8&gt;] sk_alloc+0x38/0xae0 net/core/sock.c:1388
 [ 1116.897025] [&lt;ffffffff851ddf67&gt;] inet6_create+0x2d7/0x1000 net/ipv6/af_inet6.c:182
 [ 1116.897025] [&lt;ffffffff84c4af7b&gt;] __sock_create+0x37b/0x640 net/socket.c:1153
 [ 1116.897025] [&lt;     inline     &gt;] sock_create net/socket.c:1193
 [ 1116.897025] [&lt;     inline     &gt;] SYSC_socket net/socket.c:1223
 [ 1116.897025] [&lt;ffffffff84c4b46f&gt;] SyS_socket+0xef/0x1b0 net/socket.c:1203
 [ 1116.897025] [&lt;ffffffff85e4d685&gt;] entry_SYSCALL_64_fastpath+0x23/0xc6
Freed:
PID = 10987
 [ 1116.897025] [&lt;ffffffff811ddcb6&gt;] save_stack_trace+0x16/0x20
 [ 1116.897025] [&lt;ffffffff8174c736&gt;] save_stack+0x46/0xd0
 [ 1116.897025] [&lt;ffffffff8174cf61&gt;] kasan_slab_free+0x71/0xb0
 [ 1116.897025] [&lt;     inline     &gt;] slab_free_hook mm/slub.c:1352
 [ 1116.897025] [&lt;     inline     &gt;] slab_free_freelist_hook mm/slub.c:1374
 [ 1116.897025] [&lt;     inline     &gt;] slab_free mm/slub.c:2951
 [ 1116.897025] [&lt;ffffffff81748b28&gt;] kmem_cache_free+0xc8/0x330 mm/slub.c:2973
 [ 1116.897025] [&lt;     inline     &gt;] sk_prot_free net/core/sock.c:1369
 [ 1116.897025] [&lt;ffffffff84c541eb&gt;] __sk_destruct+0x32b/0x4f0 net/core/sock.c:1444
 [ 1116.897025] [&lt;ffffffff84c5aca4&gt;] sk_destruct+0x44/0x80 net/core/sock.c:1452
 [ 1116.897025] [&lt;ffffffff84c5ad33&gt;] __sk_free+0x53/0x220 net/core/sock.c:1460
 [ 1116.897025] [&lt;ffffffff84c5af23&gt;] sk_free+0x23/0x30 net/core/sock.c:1471
 [ 1116.897025] [&lt;ffffffff84c5cb6c&gt;] sk_common_release+0x28c/0x3e0 ./include/net/sock.h:1589
 [ 1116.897025] [&lt;ffffffff8579044e&gt;] l2tp_ip6_close+0x1fe/0x290 net/l2tp/l2tp_ip6.c:243
 [ 1116.897025] [&lt;ffffffff850b2dfd&gt;] inet_release+0xed/0x1c0 net/ipv4/af_inet.c:415
 [ 1116.897025] [&lt;ffffffff851dc5a0&gt;] inet6_release+0x50/0x70 net/ipv6/af_inet6.c:422
 [ 1116.897025] [&lt;ffffffff84c4581d&gt;] sock_release+0x8d/0x1d0 net/socket.c:570
 [ 1116.897025] [&lt;ffffffff84c45976&gt;] sock_close+0x16/0x20 net/socket.c:1017
 [ 1116.897025] [&lt;ffffffff817a108c&gt;] __fput+0x28c/0x780 fs/file_table.c:208
 [ 1116.897025] [&lt;ffffffff817a1605&gt;] ____fput+0x15/0x20 fs/file_table.c:244
 [ 1116.897025] [&lt;ffffffff813774f9&gt;] task_work_run+0xf9/0x170
 [ 1116.897025] [&lt;ffffffff81324aae&gt;] do_exit+0x85e/0x2a00
 [ 1116.897025] [&lt;ffffffff81326dc8&gt;] do_group_exit+0x108/0x330
 [ 1116.897025] [&lt;ffffffff81348cf7&gt;] get_signal+0x617/0x17a0 kernel/signal.c:2307
 [ 1116.897025] [&lt;ffffffff811b49af&gt;] do_signal+0x7f/0x18f0
 [ 1116.897025] [&lt;ffffffff810039bf&gt;] exit_to_usermode_loop+0xbf/0x150 arch/x86/entry/common.c:156
 [ 1116.897025] [&lt;     inline     &gt;] prepare_exit_to_usermode arch/x86/entry/common.c:190
 [ 1116.897025] [&lt;ffffffff81006060&gt;] syscall_return_slowpath+0x1a0/0x1e0 arch/x86/entry/common.c:259
 [ 1116.897025] [&lt;ffffffff85e4d726&gt;] entry_SYSCALL_64_fastpath+0xc4/0xc6
Memory state around the buggy address:
 ffff8800081b0d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8800081b0e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
&gt;ffff8800081b0e80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
                                                    ^
 ffff8800081b0f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8800081b0f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb

==================================================================

The same issue exists with l2tp_ip_bind() and l2tp_ip_bind_table.

Fixes: c51ce49735c1 ("l2tp: fix oops in L2TP IP sockets for connect() AF_UNSPEC case")
Reported-by: Baozeng Ding &lt;sploving1@gmail.com&gt;
Reported-by: Andrey Konovalov &lt;andreyknvl@google.com&gt;
Tested-by: Baozeng Ding &lt;sploving1@gmail.com&gt;
Signed-off-by: Guillaume Nault &lt;g.nault@alphalink.fr&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Amit Pundir &lt;amit.pundir@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>l2tp: purge socket queues in the .destruct() callback</title>
<updated>2017-05-08T05:44:08+00:00</updated>
<author>
<name>Guillaume Nault</name>
<email>g.nault@alphalink.fr</email>
</author>
<published>2017-03-29T06:45:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=1a016806ae83130bdcb29b340075b932ec4c947d'/>
<id>1a016806ae83130bdcb29b340075b932ec4c947d</id>
<content type='text'>
[ Upstream commit e91793bb615cf6cdd59c0b6749fe173687bb0947 ]

The Rx path may grab the socket right before pppol2tp_release(), but
nothing guarantees that it will enqueue packets before
skb_queue_purge(). Therefore, the socket can be destroyed without its
queues fully purged.

Fix this by purging queues in pppol2tp_session_destruct() where we're
guaranteed nothing is still referencing the socket.

Fixes: 9e9cb6221aa7 ("l2tp: fix userspace reception on plain L2TP sockets")
Signed-off-by: Guillaume Nault &lt;g.nault@alphalink.fr&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit e91793bb615cf6cdd59c0b6749fe173687bb0947 ]

The Rx path may grab the socket right before pppol2tp_release(), but
nothing guarantees that it will enqueue packets before
skb_queue_purge(). Therefore, the socket can be destroyed without its
queues fully purged.

Fix this by purging queues in pppol2tp_session_destruct() where we're
guaranteed nothing is still referencing the socket.

Fixes: 9e9cb6221aa7 ("l2tp: fix userspace reception on plain L2TP sockets")
Signed-off-by: Guillaume Nault &lt;g.nault@alphalink.fr&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>l2tp: avoid use-after-free caused by l2tp_ip_backlog_recv</title>
<updated>2017-04-18T05:55:52+00:00</updated>
<author>
<name>Paul Hüber</name>
<email>phueber@kernsp.in</email>
</author>
<published>2017-02-26T16:58:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ca23526b4bb3f71d4ecb8ce1bcb1d97b5e743bdb'/>
<id>ca23526b4bb3f71d4ecb8ce1bcb1d97b5e743bdb</id>
<content type='text'>
commit 51fb60eb162ab84c5edf2ae9c63cf0b878e5547e upstream.

l2tp_ip_backlog_recv may not return -1 if the packet gets dropped.
The return value is passed up to ip_local_deliver_finish, which treats
negative values as an IP protocol number for resubmission.

Signed-off-by: Paul Hüber &lt;phueber@kernsp.in&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 51fb60eb162ab84c5edf2ae9c63cf0b878e5547e upstream.

l2tp_ip_backlog_recv may not return -1 if the packet gets dropped.
The return value is passed up to ip_local_deliver_finish, which treats
negative values as an IP protocol number for resubmission.

Signed-off-by: Paul Hüber &lt;phueber@kernsp.in&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>l2tp: do not use udp_ioctl()</title>
<updated>2017-04-18T05:55:44+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2017-02-10T00:15:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=710e8429721604e89c13498955de50e5a788b349'/>
<id>710e8429721604e89c13498955de50e5a788b349</id>
<content type='text'>
[ Upstream commit 72fb96e7bdbbdd4421b0726992496531060f3636 ]

udp_ioctl(), as its name suggests, is used by UDP protocols,
but is also used by L2TP :(

L2TP should use its own handler, because it really does not
look the same.

SIOCINQ for instance should not assume UDP checksum or headers.

Thanks to Andrey and syzkaller team for providing the report
and a nice reproducer.

While crashes only happen on recent kernels (after commit
7c13f97ffde6 ("udp: do fwd memory scheduling on dequeue")), this
probably needs to be backported to older kernels.

Fixes: 7c13f97ffde6 ("udp: do fwd memory scheduling on dequeue")
Fixes: 85584672012e ("udp: Fix udp_poll() and ioctl()")
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Reported-by: Andrey Konovalov &lt;andreyknvl@google.com&gt;
Acked-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 72fb96e7bdbbdd4421b0726992496531060f3636 ]

udp_ioctl(), as its name suggests, is used by UDP protocols,
but is also used by L2TP :(

L2TP should use its own handler, because it really does not
look the same.

SIOCINQ for instance should not assume UDP checksum or headers.

Thanks to Andrey and syzkaller team for providing the report
and a nice reproducer.

While crashes only happen on recent kernels (after commit
7c13f97ffde6 ("udp: do fwd memory scheduling on dequeue")), this
probably needs to be backported to older kernels.

Fixes: 7c13f97ffde6 ("udp: do fwd memory scheduling on dequeue")
Fixes: 85584672012e ("udp: Fix udp_poll() and ioctl()")
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Reported-by: Andrey Konovalov &lt;andreyknvl@google.com&gt;
Acked-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipv6: l2tp: fix a potential issue in l2tp_ip6_recv</title>
<updated>2016-07-12T12:47:43+00:00</updated>
<author>
<name>Haishuang Yan</name>
<email>yanhaishuang@cmss.chinamobile.com</email>
</author>
<published>2016-04-03T14:09:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6eebc66dba8331624cc45d65af5a7aeffe9319a6'/>
<id>6eebc66dba8331624cc45d65af5a7aeffe9319a6</id>
<content type='text'>
[ Upstream commit be447f305494e019dfc37ea4cdf3b0e4200b4eba ]

pskb_may_pull() can change skb-&gt;data, so we have to load ptr/optr at the
right place.

Signed-off-by: Haishuang Yan &lt;yanhaishuang@cmss.chinamobile.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit be447f305494e019dfc37ea4cdf3b0e4200b4eba ]

pskb_may_pull() can change skb-&gt;data, so we have to load ptr/optr at the
right place.

Signed-off-by: Haishuang Yan &lt;yanhaishuang@cmss.chinamobile.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipv4: l2tp: fix a potential issue in l2tp_ip_recv</title>
<updated>2016-07-12T12:47:42+00:00</updated>
<author>
<name>Haishuang Yan</name>
<email>yanhaishuang@cmss.chinamobile.com</email>
</author>
<published>2016-04-03T14:09:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=1f0b56ff5361768123488667d0051f280dd91b14'/>
<id>1f0b56ff5361768123488667d0051f280dd91b14</id>
<content type='text'>
[ Upstream commit 5745b8232e942abd5e16e85fa9b27cc21324acf0 ]

pskb_may_pull() can change skb-&gt;data, so we have to load ptr/optr at the
right place.

Signed-off-by: Haishuang Yan &lt;yanhaishuang@cmss.chinamobile.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 5745b8232e942abd5e16e85fa9b27cc21324acf0 ]

pskb_may_pull() can change skb-&gt;data, so we have to load ptr/optr at the
right place.

Signed-off-by: Haishuang Yan &lt;yanhaishuang@cmss.chinamobile.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipv6: add complete rcu protection around np-&gt;opt</title>
<updated>2015-12-14T17:19:26+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2015-11-30T03:37:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=46ddb98e2018a5a62cefa75b3c80882850c91e39'/>
<id>46ddb98e2018a5a62cefa75b3c80882850c91e39</id>
<content type='text'>
[ Upstream commit 45f6fad84cc305103b28d73482b344d7f5b76f39 ]

This patch addresses multiple problems :

UDP/RAW sendmsg() need to get a stable struct ipv6_txoptions
while socket is not locked : Other threads can change np-&gt;opt
concurrently. Dmitry posted a syzkaller
(http://github.com/google/syzkaller) program desmonstrating
use-after-free.

Starting with TCP/DCCP lockless listeners, tcp_v6_syn_recv_sock()
and dccp_v6_request_recv_sock() also need to use RCU protection
to dereference np-&gt;opt once (before calling ipv6_dup_options())

This patch adds full RCU protection to np-&gt;opt

Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Acked-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 45f6fad84cc305103b28d73482b344d7f5b76f39 ]

This patch addresses multiple problems :

UDP/RAW sendmsg() need to get a stable struct ipv6_txoptions
while socket is not locked : Other threads can change np-&gt;opt
concurrently. Dmitry posted a syzkaller
(http://github.com/google/syzkaller) program desmonstrating
use-after-free.

Starting with TCP/DCCP lockless listeners, tcp_v6_syn_recv_sock()
and dccp_v6_request_recv_sock() also need to use RCU protection
to dereference np-&gt;opt once (before calling ipv6_dup_options())

This patch adds full RCU protection to np-&gt;opt

Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Acked-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>l2tp: protect tunnel-&gt;del_work by ref_count</title>
<updated>2015-11-13T18:15:37+00:00</updated>
<author>
<name>Alexander Couzens</name>
<email>lynxis@fe80.eu</email>
</author>
<published>2015-09-28T09:32:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=3ebbc131d67cd4b513073c868d953436da430331'/>
<id>3ebbc131d67cd4b513073c868d953436da430331</id>
<content type='text'>
[ Upstream commit 06a15f51cf3618e32a73871ee6a547ef7fd902b5 ]

There is a small chance that tunnel_free() is called before tunnel-&gt;del_work scheduled
resulting in a zero pointer dereference.

Signed-off-by: Alexander Couzens &lt;lynxis@fe80.eu&gt;
Acked-by: James Chapman &lt;jchapman@katalix.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 06a15f51cf3618e32a73871ee6a547ef7fd902b5 ]

There is a small chance that tunnel_free() is called before tunnel-&gt;del_work scheduled
resulting in a zero pointer dereference.

Signed-off-by: Alexander Couzens &lt;lynxis@fe80.eu&gt;
Acked-by: James Chapman &lt;jchapman@katalix.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
