-
Notifications
You must be signed in to change notification settings - Fork 424
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
Failure in argument name resolution results in empty value #3892
Comments
#3891 is not related though I did encounter these together. I tried your patch anyways, it doesn't seem to fix it. |
Hey @oshaked1, I’m currently working on recreating the issue but couldn’t reproduce it fully. Here's what I did step-by-step:
However, nothing was captured by Tracee during this process. Additional Details:
Let me know if there's anything specific I should test further, or if you have any suggestions for debugging this. |
@ShohamBit Use this code: import ctypes
import errno
import os
# BPF syscall number (x86_64 Linux)
SYS_BPF = 321 # Verify on your system, e.g., using `man syscall`
# Invalid BPF command
BPF_INVALID_CMD = 9999
# Load the libc shared library
libc = ctypes.CDLL("libc.so.6", use_errno=True)
# Prepare dummy arguments
arg1 = ctypes.c_void_p(0)
arg2 = ctypes.c_void_p(0)
arg3 = ctypes.c_void_p(0)
# Call the syscall
ret = libc.syscall(SYS_BPF, BPF_INVALID_CMD, arg1, arg2, arg3)
if ret == -1:
err = ctypes.get_errno()
print(f"Error: {os.strerror(err)} (errno={err})")
if err == errno.EINVAL:
print("As expected, got EINVAL for an invalid BPF command.")
else:
print("Unexpected error occurred.") |
Description
When tracee tries to resolve a numeric argument to a string (e.g. cmd value of bpf syscall), if the resolution fails, the event field will contain an empty string.
For example, running the following command, which uses a new eBPF feature not supported on my kernel:
sudo bpftool gen skeleton -L hello.bpf.o > hello.skel.h
Results in the following tracee event:
The strace output shows that this command is not supported, which explains why the resolution fails:
This is only one example of incorrect handling of failed name resolutions, another example I found is ptrace commands, and there are possibly many others.
An example of a correctly handled name resolution is the syscall name of sys_enter, where an unknown syscall will result in the syscall number as the value.
Output of
tracee version
:Output of
uname -a
:Additional details
The text was updated successfully, but these errors were encountered: