diff options
| author | Dave Airlie <airlied@redhat.com> | 2021-01-25 14:35:44 +1000 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2021-01-25 14:35:44 +1000 |
| commit | bc96ad6722f86a377ed2872c9a4854c90caf78ca (patch) | |
| tree | ece8859165a1faa10e4e2203d231fc7e87925139 /kernel/bpf/bpf_task_storage.c | |
| parent | d82afcf9caaac26ce2642511115bca9dacf30f41 (diff) | |
| parent | 6ee1d745b7c9fd573fba142a2efdad76a9f1cb04 (diff) | |
Merge tag 'v5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into drm-next
Backmerge v5.11-rc5 into drm-next to clean up a bunch of conflicts we are dragging around.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'kernel/bpf/bpf_task_storage.c')
| -rw-r--r-- | kernel/bpf/bpf_task_storage.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/bpf/bpf_task_storage.c b/kernel/bpf/bpf_task_storage.c index 4ef1959a78f2..e0da0258b732 100644 --- a/kernel/bpf/bpf_task_storage.c +++ b/kernel/bpf/bpf_task_storage.c @@ -218,7 +218,7 @@ BPF_CALL_4(bpf_task_storage_get, struct bpf_map *, map, struct task_struct *, * bpf_local_storage_update expects the owner to have a * valid storage pointer. */ - if (!task_storage_ptr(task)) + if (!task || !task_storage_ptr(task)) return (unsigned long)NULL; sdata = task_storage_lookup(task, map, true); @@ -243,6 +243,9 @@ BPF_CALL_4(bpf_task_storage_get, struct bpf_map *, map, struct task_struct *, BPF_CALL_2(bpf_task_storage_delete, struct bpf_map *, map, struct task_struct *, task) { + if (!task) + return -EINVAL; + /* This helper must only be called from places where the lifetime of the task * is guaranteed. Either by being refcounted or by being protected * by an RCU read-side critical section. |