<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/net/l2tp, branch v4.4.97</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:09:03+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=b5f689d94bc3bbcaf25142f43bd31712d10adb44'/>
<id>b5f689d94bc3bbcaf25142f43bd31712d10adb44</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:09:03+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=110cf3dd4bcc0838a86efc9eb86ac31583b4b578'/>
<id>110cf3dd4bcc0838a86efc9eb86ac31583b4b578</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 PPP pseudo-wire auto-loading</title>
<updated>2017-05-03T04:19:52+00:00</updated>
<author>
<name>Guillaume Nault</name>
<email>g.nault@alphalink.fr</email>
</author>
<published>2017-04-03T11:23:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=593e185eaadeefdc05a5e595428aec468646165a'/>
<id>593e185eaadeefdc05a5e595428aec468646165a</id>
<content type='text'>
[ Upstream commit 249ee819e24c180909f43c1173c8ef6724d21faf ]

PPP pseudo-wire type is 7 (11 is L2TP_PWTYPE_IP).

Fixes: f1f39f911027 ("l2tp: auto load type modules")
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 249ee819e24c180909f43c1173c8ef6724d21faf ]

PPP pseudo-wire type is 7 (11 is L2TP_PWTYPE_IP).

Fixes: f1f39f911027 ("l2tp: auto load type modules")
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: take reference on sessions being dumped</title>
<updated>2017-05-03T04:19:52+00:00</updated>
<author>
<name>Guillaume Nault</name>
<email>g.nault@alphalink.fr</email>
</author>
<published>2017-04-03T10:03:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f710dbd92b277232079fc662c1dd8433491b7d6c'/>
<id>f710dbd92b277232079fc662c1dd8433491b7d6c</id>
<content type='text'>
[ Upstream commit e08293a4ccbcc993ded0fdc46f1e57926b833d63 ]

Take a reference on the sessions returned by l2tp_session_find_nth()
(and rename it l2tp_session_get_nth() to reflect this change), so that
caller is assured that the session isn't going to disappear while
processing it.

For procfs and debugfs handlers, the session is held in the .start()
callback and dropped in .show(). Given that pppol2tp_seq_session_show()
dereferences the associated PPPoL2TP socket and that
l2tp_dfs_seq_session_show() might call pppol2tp_show(), we also need to
call the session's .ref() callback to prevent the socket from going
away from under us.

Fixes: fd558d186df2 ("l2tp: Split pppol2tp patch into separate l2tp and ppp parts")
Fixes: 0ad6614048cf ("l2tp: Add debugfs files for dumping l2tp debug info")
Fixes: 309795f4bec2 ("l2tp: Add netlink control API for L2TP")
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 e08293a4ccbcc993ded0fdc46f1e57926b833d63 ]

Take a reference on the sessions returned by l2tp_session_find_nth()
(and rename it l2tp_session_get_nth() to reflect this change), so that
caller is assured that the session isn't going to disappear while
processing it.

For procfs and debugfs handlers, the session is held in the .start()
callback and dropped in .show(). Given that pppol2tp_seq_session_show()
dereferences the associated PPPoL2TP socket and that
l2tp_dfs_seq_session_show() might call pppol2tp_show(), we also need to
call the session's .ref() callback to prevent the socket from going
away from under us.

Fixes: fd558d186df2 ("l2tp: Split pppol2tp patch into separate l2tp and ppp parts")
Fixes: 0ad6614048cf ("l2tp: Add debugfs files for dumping l2tp debug info")
Fixes: 309795f4bec2 ("l2tp: Add netlink control API for L2TP")
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: purge socket queues in the .destruct() callback</title>
<updated>2017-05-03T04:19:51+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=8625dfcfd338254131a7fa650dfbcaf42e4c52ae'/>
<id>8625dfcfd338254131a7fa650dfbcaf42e4c52ae</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-03-22T11:04:14+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=2cd0afc64e333f2ef62444300418883cff0e79da'/>
<id>2cd0afc64e333f2ef62444300418883cff0e79da</id>
<content type='text'>
[ Upstream commit 51fb60eb162ab84c5edf2ae9c63cf0b878e5547e ]

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>
[ Upstream commit 51fb60eb162ab84c5edf2ae9c63cf0b878e5547e ]

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-02-18T15:39:28+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=b9dee56027ae5704e3c4bc243a0a3313ea3814ec'/>
<id>b9dee56027ae5704e3c4bc243a0a3313ea3814ec</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;
</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;
</pre>
</div>
</content>
</entry>
<entry>
<title>l2tp: fix racy SOCK_ZAPPED flag check in l2tp_ip{,6}_bind()</title>
<updated>2016-12-10T18:07:23+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=56366fa0ad46a59abe2460b8acb775f7f84fbf16'/>
<id>56366fa0ad46a59abe2460b8acb775f7f84fbf16</id>
<content type='text'>
[ Upstream commit 32c231164b762dddefa13af5a0101032c70b50ef ]

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: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 32c231164b762dddefa13af5a0101032c70b50ef ]

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: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>l2tp: fix configuration passed to setup_udp_tunnel_sock()</title>
<updated>2016-06-24T17:18:17+00:00</updated>
<author>
<name>Guillaume Nault</name>
<email>g.nault@alphalink.fr</email>
</author>
<published>2016-06-08T10:59:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=05cbd46be7f1aaa355301e2e12c378cbfdeeeb2a'/>
<id>05cbd46be7f1aaa355301e2e12c378cbfdeeeb2a</id>
<content type='text'>
[ Upstream commit a5c5e2da8551eb69e5d5d09d51d526140b5db9fb ]

