linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: KP Singh <kpsingh@chromium.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
	open list <linux-kernel@vger.kernel.org>,
	bpf <bpf@vger.kernel.org>, Alexei Starovoitov <ast@kernel.org>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Paul Turner <pjt@google.com>,
	Pauline Middelink <middelin@google.com>
Subject: Re: [PATCH bpf-next 1/2] bpf: Add bpf_lsm_set_bprm_opts helper
Date: Mon, 16 Nov 2020 15:00:09 -0800	[thread overview]
Message-ID: <CAADnVQ+6zXX0V8Qn7VOrdgcVVjgbyTEguAKpqkwvW4b3spSHYw@mail.gmail.com> (raw)
In-Reply-To: <CACYkzJ6U3PNZ0w5ryeWbyTi0NfSLg241iHMHz-b8mrDdsgfkfw@mail.gmail.com>

On Mon, Nov 16, 2020 at 2:48 PM KP Singh <kpsingh@chromium.org> wrote:
>
> [...]
>
> > >
> > > +BPF_CALL_2(bpf_lsm_set_bprm_opts, struct linux_binprm *, bprm, u64, flags)
> > > +{
> >
> > This should also reject invalid flags. I'd rather change this helper from RET_VOID
> > to RET_INTEGER and throw -EINVAL for everything other than BPF_LSM_F_BPRM_SECUREEXEC
> > passed in here including zero so it can be extended in future.
>
> Sounds good, I added:
>
>  enum {
>         BPF_LSM_F_BPRM_SECUREEXEC       = (1ULL << 0),
> +       /* Mask for all the currently supported BPRM options */
> +       BPF_LSM_F_BRPM_OPTS_MASK        = 0x1ULL,
>  };

No need to add it to uapi.
Keep it next to the helper in .c file like it's done with other flags.

      parent reply	other threads:[~2020-11-16 23:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16 14:01 [PATCH bpf-next 1/2] bpf: Add bpf_lsm_set_bprm_opts helper KP Singh
2020-11-16 14:01 ` [PATCH bpf-next 2/2] bpf: Add tests for bpf_lsm_set_bprm_opts KP Singh
2020-11-16 14:49   ` KP Singh
2020-11-16 15:11 ` [PATCH bpf-next 1/2] bpf: Add bpf_lsm_set_bprm_opts helper Daniel Borkmann
2020-11-16 22:48   ` KP Singh
2020-11-16 22:52     ` KP Singh
2020-11-16 23:00     ` Alexei Starovoitov [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=CAADnVQ+6zXX0V8Qn7VOrdgcVVjgbyTEguAKpqkwvW4b3spSHYw@mail.gmail.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kafai@fb.com \
    --cc=kpsingh@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=middelin@google.com \
    --cc=pjt@google.com \
    --cc=songliubraving@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).