netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@suug.ch>
To: Vlad Yasevich <vyasevic@redhat.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	netdev@vger.kernel.org, davem@davemloft.net
Subject: Re: [PATCH] rtnetlink: Mask the rta_type when range checking
Date: Fri, 15 Mar 2013 08:51:24 +0000	[thread overview]
Message-ID: <20130315085124.GA17498@casper.infradead.org> (raw)
In-Reply-To: <51426BB6.5030204@redhat.com>

On 03/14/13 at 08:30pm, Vlad Yasevich wrote:
> Doing a quick check on all the callers for rtnl_register and their
> handlers the following do not use nla_parse:
>  1) dn_fib_rtm_newroute/delroute  - Don't seem to care about attribute
>                                     types.
>  2) dn_cache_getroute() - suspect use.  relies on rta_buf populated by
>                           rtnetlink_rcv_msg
> 
>  3) inet_rtm_newroute/delroute - rtm_to_fib_config() uses a custom loop
>                                   with nla_type(), so safe.
> 
> That's all that a quick look finds.  Out of all of them, looks like
> on dn_cache_getroute() would be broken.

So checking values in rta_max[] which lists the maximum attribute
allowed for each message family range, all are limited to low
values so the NLA_F_NESTED bit is guaranteed to have been unused
up to now.

The risk that remains is that we would start accepting an attribute
which we previously didn't but we have that risk with every new
attribute that is added.

Acked-by: Thomas Graf <tgraf@suug.ch>

  reply	other threads:[~2013-03-15  8:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-13 14:18 [PATCH] rtnetlink: Mask the rta_type when range checking Vlad Yasevich
2013-03-13 15:36 ` Stephen Hemminger
2013-03-13 15:41   ` Vlad Yasevich
2013-03-14 17:40   ` Vlad Yasevich
2013-03-14 21:28     ` Thomas Graf
2013-03-15  0:30       ` Vlad Yasevich
2013-03-15  8:51         ` Thomas Graf [this message]
2013-03-17 15:44           ` David Miller

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=20130315085124.GA17498@casper.infradead.org \
    --to=tgraf@suug.ch \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=vyasevic@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).