Unused fields of udp_cfg must be all zeros. Otherwise
setup_udp_tunnel_sock() fills -&gt;gro_receive and -&gt;gro_complete
callbacks with garbage, eventually resulting in panic when used by
udp_gro_receive().

[   72.694123] BUG: unable to handle kernel paging request at ffff880033f87d78
[   72.695518] IP: [&lt;ffff880033f87d78&gt;] 0xffff880033f87d78
[   72.696530] PGD 26e2067 PUD 26e3067 PMD 342ed063 PTE 8000000033f87163
[   72.696530] Oops: 0011 [#1] SMP KASAN
[   72.696530] Modules linked in: l2tp_ppp l2tp_netlink l2tp_core ip6_udp_tunnel udp_tunnel pptp gre pppox ppp_generic slhc crc32c_intel ghash_clmulni_intel jitterentropy_rng sha256_generic hmac drbg ansi_cprng aesni_intel evdev aes_x86_64 ablk_helper cryptd lrw gf128mul glue_helper serio_raw acpi_cpufreq button proc\
essor ext4 crc16 jbd2 mbcache virtio_blk virtio_net virtio_pci virtio_ring virtio
[   72.696530] CPU: 3 PID: 0 Comm: swapper/3 Not tainted 4.7.0-rc1 #1
[   72.696530] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Debian-1.8.2-1 04/01/2014
[   72.696530] task: ffff880035b59700 ti: ffff880035b70000 task.ti: ffff880035b70000
[   72.696530] RIP: 0010:[&lt;ffff880033f87d78&gt;]  [&lt;ffff880033f87d78&gt;] 0xffff880033f87d78
[   72.696530] RSP: 0018:ffff880035f87bc0  EFLAGS: 00010246
[   72.696530] RAX: ffffed000698f996 RBX: ffff88003326b840 RCX: ffffffff814cc823
[   72.696530] RDX: ffff88003326b840 RSI: ffff880033e48038 RDI: ffff880034c7c780
[   72.696530] RBP: ffff880035f87c18 R08: 000000000000a506 R09: 0000000000000000
[   72.696530] R10: ffff880035f87b38 R11: ffff880034b9344d R12: 00000000ebfea715
[   72.696530] R13: 0000000000000000 R14: ffff880034c7c780 R15: 0000000000000000
[   72.696530] FS:  0000000000000000(0000) GS:ffff880035f80000(0000) knlGS:0000000000000000
[   72.696530] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   72.696530] CR2: ffff880033f87d78 CR3: 0000000033c98000 CR4: 00000000000406a0
[   72.696530] Stack:
[   72.696530]  ffffffff814cc834 ffff880034b93468 0000001481416818 ffff88003326b874
[   72.696530]  ffff880034c7ccb0 ffff880033e48038 ffff88003326b840 ffff880034b93462
[   72.696530]  ffff88003326b88a ffff88003326b88c ffff880034b93468 ffff880035f87c70
[   72.696530] Call Trace:
[   72.696530]  &lt;IRQ&gt;
[   72.696530]  [&lt;ffffffff814cc834&gt;] ? udp_gro_receive+0x1c6/0x1f9
[   72.696530]  [&lt;ffffffff814ccb1c&gt;] udp4_gro_receive+0x2b5/0x310
[   72.696530]  [&lt;ffffffff814d989b&gt;] inet_gro_receive+0x4a3/0x4cd
[   72.696530]  [&lt;ffffffff81431b32&gt;] dev_gro_receive+0x584/0x7a3
[   72.696530]  [&lt;ffffffff810adf7a&gt;] ? __lock_is_held+0x29/0x64
[   72.696530]  [&lt;ffffffff814321f7&gt;] napi_gro_receive+0x124/0x21d
[   72.696530]  [&lt;ffffffffa000b145&gt;] virtnet_receive+0x8df/0x8f6 [virtio_net]
[   72.696530]  [&lt;ffffffffa000b27e&gt;] virtnet_poll+0x1d/0x8d [virtio_net]
[   72.696530]  [&lt;ffffffff81431350&gt;] net_rx_action+0x15b/0x3b9
[   72.696530]  [&lt;ffffffff815893d6&gt;] __do_softirq+0x216/0x546
[   72.696530]  [&lt;ffffffff81062392&gt;] irq_exit+0x49/0xb6
[   72.696530]  [&lt;ffffffff81588e9a&gt;] do_IRQ+0xe2/0xfa
[   72.696530]  [&lt;ffffffff81587a49&gt;] common_interrupt+0x89/0x89
[   72.696530]  &lt;EOI&gt;
[   72.696530]  [&lt;ffffffff810b05df&gt;] ? trace_hardirqs_on_caller+0x229/0x270
[   72.696530]  [&lt;ffffffff8102b3c7&gt;] ? default_idle+0x1c/0x2d
[   72.696530]  [&lt;ffffffff8102b3c5&gt;] ? default_idle+0x1a/0x2d
[   72.696530]  [&lt;ffffffff8102bb8c&gt;] arch_cpu_idle+0xa/0xc
[   72.696530]  [&lt;ffffffff810a6c39&gt;] default_idle_call+0x1a/0x1c
[   72.696530]  [&lt;ffffffff810a6d96&gt;] cpu_startup_entry+0x15b/0x20f
[   72.696530]  [&lt;ffffffff81039a81&gt;] start_secondary+0x12c/0x133
[   72.696530] Code: ff ff ff ff ff ff ff ff ff ff 7f ff ff ff ff ff ff ff 7f 00 7e f8 33 00 88 ff ff 6d 61 58 81 ff ff ff ff 5e de 0a 81 ff ff ff ff &lt;00&gt; 5c e2 34 00 88 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00
[   72.696530] RIP  [&lt;ffff880033f87d78&gt;] 0xffff880033f87d78
[   72.696530]  RSP &lt;ffff880035f87bc0&gt;
[   72.696530] CR2: ffff880033f87d78
[   72.696530] ---[ end trace ad7758b9a1dccf99 ]---
[   72.696530] Kernel panic - not syncing: Fatal exception in interrupt
[   72.696530] Kernel Offset: disabled
[   72.696530] ---[ end Kernel panic - not syncing: Fatal exception in interrupt

v2: use empty initialiser instead of "{ NULL }" to avoid relying on
    first field's type.

Fixes: 38fd2af24fcf ("udp: Add socket based GRO and config")
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 a5c5e2da8551eb69e5d5d09d51d526140b5db9fb ]

