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

[QUESTION] How to hot patch user space eBPF program? #309

Open
D1cestor opened this issue Jul 10, 2024 · 4 comments
Open

[QUESTION] How to hot patch user space eBPF program? #309

D1cestor opened this issue Jul 10, 2024 · 4 comments

Comments

@D1cestor
Copy link

First of all, nice work from you.

Let's say we have a user space eBPF program a.bpf.c running. Is it possible to update it to b.bpf.c without stopping the program a.bpf.c is hooking to?

I have checked tailcall_minimal but I found it confusing because I am not familiar with the eBPF byte code.

Thanks

@Officeyutong
Copy link
Contributor

If you mean to detach a userspace eBPF program, and then attach a new one:

  • Send SIGUSR1 to the process which was injected by agent, so agent will detach all attaches. See
    } else if (program.is_subcommand_used("detach")) {
    for details
  • Re-attach desired hooks

@D1cestor
Copy link
Author

Thanks for your reply.

I can detach the attaches but how do I re-attach a new hook?

I tried bpftime attach but it doesn't work.

image

@Officeyutong
Copy link
Contributor

Thanks for your reply.

I can detach the attaches but how do I re-attach a new hook?

I tried bpftime attach but it doesn't work.

image

After a glance at the source of frida-gum:

image

@D1cestor
Copy link
Author

The file did exist. Do I need to turn on some settings or grant some permissions?

image

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