netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexei Starovoitov <ast@plumgrid.com>
To: Daniel Borkmann <daniel@iogearbox.net>, davem@davemloft.net
Cc: challa@noironetworks.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] ebpf: verifier: check that call reg with ARG_ANYTHING is initialized
Date: Thu, 12 Mar 2015 09:53:59 -0700	[thread overview]
Message-ID: <5501C4A7.8020803@plumgrid.com> (raw)
In-Reply-To: <8bb5d2d9c8d471c1161ae60ea92141aef00a4fc8.1426172976.git.daniel@iogearbox.net>

On 3/12/15 9:21 AM, Daniel Borkmann wrote:
> I noticed that a helper function with argument type ARG_ANYTHING does
> not need to have an initialized value (register).
>
> This can worst case lead to unintented stack memory leakage in future
> helper functions if they are not carefully designed, or unintended
> application behaviour in case the application developer was not careful
> enough to match a correct helper function signature in the API.
>
> The underlying issue is that ARG_ANYTHING should actually be split
> into two different semantics:
>
>    1) ARG_DONTCARE for function arguments that the helper function
>       does not care about (in other words: the default for unused
>       function arguments), and
>
>    2) ARG_ANYTHING that is an argument actually being used by a
>       helper function and *guaranteed* to be an initialized register.
>
> The current risk is low: ARG_ANYTHING is only used for the 'flags'
> argument (r4) in bpf_map_update_elem() that internally does strict
> checking.
>
> Fixes: 17a5267067f3 ("bpf: verifier (add verifier core)")
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
> ---
>   I'm fine with this going to net-next, but it also applies to net.

Acked-by: Alexei Starovoitov <ast@plumgrid.com>

nice catch. you understood verifier so well :)
Also agree that net-next is enough.

  reply	other threads:[~2015-03-12 16:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-12 16:21 [PATCH net-next] ebpf: verifier: check that call reg with ARG_ANYTHING is initialized Daniel Borkmann
2015-03-12 16:53 ` Alexei Starovoitov [this message]
2015-03-12 19:29 ` 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=5501C4A7.8020803@plumgrid.com \
    --to=ast@plumgrid.com \
    --cc=challa@noironetworks.com \
    --cc=daniel@iogearbox.net \
    --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 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).