diff mbox series

openvswitch: change type of UPCALL_PID attribute to NLA_UNSPEC

Message ID 1569323512-19195-1-git-send-email-lirongqing@baidu.com
State Accepted
Delegated to: David Miller
Headers show
Series openvswitch: change type of UPCALL_PID attribute to NLA_UNSPEC | expand

Commit Message

Li RongQing Sept. 24, 2019, 11:11 a.m. UTC
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.

Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
 net/openvswitch/datapath.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Pravin Shelar Sept. 25, 2019, 9:02 p.m. UTC | #1
On Tue, Sep 24, 2019 at 4:11 AM Li RongQing <lirongqing@baidu.com> wrote:
>
> 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.
>
> Signed-off-by: Li RongQing <lirongqing@baidu.com>

Acked-by: Pravin B Shelar <pshelar@ovn.org>

Thanks,
Pravin.
Li RongQing Sept. 26, 2019, 1:15 a.m. UTC | #2
> -----邮件原件-----
> 发件人: Pravin Shelar [mailto:pshelar@ovn.org]
> 发送时间: 2019年9月26日 5:03
> 收件人: Li,Rongqing <lirongqing@baidu.com>
> 抄送: Linux Kernel Network Developers <netdev@vger.kernel.org>
> 主题: Re: [PATCH] openvswitch: change type of UPCALL_PID attribute to
> NLA_UNSPEC
> 
> On Tue, Sep 24, 2019 at 4:11 AM Li RongQing <lirongqing@baidu.com> wrote:
> >
> > 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.
> >
> > Signed-off-by: Li RongQing <lirongqing@baidu.com>
> 
> Acked-by: Pravin B Shelar <pshelar@ovn.org>
> 

Add a fixes:

Fixes: 5cd667b0a456 ("openvswitch: Allow each vport to have an array of 'port_id's")

-LI

> Thanks,
> Pravin.
David Miller Sept. 26, 2019, 7:33 a.m. UTC | #3
From: Li RongQing <lirongqing@baidu.com>
Date: Tue, 24 Sep 2019 19:11:52 +0800

> 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.
> 
> Signed-off-by: Li RongQing <lirongqing@baidu.com>

Applied, and queued up for -stable, thanks.
diff mbox series

Patch

diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index dde9d762edee..f30e406fbec5 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -2294,7 +2294,7 @@  static const struct nla_policy vport_policy[OVS_VPORT_ATTR_MAX + 1] = {
 	[OVS_VPORT_ATTR_STATS] = { .len = sizeof(struct ovs_vport_stats) },
 	[OVS_VPORT_ATTR_PORT_NO] = { .type = NLA_U32 },
 	[OVS_VPORT_ATTR_TYPE] = { .type = NLA_U32 },
-	[OVS_VPORT_ATTR_UPCALL_PID] = { .type = NLA_U32 },
+	[OVS_VPORT_ATTR_UPCALL_PID] = { .type = NLA_UNSPEC },
 	[OVS_VPORT_ATTR_OPTIONS] = { .type = NLA_NESTED },
 	[OVS_VPORT_ATTR_IFINDEX] = { .type = NLA_U32 },
 	[OVS_VPORT_ATTR_NETNSID] = { .type = NLA_S32 },