netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: ast@plumgrid.com
Cc: daniel@iogearbox.net, hannes@stressinduktion.org, netdev@vger.kernel.org
Subject: Re: [PATCH net] bpf: fix two bugs in verification logic when accessing 'ctx' pointer
Date: Thu, 16 Apr 2015 14:10:15 -0400 (EDT)	[thread overview]
Message-ID: <20150416.141015.2085337707033100619.davem@davemloft.net> (raw)
In-Reply-To: <1429139973-5473-1-git-send-email-ast@plumgrid.com>

From: Alexei Starovoitov <ast@plumgrid.com>
Date: Wed, 15 Apr 2015 16:19:33 -0700

> 1.
> first bug is a silly mistake. It broke tracing examples and prevented
> simple bpf programs from loading.
 ...
> 2.
> second bug is more subtle.
> If malicious code is using the same dest register as source register,
> the checks designed to prevent the same instruction to be used with different
> pointer types will fail to trigger, since we were assigning src_reg_type
> when it was already overwritten by check_mem_access().
> The fix is trivial. Just move line:
> src_reg_type = regs[insn->src_reg].type;
> before check_mem_access().
> Add new 'access skb fields bad4' test to check this case.
> 
> Fixes: 9bac3d6d548e ("bpf: allow extended BPF programs access skb fields")
> Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>

Applied, thank you.

      reply	other threads:[~2015-04-16 18:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-15 23:19 [PATCH net] bpf: fix two bugs in verification logic when accessing 'ctx' pointer Alexei Starovoitov
2015-04-16 18:10 ` 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=20150416.141015.2085337707033100619.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=ast@plumgrid.com \
    --cc=daniel@iogearbox.net \
    --cc=hannes@stressinduktion.org \
    --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).