diff options
| author | Cong Wang <[email protected]> | 2024-06-02 18:27:03 +0000 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2024-06-03 16:16:19 +0000 |
| commit | 2884dc7d08d98a89d8d65121524bb7533183a63a (patch) | |
| tree | 2ba0a318481cbdc9dd240af512fc8563635c3354 /drivers/net/ethernet/intel/ice/ice_lib.c | |
| parent | bpf, devmap: Remove unnecessary if check in for loop (diff) | |
| download | kernel-2884dc7d08d98a89d8d65121524bb7533183a63a.tar.gz kernel-2884dc7d08d98a89d8d65121524bb7533183a63a.zip | |
bpf: Fix a potential use-after-free in bpf_link_free()
After commit 1a80dbcb2dba, bpf_link can be freed by
link->ops->dealloc_deferred, but the code still tests and uses
link->ops->dealloc afterward, which leads to a use-after-free as
reported by syzbot. Actually, one of them should be sufficient, so
just call one of them instead of both. Also add a WARN_ON() in case
of any problematic implementation.
Fixes: 1a80dbcb2dba ("bpf: support deferring bpf_link dealloc to after RCU grace period")
Reported-by: [email protected]
Signed-off-by: Cong Wang <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_lib.c')
0 files changed, 0 insertions, 0 deletions
