-
由 Shuyi Cheng 提交于
mainline inclusion from mainline-5.17-rc1 commit 229fae38 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I5EUVD CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=229fae38d0fc0d6ff58d57cbeb1432da55e58d4f ------------------------------------------------- Fix error: "failed to pin map: Bad file descriptor, path: /sys/fs/bpf/_rodata_str1_1." In the old kernel, the global data map will not be created, see [0]. So we should skip the pinning of the global data map to avoid bpf_object__pin_maps returning error. Therefore, when the map is not created, we mark “map->skipped" as true and then check during relocation and during pinning. Fixes: 16e0c35c ("libbpf: Load global data maps lazily on legacy kernels") Signed-off-by: NShuyi Cheng <chengshuyi@linux.alibaba.com> Signed-off-by: NAndrii Nakryiko <andrii@kernel.org> (cherry picked from commit 229fae38) Signed-off-by: NWang Yufen <wangyufen@huawei.com> Conflicts: tools/lib/bpf/libbpf.c Signed-off-by: NWang Yufen <wangyufen@huawei.com>
66648b66