Skip to content
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

opensnoop on ARM64 fails to read filename #2253

Open
joelagnel opened this issue Mar 5, 2019 · 6 comments
Open

opensnoop on ARM64 fails to read filename #2253

joelagnel opened this issue Mar 5, 2019 · 6 comments

Comments

@joelagnel
Copy link
Contributor

BCC's eBPF-based opensnoop tool [1] installs a
kprobe on do_sys_open to monitor calls to the open syscall globally.

do_sys_open() has prototype:

long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode);

This causes a "blank" filename to be displayed by opensnoop when I run it on
my Pixel 3 (arm64), possibly because this is a user pointer. However, it
works fine on x86-64.

So it seems to me that on arm64, reading user pointers directly still doesn't
work even if there is a distinction between user/kernel addresses. In that
case reading the user pointer using user accessors (possibly using
bpf_probe_user_read helper) should be needed to fix this issue

@joelagnel
Copy link
Contributor Author

(this is being discussed upstream and Yonghong will fix it upstream, I just opened it here to track it)

@joelagnel joelagnel changed the title opensnoop on ARM fails to read filename opensnoop on ARM64 fails to read filename Mar 5, 2019
@yonghong-song
Copy link
Collaborator

Looks like this is the case. https://lkml.org/lkml/2019/2/28/1369
I am working on this now.

@joelagnel
Copy link
Contributor Author

Yonghong, any updates on this? Thanks a lot.

@yonghong-song
Copy link
Collaborator

yonghong-song commented Apr 4, 2019 via email

@joelagnel
Copy link
Contributor Author

joelagnel commented Apr 4, 2019 via email

@yonghong-song
Copy link
Collaborator

yonghong-song commented Apr 4, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants