All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Alexey Dobriyan <adobriyan@gmail.com>,
	David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>
Subject: Re: BROKEN Re: [PATCH] netlink: 2-clause nla_ok()
Date: Mon, 05 Dec 2016 16:09:13 +0100	[thread overview]
Message-ID: <1480950553.31788.40.camel@sipsolutions.net> (raw)
In-Reply-To: <CACVxJT9Qc=vNexx4ooQVFo=SrGs4-oHeZrnL18vbiS+o0F_N1A@mail.gmail.com> (sfid-20161205_155731_995936_F14B01DF)


> Maybe someone could vouch that other checks prevent
> this kind of situation from happening but not me.

No, now that you spell it out (and I see the patch) - this is
absolutely needed because nla_for_each_attr() [1] can be called on
arbitrary data coming from userspace in a message, e.g. by way
of nla_for_each_nested(). Even if it's not malformed, nla_ok() is the
only abort condition for that loop, so it would read at least one
nla_len after the real buffer without that condition.

johannes

[1] which seems to be the only significant user thereof

  reply	other threads:[~2016-12-05 15:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-05 14:56 BROKEN Re: [PATCH] netlink: 2-clause nla_ok() Alexey Dobriyan
2016-12-05 15:09 ` Johannes Berg [this message]
2016-12-13 19:30   ` [PATCH net-next] netlink: revert broken, broken "2-clause nla_ok()" Alexey Dobriyan
2016-12-13 19:55     ` 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=1480950553.31788.40.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=adobriyan@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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.