<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/net/openvswitch, branch v5.4.3</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>openvswitch: remove another BUG_ON()</title>
<updated>2019-12-04T21:30:58+00:00</updated>
<author>
<name>Paolo Abeni</name>
<email>pabeni@redhat.com</email>
</author>
<published>2019-12-01T17:41:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ab46fb3ef68efeab4c1432d2696238ca74bf72be'/>
<id>ab46fb3ef68efeab4c1432d2696238ca74bf72be</id>
<content type='text'>
[ Upstream commit 8a574f86652a4540a2433946ba826ccb87f398cc ]

If we can't build the flow del notification, we can simply delete
the flow, no need to crash the kernel. Still keep a WARN_ON to
preserve debuggability.

Note: the BUG_ON() predates the Fixes tag, but this change
can be applied only after the mentioned commit.

v1 -&gt; v2:
 - do not leak an skb on error

Fixes: aed067783e50 ("openvswitch: Minimize ovs_flow_cmd_del critical section.")
Signed-off-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 8a574f86652a4540a2433946ba826ccb87f398cc ]

If we can't build the flow del notification, we can simply delete
the flow, no need to crash the kernel. Still keep a WARN_ON to
preserve debuggability.

Note: the BUG_ON() predates the Fixes tag, but this change
can be applied only after the mentioned commit.

v1 -&gt; v2:
 - do not leak an skb on error

Fixes: aed067783e50 ("openvswitch: Minimize ovs_flow_cmd_del critical section.")
Signed-off-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>openvswitch: drop unneeded BUG_ON() in ovs_flow_cmd_build_info()</title>
<updated>2019-12-04T21:30:58+00:00</updated>
<author>
<name>Paolo Abeni</name>
<email>pabeni@redhat.com</email>
</author>
<published>2019-12-01T17:41:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=910d9e8839dc93ed3afe46642ad3874d3057102b'/>
<id>910d9e8839dc93ed3afe46642ad3874d3057102b</id>
<content type='text'>
[ Upstream commit 8ffeb03fbba3b599690b361467bfd2373e8c450f ]

All the callers of ovs_flow_cmd_build_info() already deal with
error return code correctly, so we can handle the error condition
in a more gracefull way. Still dump a warning to preserve
debuggability.

v1 -&gt; v2:
 - clarify the commit message
 - clean the skb and report the error (DaveM)

Fixes: ccb1352e76cf ("net: Add Open vSwitch kernel components.")
Signed-off-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 8ffeb03fbba3b599690b361467bfd2373e8c450f ]

All the callers of ovs_flow_cmd_build_info() already deal with
error return code correctly, so we can handle the error condition
in a more gracefull way. Still dump a warning to preserve
debuggability.

v1 -&gt; v2:
 - clarify the commit message
 - clean the skb and report the error (DaveM)

Fixes: ccb1352e76cf ("net: Add Open vSwitch kernel components.")
Signed-off-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>openvswitch: fix flow command message size</title>
<updated>2019-12-04T21:30:55+00:00</updated>
<author>
<name>Paolo Abeni</name>
<email>pabeni@redhat.com</email>
</author>
<published>2019-11-26T11:55:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8109f5b67aa3ae3310196318a1d395c09dd1a4c5'/>
<id>8109f5b67aa3ae3310196318a1d395c09dd1a4c5</id>
<content type='text'>
[ Upstream commit 4e81c0b3fa93d07653e2415fa71656b080a112fd ]

When user-space sets the OVS_UFID_F_OMIT_* flags, and the relevant
flow has no UFID, we can exceed the computed size, as
ovs_nla_put_identifier() will always dump an OVS_FLOW_ATTR_KEY
attribute.
Take the above in account when computing the flow command message
size.

Fixes: 74ed7ab9264c ("openvswitch: Add support for unique flow IDs.")
Reported-by: Qi Jun Ding &lt;qding@redhat.com&gt;
Signed-off-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 4e81c0b3fa93d07653e2415fa71656b080a112fd ]

When user-space sets the OVS_UFID_F_OMIT_* flags, and the relevant
flow has no UFID, we can exceed the computed size, as
ovs_nla_put_identifier() will always dump an OVS_FLOW_ATTR_KEY
attribute.
Take the above in account when computing the flow command message
size.

Fixes: 74ed7ab9264c ("openvswitch: Add support for unique flow IDs.")
Reported-by: Qi Jun Ding &lt;qding@redhat.com&gt;
Signed-off-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>netns: fix GFP flags in rtnl_net_notifyid()</title>
<updated>2019-10-26T03:14:42+00:00</updated>
<author>
<name>Guillaume Nault</name>
<email>gnault@redhat.com</email>
</author>
<published>2019-10-23T16:39:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d4e4fdf9e4a27c87edb79b1478955075be141f67'/>
<id>d4e4fdf9e4a27c87edb79b1478955075be141f67</id>
<content type='text'>
In rtnl_net_notifyid(), we certainly can't pass a null GFP flag to
rtnl_notify(). A GFP_KERNEL flag would be fine in most circumstances,
but there are a few paths calling rtnl_net_notifyid() from atomic
context or from RCU critical sections. The later also precludes the use
of gfp_any() as it wouldn't detect the RCU case. Also, the nlmsg_new()
call is wrong too, as it uses GFP_KERNEL unconditionally.

Therefore, we need to pass the GFP flags as parameter and propagate it
through function calls until the proper flags can be determined.