Unused fields of udp_cfg must be all zeros. Otherwise
setup_udp_tunnel_sock() fills -&gt;gro_receive and -&gt;gro_complete
callbacks with garbage, eventually resulting in panic when used by
udp_gro_receive().

[   72.694123] BUG: unable to handle kernel paging request at ffff880033f87d78
[   72.695518] IP: [&lt;ffff880033f87d78&gt;] 0xffff880033f87d78
[   72.696530] PGD 26e2067 PUD 26e3067 PMD 342ed063 PTE 8000000033f87163
[   72.696530] Oops: 0011 [#1] SMP KASAN
[   72.696530] Modules linked in: l2tp_ppp l2tp_netlink l2tp_core ip6_udp_tunnel udp_tunnel pptp gre pppox ppp_generic slhc crc32c_intel ghash_clmulni_intel jitterentropy_rng sha256_generic hmac drbg ansi_cprng aesni_intel evdev aes_x86_64 ablk_helper cryptd lrw gf128mul glue_helper serio_raw acpi_cpufreq button proc\
essor ext4 crc16 jbd2 mbcache virtio_blk virtio_net virtio_pci virtio_ring virtio
[   72.696530] CPU: 3 PID: 0 Comm: swapper/3 Not tainted 4.7.0-rc1 #1
[   72.696530] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Debian-1.8.2-1 04/01/2014
[   72.696530] task: ffff880035b59700 ti: ffff880035b70000 task.ti: ffff880035b70000
[   72.696530] RIP: 0010:[&lt;ffff880033f87d78&gt;]  [&lt;ffff880033f87d78&gt;] 0xffff880033f87d78
[   72.696530] RSP: 0018:ffff880035f87bc0  EFLAGS: 00010246
[   72.696530] RAX: ffffed000698f996 RBX: ffff88003326b840 RCX: ffffffff814cc823
[   72.696530] RDX: ffff88003326b840 RSI: ffff880033e48038 RDI: ffff880034c7c780
[   72.696530] RBP: ffff880035f87c18 R08: 000000000000a506 R09: 0000000000000000
[   72.696530] R10: ffff880035f87b38 R11: ffff880034b9344d R12: 00000000ebfea715
[   72.696530] R13: 0000000000000000 R14: ffff880034c7c780 R15: 0000000000000000
[   72.696530] FS:  0000000000000000(0000) GS:ffff880035f80000(0000) knlGS:0000000000000000
[   72.696530] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   72.696530] CR2: ffff880033f87d78 CR3: 0000000033c98000 CR4: 00000000000406a0
[   72.696530] Stack:
[   72.696530]  ffffffff814cc834 ffff880034b93468 0000001481416818 ffff88003326b874
[   72.696530]  ffff880034c7ccb0 ffff880033e48038 ffff88003326b840 ffff880034b93462
[   72.696530]  ffff88003326b88a ffff88003326b88c ffff880034b93468 ffff880035f87c70
[   72.696530] Call Trace:
[   72.696530]  &lt;IRQ&gt;
[   72.696530]  [&lt;ffffffff814cc834&gt;] ? udp_gro_receive+0x1c6/0x1f9
[   72.696530]  [&lt;ffffffff814ccb1c&gt;] udp4_gro_receive+0x2b5/0x310
[   72.696530]  [&lt;ffffffff814d989b&gt;] inet_gro_receive+0x4a3/0x4cd
[   72.696530]  [&lt;ffffffff81431b32&gt;] dev_gro_receive+0x584/0x7a3
[   72.696530]  [&lt;ffffffff810adf7a&gt;] ? __lock_is_held+0x29/0x64
[   72.696530]  [&lt;ffffffff814321f7&gt;] napi_gro_receive+0x124/0x21d
[   72.696530]  [&lt;ffffffffa000b145&gt;] virtnet_receive+0x8df/0x8f6 [virtio_net]
[   72.696530]  [&lt;ffffffffa000b27e&gt;] virtnet_poll+0x1d/0x8d [virtio_net]
[   72.696530]  [&lt;ffffffff81431350&gt;] net_rx_action+0x15b/0x3b9
[   72.696530]  [&lt;ffffffff815893d6&gt;] __do_softirq+0x216/0x546
[   72.696530]  [&lt;ffffffff81062392&gt;] irq_exit+0x49/0xb6
[   72.696530]  [&lt;ffffffff81588e9a&gt;] do_IRQ+0xe2/0xfa
[   72.696530]  [&lt;ffffffff81587a49&gt;] common_interrupt+0x89/0x89
[   72.696530]  &lt;EOI&gt;
[   72.696530]  [&lt;ffffffff810b05df&gt;] ? trace_hardirqs_on_caller+0x229/0x270
[   72.696530]  [&lt;ffffffff8102b3c7&gt;] ? default_idle+0x1c/0x2d
[   72.696530]  [&lt;ffffffff8102b3c5&gt;] ? default_idle+0x1a/0x2d
[   72.696530]  [&lt;ffffffff8102bb8c&gt;] arch_cpu_idle+0xa/0xc
[   72.696530]  [&lt;ffffffff810a6c39&gt;] default_idle_call+0x1a/0x1c
[   72.696530]  [&lt;ffffffff810a6d96&gt;] cpu_startup_entry+0x15b/0x20f
[   72.696530]  [&lt;ffffffff81039a81&gt;] start_secondary+0x12c/0x133
[   72.696530] Code: ff ff ff ff ff ff ff ff ff ff 7f ff ff ff ff ff ff ff 7f 00 7e f8 33 00 88 ff ff 6d 61 58 81 ff ff ff ff 5e de 0a 81 ff ff ff ff &lt;00&gt; 5c e2 34 00 88 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00
[   72.696530] RIP  [&lt;ffff880033f87d78&gt;] 0xffff880033f87d78
[   72.696530]  RSP &lt;ffff880035f87bc0&gt;
[   72.696530] CR2: ffff880033f87d78
[   72.696530] ---[ end trace ad7758b9a1dccf99 ]---
[   72.696530] Kernel panic - not syncing: Fatal exception in interrupt
[   72.696530] Kernel Offset: disabled
[   72.696530] ---[ end Kernel panic - not syncing: Fatal exception in interrupt

v2: use empty initialiser instead of "{ NULL }" to avoid relying on
    first field's type.

Fixes: 38fd2af24fcf ("udp: Add socket based GRO and config")
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>ipv6: l2tp: fix a potential issue in l2tp_ip6_recv</title>
<updated>2016-04-20T06:42:06+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=9bd8af9979f543fb605fbfb79e0e8ceeffb88c9c'/>
<id>9bd8af9979f543fb605fbfb79e0e8ceeffb88c9c</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: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&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: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
