[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210111110333.zr6tpqpc7ckzy3gx@skbuf>
Date: Mon, 11 Jan 2021 13:03:33 +0200
From: Vladimir Oltean <olteanv@...il.com>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: kbuild@...ts.01.org, "David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, lkp@...el.com,
kbuild-all@...ts.01.org, netdev@...r.kernel.org,
Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Cong Wang <xiyou.wangcong@...il.com>,
Stephen Hemminger <stephen@...workplumber.org>,
Eric Dumazet <edumazet@...gle.com>,
George McCollister <george.mccollister@...il.com>,
Oleksij Rempel <o.rempel@...gutronix.de>
Subject: Re: [PATCH v5 net-next 11/16] net: propagate errors from
dev_get_stats
Hi Dan,
On Mon, Jan 11, 2021 at 01:55:16PM +0300, Dan Carpenter wrote:
> Hi Vladimir,
>
> New smatch warnings:
> net/core/rtnetlink.c:1821 rtnl_fill_ifinfo() warn: missing error code 'err'
>
> vim +/err +1821 net/core/rtnetlink.c
>
> static int rtnl_fill_ifinfo(struct sk_buff *skb,
> struct net_device *dev, struct net *src_net,
> int type, u32 pid, u32 seq, u32 change,
> unsigned int flags, u32 ext_filter_mask,
> u32 event, int *new_nsid, int new_ifindex,
> int tgt_netnsid, gfp_t gfp)
> {
> struct ifinfomsg *ifm;
> struct nlmsghdr *nlh;
> int err = -EMSGSIZE;
>
...
>
> err = rtnl_fill_stats(skb, dev);
> if (err)
> goto nla_put_failure;
>
> if (rtnl_fill_vf(skb, dev, ext_filter_mask))
> goto nla_put_failure;
>
> No error codes any more on the rest of the gotos in this function.
>
>
> if (rtnl_port_fill(skb, dev, ext_filter_mask))
> goto nla_put_failure;
>
> if (rtnl_xdp_fill(skb, dev))
> goto nla_put_failure;
>
...
>
> nlmsg_end(skb, nlh);
> return 0;
>
> nla_put_failure_rcu:
> rcu_read_unlock();
> nla_put_failure:
> nlmsg_cancel(skb, nlh);
> return err;
> }
Thank you for this report. It is a valid issue. It has also been fixed
in v6:
https://patchwork.kernel.org/project/netdevbpf/patch/20210109172624.2028156-12-olteanv@gmail.com/
>From the changelog:
Changes in v6:
- Fixed rtnetlink incorrectly returning 0 in rtnl_fill_ifinfo on
nla_put_failure and causing "ip a" to not show any interfaces.
Powered by blists - more mailing lists