[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250501004841.52728-1-kuniyu@amazon.com>
Date: Wed, 30 Apr 2025 17:48:37 -0700
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <dsahern@...nel.org>
CC: <davem@...emloft.net>, <edumazet@...gle.com>, <horms@...nel.org>,
<kuba@...nel.org>, <kuni1840@...il.com>, <kuniyu@...zon.com>,
<netdev@...r.kernel.org>, <pabeni@...hat.com>, <syzkaller@...glegroups.com>,
<yi1.lai@...ux.intel.com>
Subject: Re: [PATCH v1 net-next] ipv6: Restore fib6_config validation for SIOCADDRT.
From: David Ahern <dsahern@...nel.org>
Date: Tue, 29 Apr 2025 09:31:33 -0600
> On 4/28/25 6:46 PM, Kuniyuki Iwashima wrote:
> > diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> > index d0351e95d916..4c1e86e968f8 100644
> > --- a/net/ipv6/route.c
> > +++ b/net/ipv6/route.c
> > @@ -4496,6 +4496,53 @@ void rt6_purge_dflt_routers(struct net *net)
> > rcu_read_unlock();
> > }
> >
> > +static int fib6_config_validate(struct fib6_config *cfg,
> > + struct netlink_ext_ack *extack)
> > +{
> > + /* RTF_PCPU is an internal flag; can not be set by userspace */
> > + if (cfg->fc_flags & RTF_PCPU) {
> > + NL_SET_ERR_MSG(extack, "Userspace can not set RTF_PCPU");
> > + goto errout;
> > + }
> > +
> > + /* RTF_CACHE is an internal flag; can not be set by userspace */
> > + if (cfg->fc_flags & RTF_CACHE) {
> > + NL_SET_ERR_MSG(extack, "Userspace can not set RTF_CACHE");
> > + goto errout;
> > + }
> > +
> > + if (cfg->fc_type > RTN_MAX) {
> > + NL_SET_ERR_MSG(extack, "Invalid route type");
> > + goto errout;
> > + }
> > +
> > + if (cfg->fc_dst_len > 128) {
> > + NL_SET_ERR_MSG(extack, "Invalid prefix length");
> > + goto errout;
> > + }
> > +
> > +#ifdef CONFIG_IPV6_SUBTREES
> > + if (cfg->fc_src_len > 128) {
> > + NL_SET_ERR_MSG(extack, "Invalid source address length");
> > + goto errout;
> > + }
> > +
> > + if (cfg->fc_nh_id && cfg->fc_src_len) {
>
> extra space after '&&'
I didn't notice I added it in fa76c1674f2e.
Will remove it in v2 and add the missing last-minute change
that caused build failure..
Thanks!
Powered by blists - more mailing lists