Commit 4ba67fa
bpf: Free special fields when update [lru_,]percpu_hash maps
As [lru_,]percpu_hash maps support BPF_KPTR_{REF,PERCPU}, missing
calls to 'bpf_obj_free_fields()' in 'pcpu_copy_value()' could cause the
memory referenced by BPF_KPTR_{REF,PERCPU} fields to be held until the
map gets freed.
Fix this by calling 'bpf_obj_free_fields()' after
'copy_map_value[,_long]()' in 'pcpu_copy_value()'.
Fixes: 65334e6 ("bpf: Support kptrs in percpu hashmap and percpu LRU hashmap")
Signed-off-by: Leon Hwang <[email protected]>1 parent 03f9e36 commit 4ba67fa
1 file changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
934 | 934 | | |
935 | 935 | | |
936 | 936 | | |
| 937 | + | |
| 938 | + | |
937 | 939 | | |
938 | 940 | | |
939 | | - | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
940 | 944 | | |
941 | 945 | | |
942 | 946 | | |
943 | 947 | | |
944 | 948 | | |
945 | | - | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
946 | 952 | | |
947 | 953 | | |
948 | 954 | | |
| |||
0 commit comments