In most cases, GFP_KERNEL is fine. The exceptions are:
  * openvswitch: ovs_vport_cmd_get() and ovs_vport_cmd_dump()
    indirectly call rtnl_net_notifyid() from RCU critical section,

  * rtnetlink: rtmsg_ifinfo_build_skb() already receives GFP flags as
    parameter.

Also, in ovs_vport_cmd_build_info(), let's change the GFP flags used
by nlmsg_new(). The function is allowed to sleep, so better make the
flags consistent with the ones used in the following
ovs_vport_cmd_fill_info() call.

Found by code inspection.

Fixes: 9a9634545c70 ("netns: notify netns id events")
Signed-off-by: Guillaume Nault &lt;gnault@redhat.com&gt;
Acked-by: Nicolas Dichtel &lt;nicolas.dichtel@6wind.com&gt;
Acked-by: Pravin B Shelar &lt;pshelar@ovn.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In rtnl_net_notifyid(), we certainly can't pass a null GFP flag to
rtnl_notify(). A GFP_KERNEL flag would be fine in most circumstances,
but there are a few paths calling rtnl_net_notifyid() from atomic
context or from RCU critical sections. The later also precludes the use
of gfp_any() as it wouldn't detect the RCU case. Also, the nlmsg_new()
call is wrong too, as it uses GFP_KERNEL unconditionally.

Therefore, we need to pass the GFP flags as parameter and propagate it
through function calls until the proper flags can be determined.

In most cases, GFP_KERNEL is fine. The exceptions are:
  * openvswitch: ovs_vport_cmd_get() and ovs_vport_cmd_dump()
    indirectly call rtnl_net_notifyid() from RCU critical section,

  * rtnetlink: rtmsg_ifinfo_build_skb() already receives GFP flags as
    parameter.

Also, in ovs_vport_cmd_build_info(), let's change the GFP flags used
by nlmsg_new(). The function is allowed to sleep, so better make the
flags consistent with the ones used in the following
ovs_vport_cmd_fill_info() call.

Found by code inspection.

Fixes: 9a9634545c70 ("netns: notify netns id events")
Signed-off-by: Guillaume Nault &lt;gnault@redhat.com&gt;
Acked-by: Nicolas Dichtel &lt;nicolas.dichtel@6wind.com&gt;
Acked-by: Pravin B Shelar &lt;pshelar@ovn.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: openvswitch: free vport unless register_netdevice() succeeds</title>
<updated>2019-10-22T21:45:08+00:00</updated>
<author>
<name>Hillf Danton</name>
<email>hdanton@sina.com</email>
</author>
<published>2019-10-21T10:01:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=9464cc37f3671ee69cb1c00662b5e1f113a96b23'/>
<id>9464cc37f3671ee69cb1c00662b5e1f113a96b23</id>
<content type='text'>
syzbot found the following crash on:

HEAD commit:    1e78030e Merge tag 'mmc-v5.3-rc1' of git://git.kernel.org/..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=148d3d1a600000
kernel config:  https://syzkaller.appspot.com/x/.config?x=30cef20daf3e9977
dashboard link: https://syzkaller.appspot.com/bug?extid=13210896153522fe1ee5
compiler:       gcc (GCC) 9.0.0 20181231 (experimental)
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=136aa8c4600000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=109ba792600000

=====================================================================
BUG: memory leak
unreferenced object 0xffff8881207e4100 (size 128):
   comm "syz-executor032", pid 7014, jiffies 4294944027 (age 13.830s)
   hex dump (first 32 bytes):
     00 70 16 18 81 88 ff ff 80 af 8c 22 81 88 ff ff  .p........."....
     00 b6 23 17 81 88 ff ff 00 00 00 00 00 00 00 00  ..#.............
   backtrace:
     [&lt;000000000eb78212&gt;] kmemleak_alloc_recursive  include/linux/kmemleak.h:43 [inline]
     [&lt;000000000eb78212&gt;] slab_post_alloc_hook mm/slab.h:522 [inline]
     [&lt;000000000eb78212&gt;] slab_alloc mm/slab.c:3319 [inline]
     [&lt;000000000eb78212&gt;] kmem_cache_alloc_trace+0x145/0x2c0 mm/slab.c:3548
     [&lt;00000000006ea6c6&gt;] kmalloc include/linux/slab.h:552 [inline]
     [&lt;00000000006ea6c6&gt;] kzalloc include/linux/slab.h:748 [inline]
     [&lt;00000000006ea6c6&gt;] ovs_vport_alloc+0x37/0xf0  net/openvswitch/vport.c:130
     [&lt;00000000f9a04a7d&gt;] internal_dev_create+0x24/0x1d0  net/openvswitch/vport-internal_dev.c:164
     [&lt;0000000056ee7c13&gt;] ovs_vport_add+0x81/0x190  net/openvswitch/vport.c:199
     [&lt;000000005434efc7&gt;] new_vport+0x19/0x80 net/openvswitch/datapath.c:194
     [&lt;00000000b7b253f1&gt;] ovs_dp_cmd_new+0x22f/0x410  net/openvswitch/datapath.c:1614
     [&lt;00000000e0988518&gt;] genl_family_rcv_msg+0x2ab/0x5b0  net/netlink/genetlink.c:629
     [&lt;00000000d0cc9347&gt;] genl_rcv_msg+0x54/0x9c net/netlink/genetlink.c:654
     [&lt;000000006694b647&gt;] netlink_rcv_skb+0x61/0x170  net/netlink/af_netlink.c:2477
     [&lt;0000000088381f37&gt;] genl_rcv+0x29/0x40 net/netlink/genetlink.c:665
     [&lt;00000000dad42a47&gt;] netlink_unicast_kernel  net/netlink/af_netlink.c:1302 [inline]
     [&lt;00000000dad42a47&gt;] netlink_unicast+0x1ec/0x2d0  net/netlink/af_netlink.c:1328
     [&lt;0000000067e6b079&gt;] netlink_sendmsg+0x270/0x480  net/netlink/af_netlink.c:1917
     [&lt;00000000aab08a47&gt;] sock_sendmsg_nosec net/socket.c:637 [inline]
     [&lt;00000000aab08a47&gt;] sock_sendmsg+0x54/0x70 net/socket.c:657
     [&lt;000000004cb7c11d&gt;] ___sys_sendmsg+0x393/0x3c0 net/socket.c:2311
     [&lt;00000000c4901c63&gt;] __sys_sendmsg+0x80/0xf0 net/socket.c:2356
     [&lt;00000000c10abb2d&gt;] __do_sys_sendmsg net/socket.c:2365 [inline]
     [&lt;00000000c10abb2d&gt;] __se_sys_sendmsg net/socket.c:2363 [inline]
     [&lt;00000000c10abb2d&gt;] __x64_sys_sendmsg+0x23/0x30 net/socket.c:2363

