netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: daniel@iogearbox.net
Cc: netdev@vger.kernel.org, chrisw@sous-sol.org,
	sucheta.chakraborty@qlogic.com, gregory.v.rose@intel.com,
	jeffrey.t.kirsher@intel.com, ronye@mellanox.com,
	vladz@cloudius-systems.com, nicolas.dichtel@6wind.com,
	tgraf@suug.ch, jgunthorpe@obsidianresearch.com
Subject: Re: [PATCH net] rtnetlink: verify IFLA_VF_INFO attributes before passing them to driver
Date: Wed, 08 Jul 2015 16:02:37 -0700 (PDT)	[thread overview]
Message-ID: <20150708.160237.452927104948461108.davem@davemloft.net> (raw)
In-Reply-To: <9b88c7217fcbf771efc162d51e3d6d1957707aa7.1436220184.git.daniel@iogearbox.net>

From: Daniel Borkmann <daniel@iogearbox.net>
Date: Tue,  7 Jul 2015 00:07:52 +0200

> Jason Gunthorpe reported that since commit c02db8c6290b ("rtnetlink: make
> SR-IOV VF interface symmetric"), we don't verify IFLA_VF_INFO attributes
> anymore with respect to their policy, that is, ifla_vfinfo_policy[].
> 
> Before, they were part of ifla_policy[], but they have been nested since
> placed under IFLA_VFINFO_LIST, that contains the attribute IFLA_VF_INFO,
> which is another nested attribute for the actual VF attributes such as
> IFLA_VF_MAC, IFLA_VF_VLAN, etc.
> 
> Despite the policy being split out from ifla_policy[] in this commit,
> it's never applied anywhere. nla_for_each_nested() only does basic nla_ok()
> testing for struct nlattr, but it doesn't know about the data context and
> their requirements.
> 
> Fix, on top of Jason's initial work, does 1) parsing of the attributes
> with the right policy, and 2) using the resulting parsed attribute table
> from 1) instead of the nla_for_each_nested() loop (just like we used to
> do when still part of ifla_policy[]).
> 
> Reference: http://thread.gmane.org/gmane.linux.network/368913
> Fixes: c02db8c6290b ("rtnetlink: make SR-IOV VF interface symmetric")
> Reported-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
> Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>

Applied and queued up for -stable, thanks.

      parent reply	other threads:[~2015-07-08 23:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-06 22:07 [PATCH net] rtnetlink: verify IFLA_VF_INFO attributes before passing them to driver Daniel Borkmann
2015-07-07  8:36 ` Vlad Zolotarov
2015-07-08 23:02 ` David Miller [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=20150708.160237.452927104948461108.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=chrisw@sous-sol.org \
    --cc=daniel@iogearbox.net \
    --cc=gregory.v.rose@intel.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=ronye@mellanox.com \
    --cc=sucheta.chakraborty@qlogic.com \
    --cc=tgraf@suug.ch \
    --cc=vladz@cloudius-systems.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).