Commit 94d83ea
bpf: Free special fields when update local storage maps with BPF_F_LOCK
When updating local storage maps with BPF_F_LOCK on the fast path, the
special fields were not freed after being replaced. This could cause
memory referenced by BPF_KPTR_{REF,PERCPU} fields to be held until the
map gets freed.
Similarly, on the other path, the old sdata's special fields were never
freed when BPF_F_LOCK was specified, causing the same issue.
Fix this by calling 'bpf_obj_free_fields()' after
'copy_map_value_locked()' to properly release the old fields.
Fixes: 9db44fd ("bpf: Support kptrs in local storage maps")
Signed-off-by: Leon Hwang <[email protected]>1 parent 4e29dc3 commit 94d83ea
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
609 | 609 | | |
610 | 610 | | |
611 | 611 | | |
| 612 | + | |
612 | 613 | | |
613 | 614 | | |
614 | 615 | | |
| |||
641 | 642 | | |
642 | 643 | | |
643 | 644 | | |
| 645 | + | |
644 | 646 | | |
645 | 647 | | |
646 | 648 | | |
| |||
0 commit comments