BUG: memory leak
unreferenced object 0xffff88811723b600 (size 64):
   comm "syz-executor032", pid 7014, jiffies 4294944027 (age 13.830s)
   hex dump (first 32 bytes):
     01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00  ................
     00 00 00 00 00 00 00 00 02 00 00 00 05 35 82 c1  .............5..
   backtrace:
     [&lt;00000000352f46d8&gt;] kmemleak_alloc_recursive  include/linux/kmemleak.h:43 [inline]
     [&lt;00000000352f46d8&gt;] slab_post_alloc_hook mm/slab.h:522 [inline]
     [&lt;00000000352f46d8&gt;] slab_alloc mm/slab.c:3319 [inline]
     [&lt;00000000352f46d8&gt;] __do_kmalloc mm/slab.c:3653 [inline]
     [&lt;00000000352f46d8&gt;] __kmalloc+0x169/0x300 mm/slab.c:3664
     [&lt;000000008e48f3d1&gt;] kmalloc include/linux/slab.h:557 [inline]
     [&lt;000000008e48f3d1&gt;] ovs_vport_set_upcall_portids+0x54/0xd0  net/openvswitch/vport.c:343
     [&lt;00000000541e4f4a&gt;] ovs_vport_alloc+0x7f/0xf0  net/openvswitch/vport.c:139
     [&lt;00000000f9a04a7d&gt;] internal_dev_create+0x24/0x1d0  net/openvswitch/vport-internal_dev.c:164
     [&lt;0000000056ee7c13&gt;] ovs_vport_add+0x81/0x190  net/openvswitch/vport.c:199
     [&lt;000000005434efc7&gt;] new_vport+0x19/0x80 net/openvswitch/datapath.c:194
     [&lt;00000000b7b253f1&gt;] ovs_dp_cmd_new+0x22f/0x410  net/openvswitch/datapath.c:1614
     [&lt;00000000e0988518&gt;] genl_family_rcv_msg+0x2ab/0x5b0  net/netlink/genetlink.c:629
     [&lt;00000000d0cc9347&gt;] genl_rcv_msg+0x54/0x9c net/netlink/genetlink.c:654
     [&lt;000000006694b647&gt;] netlink_rcv_skb+0x61/0x170  net/netlink/af_netlink.c:2477
     [&lt;0000000088381f37&gt;] genl_rcv+0x29/0x40 net/netlink/genetlink.c:665
     [&lt;00000000dad42a47&gt;] netlink_unicast_kernel  net/netlink/af_netlink.c:1302 [inline]
     [&lt;00000000dad42a47&gt;] netlink_unicast+0x1ec/0x2d0  net/netlink/af_netlink.c:1328
     [&lt;0000000067e6b079&gt;] netlink_sendmsg+0x270/0x480  net/netlink/af_netlink.c:1917
     [&lt;00000000aab08a47&gt;] sock_sendmsg_nosec net/socket.c:637 [inline]
     [&lt;00000000aab08a47&gt;] sock_sendmsg+0x54/0x70 net/socket.c:657
     [&lt;000000004cb7c11d&gt;] ___sys_sendmsg+0x393/0x3c0 net/socket.c:2311
     [&lt;00000000c4901c63&gt;] __sys_sendmsg+0x80/0xf0 net/socket.c:2356

