netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <dsahern@kernel.org>
Cc: <davem@davemloft.net>, <edumazet@google.com>, <horms@kernel.org>,
	<kuba@kernel.org>, <kuni1840@gmail.com>, <kuniyu@amazon.com>,
	<netdev@vger.kernel.org>, <pabeni@redhat.com>,
	<syzkaller@googlegroups.com>, <yi1.lai@linux.intel.com>
Subject: Re: [PATCH v1 net-next] ipv6: Restore fib6_config validation for SIOCADDRT.
Date: Wed, 30 Apr 2025 17:48:37 -0700	[thread overview]
Message-ID: <20250501004841.52728-1-kuniyu@amazon.com> (raw)
In-Reply-To: <86cf6035-c6d9-462c-9a9c-42a6d0368069@kernel.org>

From: David Ahern <dsahern@kernel.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!

  reply	other threads:[~2025-05-01  0:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-29  1:46 [PATCH v1 net-next] ipv6: Restore fib6_config validation for SIOCADDRT Kuniyuki Iwashima
2025-04-29 15:31 ` David Ahern
2025-05-01  0:48   ` Kuniyuki Iwashima [this message]
2025-04-30  1:59 ` kernel test robot
2025-04-30  3:20 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250501004841.52728-1-kuniyu@amazon.com \
    --to=kuniyu@amazon.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuni1840@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=syzkaller@googlegroups.com \
    --cc=yi1.lai@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).