> On Feb 23, 2021, at 11:23 AM, Martin Lau <ka...@fb.com> wrote: > > On Mon, Feb 22, 2021 at 05:20:09PM -0800, Song Liu wrote: > [ ... ] > >> diff --git a/kernel/bpf/bpf_task_storage.c b/kernel/bpf/bpf_task_storage.c >> index e0da0258b732d..2034019966d44 100644 >> --- a/kernel/bpf/bpf_task_storage.c >> +++ b/kernel/bpf/bpf_task_storage.c >> @@ -15,7 +15,6 @@ >> #include <linux/bpf_local_storage.h> >> #include <linux/filter.h> >> #include <uapi/linux/btf.h> >> -#include <linux/bpf_lsm.h> >> #include <linux/btf_ids.h> >> #include <linux/fdtable.h> >> >> @@ -24,12 +23,8 @@ DEFINE_BPF_STORAGE_CACHE(task_cache); >> static struct bpf_local_storage __rcu **task_storage_ptr(void *owner) >> { >> struct task_struct *task = owner; >> - struct bpf_storage_blob *bsb; >> >> - bsb = bpf_task(task); >> - if (!bsb) >> - return NULL; > task_storage_ptr() no longer returns NULL. All "!task_storage_ptr(task)" > checks should be removed also. e.g. In bpf_task_storage_get > and bpf_pid_task_storage_update_elem. Good catch! Fixed it in v5. Thanks, Song > >> - return &bsb->storage; >> + return &task->bpf_storage; >> } >>
- Re: [PATCH v4 bpf-next 2/6] bpf: prevent deadlock ... Andrii Nakryiko
- Re: [PATCH v4 bpf-next 2/6] bpf: prevent deadl... Song Liu
- Re: [PATCH v4 bpf-next 2/6] bpf: prevent d... Andrii Nakryiko
- Re: [PATCH v4 bpf-next 2/6] bpf: preve... Alexei Starovoitov
- Re: [PATCH v4 bpf-next 2/6] bpf: prevent deadlock ... Peter Zijlstra
- [PATCH v4 bpf-next 1/6] bpf: enable task local storage ... Song Liu
- Re: [PATCH v4 bpf-next 1/6] bpf: enable task local... kernel test robot
- Re: [PATCH v4 bpf-next 1/6] bpf: enable task local... kernel test robot
- Re: [PATCH v4 bpf-next 1/6] bpf: enable task local... Martin KaFai Lau
- Re: [PATCH v4 bpf-next 1/6] bpf: enable task l... Song Liu
- [PATCH v4 bpf-next 6/6] bpf: runqslower: use task local... Song Liu
- Re: [PATCH v4 bpf-next 6/6] bpf: runqslower: use t... Martin KaFai Lau
- [PATCH v4 bpf-next 4/6] selftests/bpf: test deadlock fr... Song Liu
- [PATCH v4 bpf-next 3/6] selftests/bpf: add non-BPF_LSM ... Song Liu
- [PATCH v4 bpf-next 5/6] bpf: runqslower: prefer using l... Song Liu
- Re: [PATCH v4 bpf-next 5/6] bpf: runqslower: prefe... Andrii Nakryiko
- Re: [PATCH v4 bpf-next 5/6] bpf: runqslower: prefe... Martin KaFai Lau