https://bugs.kde.org/show_bug.cgi?id=451626

--- Comment #2 from Andreas Gerstmayr <andr...@gerstmayr.me> ---
(In reply to Mark Wielaard from comment #1)
> So there are two issues here:
> 
> - WARNING: unhandled eBPF command 35
>   This seems to be BPF_LINK_DETACH, which valgrind indeed doesn't handle.

Yep, that's fine so far. I'm more concerned about the error below.

> - Syscall param bpf(attr->raw_tracepoint.name) points to unaddressable
> byte(s)
>   Address 0x0 is not stack'd, malloc'd or (recently) free'd
>   This check is only done for BPF_RAW_TRACEPOINT_OPEN
>   It isn't immediately clear to me that is is allowed to be NULL.
> 
> Do you happen to have documentation which explains what
> BPF_RAW_TRACEPOINT_OPEN does when the name is NULL?

Good question :)
I looked in the caller, and it's quite explicit about setting the name to NULL:
https://github.com/libbpf/libbpf/blob/d6783c28b40e8355d2e3bd4a8141b88da7704f6d/src/libbpf.c#L10491

Then I looked into the syscall on the kernel side
(https://github.com/torvalds/linux/blob/56e337f2cf1326323844927a04e9dbce9a244835/kernel/bpf/syscall.c#L3042-L3056)
and it goes as far as erroring out if the name is set to anything other than
NULL with the following comment: "The attach point for this category of
programs should be specified via btf_id during program load."
A few lines later tp_name is set to prog->aux->attach_func_name.

prog->type is BPF_PROG_TYPE_TRACING in our case, I've verified that in the
bpf_program__attach_btf_id function on the libbpf side.
So afaics, when using BTF, only the raw_tracepoint.prog_fd should be set.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to