All of lore.kernel.org
 help / color / mirror / Atom feed
From: KP Singh <kpsingh@kernel.org>
To: bpf@vger.kernel.org
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	Martin KaFai Lau <kafai@fb.com>
Subject: [PATCH v2 bpf-next 0/2] Sleepable local storage
Date: Mon,  6 Dec 2021 15:19:07 +0000	[thread overview]
Message-ID: <20211206151909.951258-1-kpsingh@kernel.org> (raw)

Local storage is currently unusable in sleepable helpers. One of the
important use cases of local_storage is to attach security (or
performance) contextual information to kernel objects in LSM / tracing
programs to be used later in the life-cyle of the object.

Sometimes this context can only be gathered from sleepable programs
(because it needs accesing __user pointers or helpers like
bpf_ima_inode_hash). Allowing local storage to be used from sleepable
programs allows such context to be managed with the benefits of
local_storage.

# v1 -> v2

* Generalize RCU checks (will send a separate patch for updating
  non local storage code where this can be used).
* Add missing RCU lock checks from v1

KP Singh (2):
  bpf: Allow bpf_local_storage to be used by sleepable programs
  bpf/selftests: Update local storage selftest for sleepable programs

 include/linux/bpf_local_storage.h             |  5 ++
 kernel/bpf/bpf_inode_storage.c                |  9 +++-
 kernel/bpf/bpf_local_storage.c                | 51 ++++++++++++++-----
 kernel/bpf/bpf_task_storage.c                 |  9 +++-
 kernel/bpf/verifier.c                         |  3 ++
 net/core/bpf_sk_storage.c                     |  8 ++-
 .../bpf/prog_tests/test_local_storage.c       | 20 +++-----
 .../selftests/bpf/progs/local_storage.c       | 24 ++-------
 8 files changed, 77 insertions(+), 52 deletions(-)

-- 
2.34.1.400.ga245620fadb-goog


             reply	other threads:[~2021-12-06 15:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-06 15:19 KP Singh [this message]
2021-12-06 15:19 ` [PATCH v2 bpf-next 1/2] bpf: Allow bpf_local_storage to be used by sleepable programs KP Singh
2021-12-08  7:42   ` Martin KaFai Lau
2021-12-09  1:59   ` Martin KaFai Lau
2021-12-09  2:18     ` KP Singh
2021-12-09  7:00       ` Martin KaFai Lau
2021-12-20 18:59         ` Martin KaFai Lau
2021-12-22  4:43           ` KP Singh
2021-12-24 14:38         ` KP Singh
2021-12-06 15:19 ` [PATCH v2 bpf-next 2/2] bpf/selftests: Update local storage selftest for " KP Singh
2021-12-09  2:10   ` Martin KaFai Lau

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=20211206151909.951258-1-kpsingh@kernel.org \
    --to=kpsingh@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kafai@fb.com \
    --cc=paulmck@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.