BUG: memory leak
unreferenced object 0xffff8881228ca500 (size 128):
   comm "syz-executor032", pid 7015, jiffies 4294944622 (age 7.880s)
   hex dump (first 32 bytes):
     00 f0 27 18 81 88 ff ff 80 ac 8c 22 81 88 ff ff  ..'........"....
     40 b7 23 17 81 88 ff ff 00 00 00 00 00 00 00 00  @.#.............
   backtrace:
     [&lt;000000000eb78212&gt;] kmemleak_alloc_recursive  include/linux/kmemleak.h:43 [inline]
     [&lt;000000000eb78212&gt;] slab_post_alloc_hook mm/slab.h:522 [inline]
     [&lt;000000000eb78212&gt;] slab_alloc mm/slab.c:3319 [inline]
     [&lt;000000000eb78212&gt;] kmem_cache_alloc_trace+0x145/0x2c0 mm/slab.c:3548
     [&lt;00000000006ea6c6&gt;] kmalloc include/linux/slab.h:552 [inline]
     [&lt;00000000006ea6c6&gt;] kzalloc include/linux/slab.h:748 [inline]
     [&lt;00000000006ea6c6&gt;] ovs_vport_alloc+0x37/0xf0  net/openvswitch/vport.c:130
     [&lt;00000000f9a04a7d&gt;] internal_dev_create+0x24/0x1d0  net/openvswitch/vport-internal_dev.c:164
     [&lt;0000000056ee7c13&gt;] ovs_vport_add+0x81/0x190  net/openvswitch/vport.c:199
     [&lt;000000005434efc7&gt;] new_vport+0x19/0x80 net/openvswitch/datapath.c:194
     [&lt;00000000b7b253f1&gt;] ovs_dp_cmd_new+0x22f/0x410  net/openvswitch/datapath.c:1614
     [&lt;00000000e0988518&gt;] genl_family_rcv_msg+0x2ab/0x5b0  net/netlink/genetlink.c:629
     [&lt;00000000d0cc9347&gt;] genl_rcv_msg+0x54/0x9c net/netlink/genetlink.c:654
     [&lt;000000006694b647&gt;] netlink_rcv_skb+0x61/0x170  net/netlink/af_netlink.c:2477
     [&lt;0000000088381f37&gt;] genl_rcv+0x29/0x40 net/netlink/genetlink.c:665
     [&lt;00000000dad42a47&gt;] netlink_unicast_kernel  net/netlink/af_netlink.c:1302 [inline]
     [&lt;00000000dad42a47&gt;] netlink_unicast+0x1ec/0x2d0  net/netlink/af_netlink.c:1328
     [&lt;0000000067e6b079&gt;] netlink_sendmsg+0x270/0x480  net/netlink/af_netlink.c:1917
     [&lt;00000000aab08a47&gt;] sock_sendmsg_nosec net/socket.c:637 [inline]
     [&lt;00000000aab08a47&gt;] sock_sendmsg+0x54/0x70 net/socket.c:657
     [&lt;000000004cb7c11d&gt;] ___sys_sendmsg+0x393/0x3c0 net/socket.c:2311
     [&lt;00000000c4901c63&gt;] __sys_sendmsg+0x80/0xf0 net/socket.c:2356
     [&lt;00000000c10abb2d&gt;] __do_sys_sendmsg net/socket.c:2365 [inline]
     [&lt;00000000c10abb2d&gt;] __se_sys_sendmsg net/socket.c:2363 [inline]
     [&lt;00000000c10abb2d&gt;] __x64_sys_sendmsg+0x23/0x30 net/socket.c:2363
=====================================================================

The function in net core, register_netdevice(), may fail with vport's
destruction callback either invoked or not. After commit 309b66970ee2
("net: openvswitch: do not free vport if register_netdevice() is failed."),
the duty to destroy vport is offloaded from the driver OTOH, which ends
up in the memory leak reported.

It is fixed by releasing vport unless device is registered successfully.
To do that, the callback assignment is defered until device is registered.

Reported-by: syzbot+13210896153522fe1ee5@syzkaller.appspotmail.com
Fixes: 309b66970ee2 ("net: openvswitch: do not free vport if register_netdevice() is failed.")
Cc: Taehee Yoo &lt;ap420073@gmail.com&gt;
Cc: Greg Rose &lt;gvrose8192@gmail.com&gt;
Cc: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Cc: Marcelo Ricardo Leitner &lt;marcelo.leitner@gmail.com&gt;
Cc: Ying Xue &lt;ying.xue@windriver.com&gt;
Cc: Andrey Konovalov &lt;andreyknvl@google.com&gt;
Signed-off-by: Hillf Danton &lt;hdanton@sina.com&gt;
Acked-by: Pravin B Shelar &lt;pshelar@ovn.org&gt;
[sbrivio: this was sent to dev@openvswitch.org and never made its way
 to netdev -- resending original patch]
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
Reviewed-by: Greg Rose &lt;gvrose8192@gmail.com&gt;
Signed-off-by: Jakub Kicinski &lt;jakub.kicinski@netronome.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
syzbot found the following crash on:

HEAD commit:    1e78030e Merge tag 'mmc-v5.3-rc1' of git://git.kernel.org/..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=148d3d1a600000
kernel config:  https://syzkaller.appspot.com/x/.config?x=30cef20daf3e9977
dashboard link: https://syzkaller.appspot.com/bug?extid=13210896153522fe1ee5
compiler:       gcc (GCC) 9.0.0 20181231 (experimental)
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=136aa8c4600000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=109ba792600000

