bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 bpf-next 0/2] Sleepable local storage
@ 2021-12-24 15:29 KP Singh
  2021-12-24 15:29 ` [PATCH v3 bpf-next 1/2] bpf: Allow bpf_local_storage to be used by sleepable programs KP Singh
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: KP Singh @ 2021-12-24 15:29 UTC (permalink / raw)
  To: bpf
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Paul E. McKenney, Martin KaFai Lau

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.

# v2 -> v3

* Fixed some RCU issues pointed by Martin
* Added Martin's ack

# 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                |  6 ++-
 kernel/bpf/bpf_local_storage.c                | 50 ++++++++++++++-----
 kernel/bpf/bpf_task_storage.c                 |  6 ++-
 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, 73 insertions(+), 49 deletions(-)

-- 
2.34.1.448.ga2b2bfdf31-goog


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-12-30  2:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-24 15:29 [PATCH v3 bpf-next 0/2] Sleepable local storage KP Singh
2021-12-24 15:29 ` [PATCH v3 bpf-next 1/2] bpf: Allow bpf_local_storage to be used by sleepable programs KP Singh
2021-12-28 23:58   ` Martin KaFai Lau
2021-12-24 15:29 ` [PATCH v3 bpf-next 2/2] bpf/selftests: Update local storage selftest for " KP Singh
2021-12-30  2:02 ` [PATCH v3 bpf-next 0/2] Sleepable local storage Alexei Starovoitov

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).