[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <302ac4d7.207e.18dea6a6103.Coremail.linma@zju.edu.cn>
Date: Tue, 27 Feb 2024 19:54:16 +0800 (GMT+08:00)
From: "Lin Ma" <linma@....edu.cn>
To: "Nikolay Aleksandrov" <razor@...ckwall.org>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, idosch@...dia.com, jiri@...nulli.us,
lucien.xin@...il.com, edwin.peer@...adcom.com, amcohen@...dia.com,
pctammela@...atatu.com, liuhangbin@...il.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net v1] rtnetlink: fix error logic of IFLA_BRIDGE_FLAGS
writing back
Hello Nikolay,
>
> That fix is obviously broken, I don't know how I missed it back then.
> One comment below,
Guess is because this loop is so weird :(
I looked into the kernel and did not find other codes that refer to the
NLA pointer outside the `nla_for_each_nested` loop.
> ...
> > struct net *net = sock_net(skb->sk);
> > struct ifinfomsg *ifm;
> > struct net_device *dev;
> > - struct nlattr *br_spec, *attr = NULL;
> > + struct nlattr *br_spec, *attr, *br_flag = NULL;
>
> Please name the variable to something that describes it better, like
> br_flags_attr.
>
OK, I will rename the variable and send another version.
> > int rem, err = -EOPNOTSUPP;
> > u16 flags = 0;
> > - bool have_flags = false;
> >
> > if (nlmsg_len(nlh) < sizeof(*ifm))
> > return -EINVAL;
> > @@ -5190,11 +5189,11 @@ static int rtnl_bridge_setlink(struct sk_buff *skb, struct nlmsghdr *nlh,
> > br_spec = nlmsg_find_attr(nlh, sizeof(struct ifinfomsg), IFLA_AF_SPEC);
> > if (br_spec) {
Powered by blists - more mailing lists