Commit 42f39ed
bpf: Free special fields when update hash maps with BPF_F_LOCK
When updating hash maps with BPF_F_LOCK, 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.
Fix this by calling 'check_and_free_fields()' after
'copy_map_value_locked()' to properly release the old fields.
Fixes: 14a324f ("bpf: Wire up freeing of referenced kptr")
Signed-off-by: Leon Hwang <[email protected]>1 parent 8b81aac commit 42f39ed
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1124 | 1124 | | |
1125 | 1125 | | |
1126 | 1126 | | |
| 1127 | + | |
1127 | 1128 | | |
1128 | 1129 | | |
1129 | 1130 | | |
| |||
1152 | 1153 | | |
1153 | 1154 | | |
1154 | 1155 | | |
| 1156 | + | |
1155 | 1157 | | |
1156 | 1158 | | |
1157 | 1159 | | |
| |||
0 commit comments