=====================================================================
BUG: memory leak
unreferenced object 0xffff8881207e4100 (size 128):
   comm "syz-executor032", pid 7014, jiffies 4294944027 (age 13.830s)
   hex dump (first 32 bytes):
     00 70 16 18 81 88 ff ff 80 af 8c 22 81 88 ff ff  .p........."....
     00 b6 23 17 81 88 ff ff 00 00 00 00 00 00 00 00  ..#.............
   backtrace:
     [&lt;000000000eb78212&gt;] kmemleak_alloc_recursive  include/linux/kmemleak.h:43 [inline]
     [&lt;000000000eb78212&gt;] slab_post_alloc_hook mm/slab.h:522 [inline]
     [&lt;000000000eb78212&gt;] slab_alloc mm/slab.c:3319 [inline]
     [&lt;000000000eb78212&gt;] kmem_cache_alloc_trace+0x145/0x2c0 mm/slab.c:3548
     [&lt;00000000006ea6c6&gt;] kmalloc include/linux/slab.h:552 [inline]
     [&lt;00000000006ea6c6&gt;] kzalloc include/linux/slab.h:748 [inline]
     [&lt;00000000006ea6c6&gt;] ovs_vport_alloc+0x37/0xf0  net/openvswitch/vport.c:130
     [&lt;00000000f9a04a7d&gt;] internal_dev_create+0x24/0x1d0  net/openvswitch/vport-internal_dev.c:164
     [&lt;0000000056ee7c13&gt;] ovs_vport_add+0x81/0x190  net/openvswitch/vport.c:199
     [&lt;000000005434efc7&gt;] new_vport+0x19/0x80 net/openvswitch/datapath.c:194
     [&lt;00000000b7b253f1&gt;] ovs_dp_cmd_new+0x22f/0x410  net/openvswitch/datapath.c:1614
     [&lt;00000000e0988518&gt;] genl_family_rcv_msg+0x2ab/0x5b0  net/netlink/genetlink.c:629
     [&lt;00000000d0cc9347&gt;] genl_rcv_msg+0x54/0x9c net/netlink/genetlink.c:654
     [&lt;000000006694b647&gt;] netlink_rcv_skb+0x61/0x170  net/netlink/af_netlink.c:2477
     [&lt;0000000088381f37&gt;] genl_rcv+0x29/0x40 net/netlink/genetlink.c:665
     [&lt;00000000dad42a47&gt;] netlink_unicast_kernel  net/netlink/af_netlink.c:1302 [inline]
     [&lt;00000000dad42a47&gt;] netlink_unicast+0x1ec/0x2d0  net/netlink/af_netlink.c:1328
     [&lt;0000000067e6b079&gt;] netlink_sendmsg+0x270/0x480  net/netlink/af_netlink.c:1917
     [&lt;00000000aab08a47&gt;] sock_sendmsg_nosec net/socket.c:637 [inline]
     [&lt;00000000aab08a47&gt;] sock_sendmsg+0x54/0x70 net/socket.c:657
     [&lt;000000004cb7c11d&gt;] ___sys_sendmsg+0x393/0x3c0 net/socket.c:2311
     [&lt;00000000c4901c63&gt;] __sys_sendmsg+0x80/0xf0 net/socket.c:2356
     [&lt;00000000c10abb2d&gt;] __do_sys_sendmsg net/socket.c:2365 [inline]
     [&lt;00000000c10abb2d&gt;] __se_sys_sendmsg net/socket.c:2363 [inline]
     [&lt;00000000c10abb2d&gt;] __x64_sys_sendmsg+0x23/0x30 net/socket.c:2363

BUG: memory leak
unreferenced object 0xffff88811723b600 (size 64):
   comm "syz-executor032", pid 7014, jiffies 4294944027 (age 13.830s)
   hex dump (first 32 bytes):
     01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00  ................
     00 00 00 00 00 00 00 00 02 00 00 00 05 35 82 c1  .............5..
   backtrace:
     [&lt;00000000352f46d8&gt;] kmemleak_alloc_recursive  include/linux/kmemleak.h:43 [inline]
     [&lt;00000000352f46d8&gt;] slab_post_alloc_hook mm/slab.h:522 [inline]
     [&lt;00000000352f46d8&gt;] slab_alloc mm/slab.c:3319 [inline]
     [&lt;00000000352f46d8&gt;] __do_kmalloc mm/slab.c:3653 [inline]
     [&lt;00000000352f46d8&gt;] __kmalloc+0x169/0x300 mm/slab.c:3664
     [&lt;000000008e48f3d1&gt;] kmalloc include/linux/slab.h:557 [inline]
     [&lt;000000008e48f3d1&gt;] ovs_vport_set_upcall_portids+0x54/0xd0  net/openvswitch/vport.c:343
     [&lt;00000000541e4f4a&gt;] ovs_vport_alloc+0x7f/0xf0  net/openvswitch/vport.c:139
     [&lt;00000000f9a04a7d&gt;] internal_dev_create+0x24/0x1d0  net/openvswitch/vport-internal_dev.c:164
     [&lt;0000000056ee7c13&gt;] ovs_vport_add+0x81/0x190  net/openvswitch/vport.c:199
     [&lt;000000005434efc7&gt;] new_vport+0x19/0x80 net/openvswitch/datapath.c:194
     [&lt;00000000b7b253f1&gt;] ovs_dp_cmd_new+0x22f/0x410  net/openvswitch/datapath.c:1614
     [&lt;00000000e0988518&gt;] genl_family_rcv_msg+0x2ab/0x5b0  net/netlink/genetlink.c:629
     [&lt;00000000d0cc9347&gt;] genl_rcv_msg+0x54/0x9c net/netlink/genetlink.c:654
     [&lt;000000006694b647&gt;] netlink_rcv_skb+0x61/0x170  net/netlink/af_netlink.c:2477
     [&lt;0000000088381f37&gt;] genl_rcv+0x29/0x40 net/netlink/genetlink.c:665
     [&lt;00000000dad42a47&gt;] netlink_unicast_kernel  net/netlink/af_netlink.c:1302 [inline]
     [&lt;00000000dad42a47&gt;] netlink_unicast+0x1ec/0x2d0  net/netlink/af_netlink.c:1328
     [&lt;0000000067e6b079&gt;] netlink_sendmsg+0x270/0x480  net/netlink/af_netlink.c:1917
     [&lt;00000000aab08a47&gt;] sock_sendmsg_nosec net/socket.c:637 [inline]
     [&lt;00000000aab08a47&gt;] sock_sendmsg+0x54/0x70 net/socket.c:657
     [&lt;000000004cb7c11d&gt;] ___sys_sendmsg+0x393/0x3c0 net/socket.c:2311
     [&lt;00000000c4901c63&gt;] __sys_sendmsg+0x80/0xf0 net/socket.c:2356

