Netdev List
 help / color / mirror / Atom feed
From: Jakub Kicinski <kubakici@wp.pl>
To: Martin KaFai Lau <kafai@fb.com>
Cc: <netdev@vger.kernel.org>, Alexei Starovoitov <ast@fb.com>,
	Daniel Borkmann <daniel@iogearbox.net>, <kernel-team@fb.com>
Subject: Re: [PATCH bpf-next v4 03/10] bpf: btf: Check members of struct/union
Date: Wed, 18 Apr 2018 11:30:25 -0700	[thread overview]
Message-ID: <20180418113025.4ad5b9bd@cakuba.netronome.com> (raw)
In-Reply-To: <20180418180101.6tdt5hr3ned25gu3@kafai-mbp>

On Wed, 18 Apr 2018 11:01:15 -0700, Martin KaFai Lau wrote:
> On Wed, Apr 18, 2018 at 10:22:10AM -0700, Jakub Kicinski wrote:
> > On Tue, 17 Apr 2018 13:42:36 -0700, Martin KaFai Lau wrote:  
> > > This patch checks a few things of struct's members:
> > > 
> > > 1) It has a valid size (e.g. a "const void" is invalid)
> > > 2) A member's size (+ its member's offset) does not exceed
> > >    the containing struct's size.
> > > 3) The member's offset satisfies the alignment requirement  
> > 
> > Could we also introduce a requirement for members to have different
> > names?  Maybe it's there but I missed it.  Would BTF with duplicated
> > member names be considered valid?  
>
> It could check but I don't see BTF needs to check everything
> that clang does.

Agreed, I don't think correct tooling should ever generate duplicated
members.  Should the BTF forbid it then?  It could help catch bugs and
avoid problems.  I was thinking about JSON where duplicated field
names will result in invalid JSON potentially leading to issues in
user space stacks...

  reply	other threads:[~2018-04-18 18:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-17 20:42 [PATCH bpf-next v4 00/10] BTF: BPF Type Format Martin KaFai Lau
2018-04-17 20:42 ` [PATCH bpf-next v4 01/10] bpf: btf: Introduce BPF Type Format (BTF) Martin KaFai Lau
2018-04-17 20:42 ` [PATCH bpf-next v4 02/10] bpf: btf: Validate type reference Martin KaFai Lau
2018-04-17 20:42 ` [PATCH bpf-next v4 03/10] bpf: btf: Check members of struct/union Martin KaFai Lau
2018-04-18 17:22   ` Jakub Kicinski
2018-04-18 18:01     ` Martin KaFai Lau
2018-04-18 18:30       ` Jakub Kicinski [this message]
2018-04-17 20:42 ` [PATCH bpf-next v4 04/10] bpf: btf: Add pretty print capability for data with BTF type info Martin KaFai Lau
2018-04-17 20:42 ` [PATCH bpf-next v4 05/10] bpf: btf: Add BPF_BTF_LOAD command Martin KaFai Lau
2018-04-17 20:42 ` [PATCH bpf-next v4 06/10] bpf: btf: Add BPF_OBJ_GET_INFO_BY_FD support to BTF fd Martin KaFai Lau
2018-04-17 20:42 ` [PATCH bpf-next v4 07/10] bpf: btf: Add pretty print support to the basic arraymap Martin KaFai Lau
2018-04-18 15:20   ` Daniel Borkmann
2018-04-18 17:05     ` Jakub Kicinski
2018-04-18 17:46     ` Martin KaFai Lau
2018-04-17 20:42 ` [PATCH bpf-next v4 08/10] bpf: btf: Sync bpf.h and btf.h to tools/ Martin KaFai Lau
2018-04-17 20:42 ` [PATCH bpf-next v4 09/10] bpf: btf: Add BTF support to libbpf Martin KaFai Lau
2018-04-17 20:42 ` [PATCH bpf-next v4 10/10] bpf: btf: Add BTF tests Martin KaFai Lau
2018-04-18 20:36 ` [PATCH bpf-next v4 00/10] BTF: BPF Type Format Daniel Borkmann

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=20180418113025.4ad5b9bd@cakuba.netronome.com \
    --to=kubakici@wp.pl \
    --cc=ast@fb.com \
    --cc=daniel@iogearbox.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox