[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <PA4PR05MB76476F5513C4A5BD18EEA237F1809@PA4PR05MB7647.eurprd05.prod.outlook.com>
Date: Wed, 6 Jul 2022 03:36:01 +0000
From: Hoang Huu Le <hoang.h.le@...tech.com.au>
To: Jakub Kicinski <kuba@...nel.org>
CC: "jmaloy@...hat.com" <jmaloy@...hat.com>,
"maloy@...jonn.com" <maloy@...jonn.com>,
"ying.xue@...driver.com" <ying.xue@...driver.com>,
Tung Quang Nguyen <tung.q.nguyen@...tech.com.au>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"tipc-discussion@...ts.sourceforge.net"
<tipc-discussion@...ts.sourceforge.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"davem@...emloft.net" <davem@...emloft.net>,
"syzbot+a73d24a22eeeebe5f244@...kaller.appspotmail.com"
<syzbot+a73d24a22eeeebe5f244@...kaller.appspotmail.com>
Subject: RE: [net-next] tipc: fix uninit-value in
tipc_nl_node_reset_link_stats
> -----Original Message-----
> From: Jakub Kicinski <kuba@...nel.org>
> Sent: Wednesday, July 6, 2022 8:53 AM
> To: Hoang Huu Le <hoang.h.le@...tech.com.au>
> Cc: jmaloy@...hat.com; maloy@...jonn.com; ying.xue@...driver.com; Tung Quang Nguyen <tung.q.nguyen@...tech.com.au>;
> pabeni@...hat.com; edumazet@...gle.com; tipc-discussion@...ts.sourceforge.net; netdev@...r.kernel.org;
> davem@...emloft.net; syzbot+a73d24a22eeeebe5f244@...kaller.appspotmail.com
> Subject: Re: [net-next] tipc: fix uninit-value in tipc_nl_node_reset_link_stats
>
> On Tue, 5 Jul 2022 07:50:57 +0700 Hoang Le wrote:
> > Reported-by: syzbot+a73d24a22eeeebe5f244@...kaller.appspotmail.com
> > Acked-by: Jon Maloy <jmaloy@...hat.com>
> > Signed-off-by: Hoang Le <hoang.h.le@...tech.com.au>
>
> Can we get a Fixes tag please?
>
> > diff --git a/net/tipc/node.c b/net/tipc/node.c
> > index b48d97cbbe29..23419a599471 100644
> > --- a/net/tipc/node.c
> > +++ b/net/tipc/node.c
> > @@ -2561,6 +2561,7 @@ int tipc_nl_node_reset_link_stats(struct sk_buff *skb, struct genl_info *info)
> > struct net *net = sock_net(skb->sk);
> > struct tipc_net *tn = tipc_net(net);
> > struct tipc_link_entry *le;
> > + int len;
> >
> > if (!info->attrs[TIPC_NLA_LINK])
> > return -EINVAL;
> > @@ -2574,7 +2575,14 @@ int tipc_nl_node_reset_link_stats(struct sk_buff *skb, struct genl_info *info)
> > if (!attrs[TIPC_NLA_LINK_NAME])
> > return -EINVAL;
> >
> > + len = nla_len(attrs[TIPC_NLA_LINK_NAME]);
> > + if (len <= 0)
> > + return -EINVAL;
> > +
> > link_name = nla_data(attrs[TIPC_NLA_LINK_NAME]);
> > + len = min_t(int, len, TIPC_MAX_LINK_NAME);
> > + if (!memchr(link_name, '\0', len))
> > + return -EINVAL;
>
> Should we just change the netlink policy for this attribute to
> NLA_NUL_STRING, then?
I recognize this is redundant check. I will post v2 into net.
Powered by blists - more mailing lists