Skip to contentSkip to conversation

libbpf: skip bpf_object__probe_loading for light skeleton

PATCH Applied Stanislav Fomichev 2 participants 2 messages May 21, 2021 – May 24, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libbpf: skip bpf_object__probe_loading for light skeleton

I'm getting the following error when running 'gen skeleton -L' as regular user:

libbpf: Error in bpf_object__probe_loading():Operation not permitted(1). Couldn't load trivial BPF program. Make sure your kernel supports BPF (CONFIG_BPF_SYSCALL=y) and/or that RLIMIT_MEMLOCK is set to big enough value.

Fixes 67234743736a ("libbpf: Generate loader program out of BPF ELF file.")
---
 tools/lib/bpf/libbpf.c | 3 +++
 1 file changed, 3 insertions(+)
tools/lib/bpf/libbpf.c +3 -0
index dc4d5fe6d9d2..b396e45b17ea 100644
@@ -3971,6 +3971,9 @@ bpf_object__probe_loading(struct bpf_object *obj)
 	};
 	int ret;
 
+	if (obj->gen_loader)
+		return 0;
+
 	/* make sure basic loading works */
 
 	memset(&attr, 0, sizeof(attr));
Signature · 1 line
2.31.1.818.g46aad6cb9e-goog
#1 lore raw
This patch was applied to bpf/bpf-next.git (refs/heads/master):

Hello:

This patch was applied to bpf/bpf-next.git (refs/heads/master):

Quoted 9 lines · On Thu, 20 May 2021 20:06:53 -0700 you wrote:

I'm getting the following error when running 'gen skeleton -L' as regular user:

libbpf: Error in bpf_object__probe_loading():Operation not permitted(1). Couldn't load trivial BPF program. Make sure your kernel supports BPF (CONFIG_BPF_SYSCALL=y) and/or that RLIMIT_MEMLOCK is set to big enough value.

[...]

Here is the summary with links:
- [bpf-next] libbpf: skip bpf_object__probe_loading for light skeleton

    https://git.kernel.org/bpf/bpf-next/c/f9bceaa59c5c

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html