bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: KP Singh <kpsingh@kernel.org>
Cc: bpf <bpf@vger.kernel.org>, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Florent Revest <revest@chromium.org>,
	Brendan Jackman <jackmanb@chromium.org>
Subject: Re: [PATCH bpf-next v2 0/2] BPF Ringbuffer + Sleepable Programs
Date: Thu, 4 Feb 2021 23:06:32 -0800	[thread overview]
Message-ID: <CAEf4BzaJ6Pt5UAEoD9pOMKbmz+n=tV7gvZus59bSDNExQc3F8w@mail.gmail.com> (raw)
In-Reply-To: <20210204193622.3367275-1-kpsingh@kernel.org>

On Thu, Feb 4, 2021 at 11:36 AM KP Singh <kpsingh@kernel.org> wrote:
>
> # v1 -> v2
>
> - Use ring_buffer__consume without BPF_RB_FORCE_WAKEUP as suggested by
>   Andrii
> - Use ASSERT_OK_PTR macro
>
> Sleepable programs currently do not have access to any ringbuffer and
> since the perf ring buffer is a per-cpu map, it would not be trivial to
> enable for sleepable programs. Our specific use-case is to use the
> bpf_ima_inode_hash helper and write the hash to a ring buffer from a
> sleepable LSM hook.
>
> This series allows the BPF ringbuffer to be used in sleepable programs
> (tracing and lsm). Since the helper prototypes were already exposed
> the only change required was have the verifier allow
> BPF_MAP_TYPE_RINGBUF for sleepable programs. The ima test is also
> modified to use the ringbuffer instead of global variables.
>
> Based on dicussions we had over the BPF office hours and enabling all
> the possible debug options, I could not find any issues or warnings when
> using the ring buffer from sleepable programs.
>
>
>
> KP Singh (2):
>   bpf: Allow usage of BPF ringbuffer in sleepable programs
>   bpf/selftests: Update the IMA test to use BPF ring buffer
>
>  kernel/bpf/verifier.c                         |  2 ++
>  .../selftests/bpf/prog_tests/test_ima.c       | 23 ++++++++++---
>  tools/testing/selftests/bpf/progs/ima.c       | 33 ++++++++++++++-----
>  3 files changed, 45 insertions(+), 13 deletions(-)
>
> --
> 2.30.0.365.g02bc693789-goog
>

Bot didn't send a notification. This was applied to bpf-next.

      parent reply	other threads:[~2021-02-05  7:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04 19:36 [PATCH bpf-next v2 0/2] BPF Ringbuffer + Sleepable Programs KP Singh
2021-02-04 19:36 ` [PATCH bpf-next v2 1/2] bpf: Allow usage of BPF ringbuffer in sleepable programs KP Singh
2021-02-04 20:57   ` Song Liu
2021-02-05  1:15     ` Andrii Nakryiko
2021-02-04 19:36 ` [PATCH bpf-next v2 2/2] bpf/selftests: Update the IMA test to use BPF ring buffer KP Singh
2021-02-05  7:06 ` Andrii Nakryiko [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='CAEf4BzaJ6Pt5UAEoD9pOMKbmz+n=tV7gvZus59bSDNExQc3F8w@mail.gmail.com' \
    --to=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=jackmanb@chromium.org \
    --cc=kpsingh@kernel.org \
    --cc=revest@chromium.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;
as well as URLs for NNTP newsgroup(s).