BUG: memory leak
unreferenced object 0xffff8881228ca500 (size 128):
   comm "syz-executor032", pid 7015, jiffies 4294944622 (age 7.880s)
   hex dump (first 32 bytes):
     00 f0 27 18 81 88 ff ff 80 ac 8c 22 81 88 ff ff  ..'........"....
     40 b7 23 17 81 88 ff ff 00 00 00 00 00 00 00 00  @.#.............
   backtrace:
     [&lt;000000000eb78212&gt;] kmemleak_alloc_recursive  include/linux/kmemleak.h:43 [inline]
     [&lt;000000000eb78212&gt;] slab_post_alloc_hook mm/slab.h:522 [inline]
     [&lt;000000000eb78212&gt;] slab_alloc mm/slab.c:3319 [inline]
     [&lt;000000000eb78212&gt;] kmem_cache_alloc_trace+0x145/0x2c0 mm/slab.c:3548
     [&lt;00000000006ea6c6&gt;] kmalloc include/linux/slab.h:552 [inline]
     [&lt;00000000006ea6c6&gt;] kzalloc include/linux/slab.h:748 [inline]
     [&lt;00000000006ea6c6&gt;] ovs_vport_alloc+0x37/0xf0  net/openvswitch/vport.c:130
     [&lt;00000000f9a04a7d&gt;] internal_dev_create+0x24/0x1d0  net/openvswitch/vport-internal_dev.c:164
     [&lt;0000000056ee7c13&gt;] ovs_vport_add+0x81/0x190  net/openvswitch/vport.c:199
     [&lt;000000005434efc7&gt;] new_vport+0x19/0x80 net/openvswitch/datapath.c:194
     [&lt;00000000b7b253f1&gt;] ovs_dp_cmd_new+0x22f/0x410  net/openvswitch/datapath.c:1614
     [&lt;00000000e0988518&gt;] genl_family_rcv_msg+0x2ab/0x5b0  net/netlink/genetlink.c:629
     [&lt;00000000d0cc9347&gt;] genl_rcv_msg+0x54/0x9c net/netlink/genetlink.c:654
     [&lt;000000006694b647&gt;] netlink_rcv_skb+0x61/0x170  net/netlink/af_netlink.c:2477
     [&lt;0000000088381f37&gt;] genl_rcv+0x29/0x40 net/netlink/genetlink.c:665
     [&lt;00000000dad42a47&gt;] netlink_unicast_kernel  net/netlink/af_netlink.c:1302 [inline]
     [&lt;00000000dad42a47&gt;] netlink_unicast+0x1ec/0x2d0  net/netlink/af_netlink.c:1328
     [&lt;0000000067e6b079&gt;] netlink_sendmsg+0x270/0x480  net/netlink/af_netlink.c:1917
     [&lt;00000000aab08a47&gt;] sock_sendmsg_nosec net/socket.c:637 [inline]
     [&lt;00000000aab08a47&gt;] sock_sendmsg+0x54/0x70 net/socket.c:657
     [&lt;000000004cb7c11d&gt;] ___sys_sendmsg+0x393/0x3c0 net/socket.c:2311
     [&lt;00000000c4901c63&gt;] __sys_sendmsg+0x80/0xf0 net/socket.c:2356
     [&lt;00000000c10abb2d&gt;] __do_sys_sendmsg net/socket.c:2365 [inline]
     [&lt;00000000c10abb2d&gt;] __se_sys_sendmsg net/socket.c:2363 [inline]
     [&lt;00000000c10abb2d&gt;] __x64_sys_sendmsg+0x23/0x30 net/socket.c:2363
=====================================================================

The function in net core, register_netdevice(), may fail with vport's
destruction callback either invoked or not. After commit 309b66970ee2
("net: openvswitch: do not free vport if register_netdevice() is failed."),
the duty to destroy vport is offloaded from the driver OTOH, which ends
up in the memory leak reported.

It is fixed by releasing vport unless device is registered successfully.
To do that, the callback assignment is defered until device is registered.

