bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yonghong Song <yhs@fb.com>
To: <bpf@vger.kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>, <kernel-team@fb.com>
Subject: [PATCH bpf 0/2] bpf: fix a verifier issue when assigning 32bit reg states to 64bit ones
Date: Thu, 28 May 2020 09:50:43 -0700	[thread overview]
Message-ID: <20200528165043.1568623-1-yhs@fb.com> (raw)

Commit 3f50f132d840 ("bpf: Verifier, do explicit ALU32 bounds tracking")
added 32bit register states to verifier for explicit ALU32 bounds
tracking. When assigning 32bit register states to 64bit register states,
if 32bit register is a constant value of 0, the 64bit register smax_val
will get U32_MAX(0xffffFFFF). Such an inprecise information may impact
downward verification. Patch #1 has detailed explanation of the program
and how to fix it. Patch #2 provides a verifier test to cover the change.

Yonghong Song (2):
  bpf: fix a verifier issue when assigning 32bit reg states to 64bit
  tools/bpf: add a verifier test for assigning 32bit reg states to 64bit

 kernel/bpf/verifier.c                         |  3 +++
 tools/testing/selftests/bpf/verifier/bounds.c | 22 +++++++++++++++++++
 2 files changed, 25 insertions(+)

-- 
2.24.1


             reply	other threads:[~2020-05-28 16:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28 16:50 Yonghong Song [this message]
2020-05-28 16:50 ` [PATCH bpf 1/2] bpf: fix a verifier issue when assigning 32bit reg states to 64bit ones Yonghong Song
2020-05-28 20:36   ` Alexei Starovoitov
2020-05-28 21:22     ` Yonghong Song
2020-05-28 21:30   ` John Fastabend
2020-05-28 21:58     ` Yonghong Song
2020-05-28 16:50 ` [PATCH bpf 2/2] tools/bpf: add a verifier test for " Yonghong Song

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=20200528165043.1568623-1-yhs@fb.com \
    --to=yhs@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.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).