diff options
author | 2025-01-08 09:07:21 +0800 | |
---|---|---|
committer | 2025-01-08 18:06:36 -0800 | |
commit | 090d7f2e640b265335ac0a5a8e09a99f7f28f567 (patch) | |
tree | f62ffd39e42e0fdb9a6026667751d81f33aac2e8 /scripts/generate_rust_analyzer.py | |
parent | bpf: Disable migration when cloning sock storage (diff) | |
download | wireguard-linux-090d7f2e640b265335ac0a5a8e09a99f7f28f567.tar.xz wireguard-linux-090d7f2e640b265335ac0a5a8e09a99f7f28f567.zip |
bpf: Disable migration in bpf_selem_free_rcu
bpf_selem_free_rcu() calls bpf_obj_free_fields() to free the special
fields in map value (e.g., kptr). Since kptrs may be allocated from bpf
memory allocator, migrate_{disable|enable} pairs are necessary for the
freeing of these kptrs.
To simplify reasoning about when migrate_disable() is needed for the
freeing of these dynamically-allocated kptrs, let the caller to
guarantee migration is disabled before invoking bpf_obj_free_fields().
Therefore, the patch adds migrate_{disable|enable} pair in
bpf_selem_free_rcu(). The migrate_{disable|enable} pairs in the
underlying implementation of bpf_obj_free_fields() will be removed by
the following patch.
Signed-off-by: Hou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20250108010728.207536-10-houtao@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
0 files changed, 0 insertions, 0 deletions