summaryrefslogtreecommitdiffstats
path: root/kernel/bpf/map_in_map.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/bpf/map_in_map.c')
-rw-r--r--kernel/bpf/map_in_map.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/bpf/map_in_map.c b/kernel/bpf/map_in_map.c
index 7cce2047c6ef..38136ec4e095 100644
--- a/kernel/bpf/map_in_map.c
+++ b/kernel/bpf/map_in_map.c
@@ -68,6 +68,11 @@ struct bpf_map *bpf_map_meta_alloc(int inner_map_ufd)
}
inner_map_meta->field_offs = field_offs;
}
+ /* Note: We must use the same BTF, as we also used btf_record_dup above
+ * which relies on BTF being same for both maps, as some members like
+ * record->fields.list_head have pointers like value_rec pointing into
+ * inner_map->btf.
+ */
if (inner_map->btf) {
btf_get(inner_map->btf);
inner_map_meta->btf = inner_map->btf;