-
Notifications
You must be signed in to change notification settings - Fork 431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reported events timestamp is wrong #4505
Comments
@NDStrahilevitz we need to enlarge the scope to consider returning other errors as well. @rscampos FYI. Lines 389 to 397 in a215fa6
|
Folks, I took ownership of this issue since I worked on this in the past. Figure out the issue... libbpf checks I'll rework the libbpfgo func BPFHelperIsSupported since we need a way to warn user when the users don't have permission. |
@rscampos I believe it's an issue in the libbpf itself which is propagating the errno not related to the scope called. The helper that attempts to get the kernel version and fails (trying for Ubuntu), should clear errno, since it doesn't fail - it has a fallback to get the release from uname: strstr from Debian helper doesn't set errno, sscanf is successful and probably doesn't touch erro then. The code path is keeping errno tainted when it should be cleared. |
Thank you for this analysis, I agree with you - the fact the libbpf don't clear the errno and also, the fact that we relied in the errno in libbpfgo and return it direct to the user was the root cause of the Tracee issue reported by Yaniv. Besides that, in the end, the only errno which matters for us was is if the user has or not privilege (in order to execute the probe). Take a look on bpftool: So the ideia, for libbpfgo, is only rely in errno if is EPERM. If its the case, we return EPERM to user. (Let me validate this idea in practice). |
I agree, but keep in mind that as they don't clear errno out... other errno could be set as:
In other words, consider that it might be tainted with EPERM in a way not expected. Consider to raise a fix to libbpf as a continuation of the libbpfgo fix. 👍🏼 |
Description
Reported timestamp is incorrect.
It was found that tracee is incorrectly using monotonic clock in userspace and boot time clock in bpf code.
During tracee initialization, this code is called:
Running with this debug print message returns: supported: false, innerErr: operation failed for function
ktime_get_boot_ns
with program typeBPF_PROG_TYPE_KPROBE
: no such file or directoryOutput of
tracee version
:Output of
uname -a
:Additional details
The text was updated successfully, but these errors were encountered: