-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
ubuntu snap uprobes not working #829
Comments
iirc the BEGIN probe is a This doesn't work with snap either, it just doesn't print:
Stracing that shows a segv
In a vagrant vm:
|
dmesg output when I try to run bashreadline.bt with snap installed from snap:
The BEGIN probe is working here though:
But the
Everything works fine if I use bpftrace built from source. Nothing is reported to dmesg. |
I copied
It works. Seems like the snap doesn't have enough privilege to access /bin/bash. bcc snapcraft has two interfaces we don't have in bpftrace: @ColinIanKing any suggestions? Also, do you mind adding the snapcraft files to this repository (as we have in bcc)? |
Currently on vacation. I'll look into this and get back to you.
…On Wed, 17 Jul 2019, 20:09 Matheus Marchini, ***@***.***> wrote:
I copied bash to my home directory, and tried tracing it instead:
$ sudo /snap/bin/bpftrace -e 'uretprobe:/home/mmarchini/bash:readline { printf("test %s\n", str(retval)); }'
Attaching 1 probe...
test asd
test foo
It works. Seems like the snap doesn't have enough privilege to access
/bin/bash. bcc snapcraft has two interfaces we don't have in bpftrace:
mount-observe and system-observe. Not sure if adding those will fix the
issue, but it's worth a shot. There's also system-files, which might make
sense since we have things like cat which should be able to read any file
the user running bpftrace has access to.
@ColinIanKing <https://github.com/ColinIanKing> any suggestions? Also, do
you mind adding the snapcraft files to this repository (as we have in bcc
<https://github.com/iovisor/bcc/tree/master/snapcraft>)?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#829>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACHCRL5Q7QJ6KTFD45ZEUALP75U5JANCNFSM4IEHXOVA>
.
|
@ColinIanKing poke |
@ColinIanKing do you have time to look at this? Would be good to hook this into the CI so that we can publish new releases. If you don't have time I can give it a try. |
I'm going to try and schedule time time in this week to sort this out. If I can't I'll let you know ASAP. |
bpftrace invoked via snap will create its own mount namespace and do pivot_root. Host's So, this rewrote version of
root@ubuntu-bionic:~# /snap/bin/bpftrace bashreadline.bt
Attaching 2 probes...
Tracing bash commands... Hit Ctrl-C to end.
TIME PID COMMAND
09:28:57 5259 pwd
09:29:00 5259 ls -l
09:29:06 5259 ping 8.8.8.8 This is the restriction of snap. |
The snap packaging hasn't been updated in a few years. It also had some issues with the sandboxing (see bpftrace#829). Now that we have our own portable mechanism via appimages (4c24ee9), let's just delete snap support.
Closing as it seems we removed support for snap. |
Trying on Ubuntu Bionic:
The /snap/bin version isn't picking up the events.
There are other differences with the snap version as well: I took a quick look with strace and saw that the snap version calls clone(2) six times on startup (why? not easy to answer: stacks are broken), whereas the normal build does not. I also noticed we're calling more clone(2) than necessary due to resolve_binary_path() from semantic analyzer -- for this particular tool -- but that's a bpftrace problem.
I can get more detail using bpftool(8), but that's better with a newer kernel than this 4.15.
The text was updated successfully, but these errors were encountered: