All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: David Miller <davem@davemloft.net>
Cc: alexei.starovoitov@gmail.com, ast@fb.com, netdev@vger.kernel.org
Subject: Re: bpf pointer alignment validation
Date: Wed, 10 May 2017 18:21:50 +0200	[thread overview]
Message-ID: <59133E1E.8060208@iogearbox.net> (raw)
In-Reply-To: <20170510.115720.1396306489898364855.davem@davemloft.net>

On 05/10/2017 05:57 PM, David Miller wrote:
> From: Daniel Borkmann <daniel@iogearbox.net>
> Date: Wed, 10 May 2017 17:51:50 +0200
>
>> Would probably be good nevertheless to have this as a flag for
>> program loads, which gets then passed through to the verifier to
>> explicitly enable strict alignment checks.
>>
>> Might certainly aide developing & testing programs on archs with
>> efficient unaligned access and later actually running them on archs
>> that don't have it. (And at minimum, it also helps for checking
>> the test suite against the verifier.)
>
> Ok, I can implement this flag.
>
> The only question is where to put it?  An unused bit in the program
> type? :-)

See for example 7f677633379b ("bpf: introduce BPF_F_ALLOW_OVERRIDE
flag"). We can add a flags field to the prog loading part of union
bpf_attr; we would need to make sure to update BPF_PROG_LOAD_LAST_FIELD
to the new member, and to reject unknown flags, of course. Then the
syscall will handle compat with older binaries just fine by design,
the main bpf syscall code and CHECK_ATTR() macros will ensure this
(backward compat, and to a limited degree also forward compat).

  parent reply	other threads:[~2017-05-10 16:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-05 20:20 bpf pointer alignment validation David Miller
2017-05-06  2:47 ` David Miller
2017-05-08 10:49   ` Daniel Borkmann
2017-05-08 15:04     ` David Miller
2017-05-09 18:32     ` David Miller
2017-05-10  5:57       ` Alexei Starovoitov
2017-05-10 11:12         ` David Laight
2017-05-10 15:33         ` David Miller
2017-05-10 15:51           ` Daniel Borkmann
2017-05-10 15:57             ` David Miller
2017-05-10 16:15               ` Alexei Starovoitov
2017-05-10 16:21               ` Daniel Borkmann [this message]
2017-05-10 16:45                 ` David Miller
2017-05-08 17:30   ` Alexei Starovoitov

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=59133E1E.8060208@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=alexei.starovoitov@gmail.com \
    --cc=ast@fb.com \
    --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 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.