netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Lin Ma" <linma@zju.edu.cn>
To: "Paolo Abeni" <pabeni@redhat.com>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v1] vlan: skip nested type that is not IFLA_VLAN_QOS_MAPPING
Date: Thu, 18 Jan 2024 20:57:05 +0800 (GMT+08:00)	[thread overview]
Message-ID: <26a27e55.668e.18d1ca5845b.Coremail.linma@zju.edu.cn> (raw)
In-Reply-To: <1137d26fb5fc1ca7070f8012ec588116a29a1c8a.camel@redhat.com>

Hello Paolo,

> 
> On Wed, 2024-01-17 at 23:38 +0800, Lin Ma wrote:
> > In the vlan_changelink function, a loop is used to parse the nested
> > attributes IFLA_VLAN_EGRESS_QOS and IFLA_VLAN_INGRESS_QOS in order to
> > obtain the struct ifla_vlan_qos_mapping. These two nested attributes are
> > checked in the vlan_validate_qos_map function, which calls
> > nla_validate_nested_deprecated with the vlan_map_policy.
> > 
> > However, this deprecated validator applies a LIBERAL strictness, allowing
> > the presence of an attribute with the type IFLA_VLAN_QOS_UNSPEC.
> > Consequently, the loop in vlan_changelink may parse an attribute of type
> > IFLA_VLAN_QOS_UNSPEC and believe it carries a payload of
> > struct ifla_vlan_qos_mapping, which is not necessarily true.
> > 
> > To address this issue and ensure compatibility, this patch introduces two
> > type checks that skip attributes whose type is not IFLA_VLAN_QOS_MAPPING.
> > 
> > Signed-off-by: Lin Ma <linma@zju.edu.cn>
> 
> Why are you targeting net-next? this looks like a fix suitable for
> 'net' - with a proper fixes tag.
> 

Thanks for your suggestions, sometimes I just mistakenly do the opposite of what I intended to. 

I will send version two with the right tag.

> Cheers,
> 
> Paolo

Thanks
Lin

      reply	other threads:[~2024-01-18 12:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-17 15:38 [PATCH net-next v1] vlan: skip nested type that is not IFLA_VLAN_QOS_MAPPING Lin Ma
2024-01-18 12:19 ` Paolo Abeni
2024-01-18 12:57   ` Lin Ma [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=26a27e55.668e.18d1ca5845b.Coremail.linma@zju.edu.cn \
    --to=linma@zju.edu.cn \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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).