Reported-by: syzbot+13210896153522fe1ee5@syzkaller.appspotmail.com
Fixes: 309b66970ee2 ("net: openvswitch: do not free vport if register_netdevice() is failed.")
Cc: Taehee Yoo &lt;ap420073@gmail.com&gt;
Cc: Greg Rose &lt;gvrose8192@gmail.com&gt;
Cc: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Cc: Marcelo Ricardo Leitner &lt;marcelo.leitner@gmail.com&gt;
Cc: Ying Xue &lt;ying.xue@windriver.com&gt;
Cc: Andrey Konovalov &lt;andreyknvl@google.com&gt;
Signed-off-by: Hillf Danton &lt;hdanton@sina.com&gt;
Acked-by: Pravin B Shelar &lt;pshelar@ovn.org&gt;
[sbrivio: this was sent to dev@openvswitch.org and never made its way
 to netdev -- resending original patch]
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
Reviewed-by: Greg Rose &lt;gvrose8192@gmail.com&gt;
Signed-off-by: Jakub Kicinski &lt;jakub.kicinski@netronome.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net/sched: fix corrupted L2 header with MPLS 'push' and 'pop' actions</title>
<updated>2019-10-16T00:14:48+00:00</updated>
<author>
<name>Davide Caratti</name>
<email>dcaratti@redhat.com</email>
</author>
<published>2019-10-12T11:55:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=fa4e0f8855fcba600e0be2575ee29c69166f74bd'/>
<id>fa4e0f8855fcba600e0be2575ee29c69166f74bd</id>
<content type='text'>
the following script:

 # tc qdisc add dev eth0 clsact
 # tc filter add dev eth0 egress protocol ip matchall \
 &gt; action mpls push protocol mpls_uc label 0x355aa bos 1

causes corruption of all IP packets transmitted by eth0. On TC egress, we
can't rely on the value of skb-&gt;mac_len, because it's 0 and a MPLS 'push'
operation will result in an overwrite of the first 4 octets in the packet
L2 header (e.g. the Destination Address if eth0 is an Ethernet); the same
error pattern is present also in the MPLS 'pop' operation. Fix this error
in act_mpls data plane, computing 'mac_len' as the difference between the
network header and the mac header (when not at TC ingress), and use it in
MPLS 'push'/'pop' core functions.

v2: unbreak 'make htmldocs' because of missing documentation of 'mac_len'
    in skb_mpls_pop(), reported by kbuild test robot

CC: Lorenzo Bianconi &lt;lorenzo@kernel.org&gt;
Fixes: 2a2ea50870ba ("net: sched: add mpls manipulation actions to TC")
Reviewed-by: Simon Horman &lt;simon.horman@netronome.com&gt;
Acked-by: John Hurley &lt;john.hurley@netronome.com&gt;
Signed-off-by: Davide Caratti &lt;dcaratti@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
the following script:

 # tc qdisc add dev eth0 clsact
 # tc filter add dev eth0 egress protocol ip matchall \
 &gt; action mpls push protocol mpls_uc label 0x355aa bos 1

causes corruption of all IP packets transmitted by eth0. On TC egress, we
can't rely on the value of skb-&gt;mac_len, because it's 0 and a MPLS 'push'
operation will result in an overwrite of the first 4 octets in the packet
L2 header (e.g. the Destination Address if eth0 is an Ethernet); the same
error pattern is present also in the MPLS 'pop' operation. Fix this error
in act_mpls data plane, computing 'mac_len' as the difference between the
network header and the mac header (when not at TC ingress), and use it in
MPLS 'push'/'pop' core functions.

v2: unbreak 'make htmldocs' because of missing documentation of 'mac_len'
    in skb_mpls_pop(), reported by kbuild test robot

CC: Lorenzo Bianconi &lt;lorenzo@kernel.org&gt;
Fixes: 2a2ea50870ba ("net: sched: add mpls manipulation actions to TC")
Reviewed-by: Simon Horman &lt;simon.horman@netronome.com&gt;
Acked-by: John Hurley &lt;john.hurley@netronome.com&gt;
Signed-off-by: Davide Caratti &lt;dcaratti@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netfilter: drop bridge nf reset from nf_reset</title>
<updated>2019-10-01T16:42:15+00:00</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2019-09-29T18:54:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=895b5c9f206eb7d25dc1360a8ccfc5958895eb89'/>
<id>895b5c9f206eb7d25dc1360a8ccfc5958895eb89</id>
<content type='text'>
commit 174e23810cd31
("sk_buff: drop all skb extensions on free and skb scrubbing") made napi
recycle always drop skb extensions.  The additional skb_ext_del() that is
performed via nf_reset on napi skb recycle is not needed anymore.

Most nf_reset() calls in the stack are there so queued skb won't block
'rmmod nf_conntrack' indefinitely.

This removes the skb_ext_del from nf_reset, and renames it to a more
fitting nf_reset_ct().

In a few selected places, add a call to skb_ext_reset to make sure that
no active extensions remain.

I am submitting this for "net", because we're still early in the release
cycle.  The patch applies to net-next too, but I think the rename causes
needless divergence between those trees.

Suggested-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 174e23810cd31
("sk_buff: drop all skb extensions on free and skb scrubbing") made napi
recycle always drop skb extensions.  The additional skb_ext_del() that is
performed via nf_reset on napi skb recycle is not needed anymore.

Most nf_reset() calls in the stack are there so queued skb won't block
'rmmod nf_conntrack' indefinitely.

This removes the skb_ext_del from nf_reset, and renames it to a more
fitting nf_reset_ct().

In a few selected places, add a call to skb_ext_reset to make sure that
no active extensions remain.

