All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xuanqiang Luo <xuanqiang.luo@linux.dev>
To: Ido Schimmel <idosch@nvidia.com>
Cc: netdev@vger.kernel.org, dsahern@kernel.org, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	horms@kernel.org, tgraf@suug.ch, pshelar@nicira.com,
	linux-kernel@vger.kernel.org,
	Xuanqiang Luo <luoxuanqiang@kylinos.cn>
Subject: Re: [PATCH net v1] ip_gre: Reject enabling collect metadata through changelink
Date: Mon, 21 Sep 2026 11:12:55 +0800	[thread overview]
Message-ID: <8bfe6312-79c2-495f-a336-e96360c26998@linux.dev> (raw)
In-Reply-To: <20260920102659.GA1897785@shredder>

在 2026/9/20 18:26, Ido Schimmel 写道:
> On Thu, Sep 17, 2026 at 05:50:16PM +0800, Xuanqiang Luo wrote:
>> diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
>> index 82309efd417e0..7b1b0f17f60b9 100644
>> --- a/net/ipv4/ip_gre.c
>> +++ b/net/ipv4/ip_gre.c
>> @@ -1464,6 +1464,9 @@ static int ipgre_changelink(struct net_device *dev, struct nlattr *tb[],
>>   	if (!rtnl_dev_link_net_capable(dev, t->net))
>>   		return -EPERM;
>>   
>> +	if (data && data[IFLA_GRE_COLLECT_METADATA] && !t->collect_md)
>> +		return -EOPNOTSUPP;
>> +
>>   	err = ipgre_newlink_encap_setup(dev, data);
>>   	if (err)
>>   		return err;
>> @@ -1496,6 +1499,9 @@ static int erspan_changelink(struct net_device *dev, struct nlattr *tb[],
>>   	if (!rtnl_dev_link_net_capable(dev, t->net))
>>   		return -EPERM;
>>   
>> +	if (data && data[IFLA_GRE_COLLECT_METADATA] && !t->collect_md)
>> +		return -EOPNOTSUPP;
> 
> Both functions have extack, so please add a rejection message to make it
> clear to user space. Something like:
> 
> "Enabling collect_md on an existing device is not supported"

Thanks for the suggestion!

I'll address this in v2.

> 
> Also, I assume you audited other tunnels and confirmed that they don't
> suffer from this problem?
> 

Yes, I checked the relevant paths in other tunnels and found no
similar issues.

Thanks,
Xuanqiang

      reply	other threads:[~2026-09-21  3:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17  9:50 [PATCH net v1] ip_gre: Reject enabling collect metadata through changelink Xuanqiang Luo
2026-09-20 10:26 ` Ido Schimmel
2026-09-21  3:12   ` Xuanqiang Luo [this message]

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=8bfe6312-79c2-495f-a336-e96360c26998@linux.dev \
    --to=xuanqiang.luo@linux.dev \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luoxuanqiang@kylinos.cn \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pshelar@nicira.com \
    --cc=tgraf@suug.ch \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.