All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Martin KaFai Lau <kafai@fb.com>, netdev@vger.kernel.org
Cc: Alexei Starovoitov <ast@fb.com>, kernel-team@fb.com
Subject: Re: [PATCH bpf] bpf: btf: Use exact btf value_size match in map_check_btf()
Date: Fri, 27 Jul 2018 03:46:47 +0200	[thread overview]
Message-ID: <32cdc385-c7a5-7e40-2d92-4ae8d370b782@iogearbox.net> (raw)
In-Reply-To: <20180726165759.3788287-1-kafai@fb.com>

On 07/26/2018 06:57 PM, Martin KaFai Lau wrote:
> The current map_check_btf() in BPF_MAP_TYPE_ARRAY rejects
> '> map->value_size' to ensure map_seq_show_elem() will not
> access things beyond an array element.
> 
> Yonghong suggested that using '!=' is a more correct
> check.  The 8 bytes round_up on value_size is stored
> in array->elem_size.  Hence, using '!=' on map->value_size
> is a proper check.
> 
> This patch also adds new tests to check the btf array
> key type and value type.  Two of these new tests verify
> the btf's value_size (the change in this patch).
> 
> It also fixes two existing tests that wrongly encoded
> a btf's type size (pprint_test) and the value_type_id (in one
> of the raw_tests[]).  However, that do not affect these two
> BTF verification tests before or after this test changes.
> These two tests mainly failed at array creation time after
> this patch.
> 
> Fixes: a26ca7c982cb ("bpf: btf: Add pretty print support to the basic arraymap")
> Suggested-by: Yonghong Song <yhs@fb.com>
> Acked-by: Yonghong Song <yhs@fb.com>
> Signed-off-by: Martin KaFai Lau <kafai@fb.com>

Applied to bpf, thanks Martin!

      reply	other threads:[~2018-07-27  3:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-26 16:57 [PATCH bpf] bpf: btf: Use exact btf value_size match in map_check_btf() Martin KaFai Lau
2018-07-27  1:46 ` Daniel Borkmann [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=32cdc385-c7a5-7e40-2d92-4ae8d370b782@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=ast@fb.com \
    --cc=kafai@fb.com \
    --cc=kernel-team@fb.com \
    --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.