I am submitting this for "net", because we're still early in the release
cycle.  The patch applies to net-next too, but I think the rename causes
needless divergence between those trees.

Suggested-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>openvswitch: change type of UPCALL_PID attribute to NLA_UNSPEC</title>
<updated>2019-09-26T07:32:33+00:00</updated>
<author>
<name>Li RongQing</name>
<email>lirongqing@baidu.com</email>
</author>
<published>2019-09-24T11:11:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ea8564c865299815095bebeb4b25bef474218e4c'/>
<id>ea8564c865299815095bebeb4b25bef474218e4c</id>
<content type='text'>
userspace openvswitch patch "(dpif-linux: Implement the API
functions to allow multiple handler threads read upcall)"
changes its type from U32 to UNSPEC, but leave the kernel
unchanged

and after kernel 6e237d099fac "(netlink: Relax attr validation
for fixed length types)", this bug is exposed by the below
warning

	[   57.215841] netlink: 'ovs-vswitchd': attribute type 5 has an invalid length.

Fixes: 5cd667b0a456 ("openvswitch: Allow each vport to have an array of 'port_id's")
Signed-off-by: Li RongQing &lt;lirongqing@baidu.com&gt;
Acked-by: Pravin B Shelar &lt;pshelar@ovn.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
userspace openvswitch patch "(dpif-linux: Implement the API
functions to allow multiple handler threads read upcall)"
changes its type from U32 to UNSPEC, but leave the kernel
unchanged

and after kernel 6e237d099fac "(netlink: Relax attr validation
for fixed length types)", this bug is exposed by the below
warning

	[   57.215841] netlink: 'ovs-vswitchd': attribute type 5 has an invalid length.

Fixes: 5cd667b0a456 ("openvswitch: Allow each vport to have an array of 'port_id's")
Signed-off-by: Li RongQing &lt;lirongqing@baidu.com&gt;
Acked-by: Pravin B Shelar &lt;pshelar@ovn.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>net: openvswitch: Set OvS recirc_id from tc chain index</title>
<updated>2019-09-06T12:59:18+00:00</updated>
<author>
<name>Paul Blakey</name>
<email>paulb@mellanox.com</email>
</author>
<published>2019-09-04T13:56:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=95a7233c452a58a4c2310c456c73997853b2ec46'/>
<id>95a7233c452a58a4c2310c456c73997853b2ec46</id>
<content type='text'>
Offloaded OvS datapath rules are translated one to one to tc rules,
for example the following simplified OvS rule:

recirc_id(0),in_port(dev1),eth_type(0x0800),ct_state(-trk) actions:ct(),recirc(2)

Will be translated to the following tc rule:

$ tc filter add dev dev1 ingress \
	    prio 1 chain 0 proto ip \
		flower tcp ct_state -trk \
		action ct pipe \
		action goto chain 2

Received packets will first travel though tc, and if they aren't stolen
by it, like in the above rule, they will continue to OvS datapath.
Since we already did some actions (action ct in this case) which might
modify the packets, and updated action stats, we would like to continue
the proccessing with the correct recirc_id in OvS (here recirc_id(2))
where we left off.

To support this, introduce a new skb extension for tc, which
will be used for translating tc chain to ovs recirc_id to
handle these miss cases. Last tc chain index will be set
by tc goto chain action and read by OvS datapath.

Signed-off-by: Paul Blakey &lt;paulb@mellanox.com&gt;
Signed-off-by: Vlad Buslov &lt;vladbu@mellanox.com&gt;
Acked-by: Jiri Pirko &lt;jiri@mellanox.com&gt;
Acked-by: Pravin B Shelar &lt;pshelar@ovn.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Offloaded OvS datapath rules are translated one to one to tc rules,
for example the following simplified OvS rule:

recirc_id(0),in_port(dev1),eth_type(0x0800),ct_state(-trk) actions:ct(),recirc(2)

Will be translated to the following tc rule:

$ tc filter add dev dev1 ingress \
	    prio 1 chain 0 proto ip \
		flower tcp ct_state -trk \
		action ct pipe \
		action goto chain 2

Received packets will first travel though tc, and if they aren't stolen
by it, like in the above rule, they will continue to OvS datapath.
Since we already did some actions (action ct in this case) which might
modify the packets, and updated action stats, we would like to continue
the proccessing with the correct recirc_id in OvS (here recirc_id(2))
where we left off.

To support this, introduce a new skb extension for tc, which
will be used for translating tc chain to ovs recirc_id to
handle these miss cases. Last tc chain index will be set
by tc goto chain action and read by OvS datapath.

Signed-off-by: Paul Blakey &lt;paulb@mellanox.com&gt;
Signed-off-by: Vlad Buslov &lt;vladbu@mellanox.com&gt;
Acked-by: Jiri Pirko &lt;jiri@mellanox.com&gt;
Acked-by: Pravin B Shelar &lt;pshelar@ovn.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net</title>
<updated>2019-09-02T18:20:17+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2019-09-02T18:20:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=765b7590c92d849806e9a27ab3a5a17cfc6a47a9'/>
<id>765b7590c92d849806e9a27ab3a5a17cfc6a47a9</id>
<content type='text'>
r8152 conflicts are the NAPI fixes in 'net' overlapping with
some tasklet stuff in net-next

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
r8152 conflicts are the NAPI fixes in 'net' overlapping with
some tasklet stuff in net-next

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
