Is it possible to modify const parameters of a function using ebpf uprobes?

47 views Asked by At

I am trying to modify the behaviour of a function from a shared library during runtime using eBPF uprobes. Is there any way to change a const char* parameter of the function when the function is called?

1

There are 1 answers

1
pchaigno On BEST ANSWER

Is there any way to change a const char* parameter of the function when the function is called?

The const qualifier is for the compiler; it doesn't impact how you can instrument the code at runtime.

You can write such parameters with the bpf_probe_write_user BPF helper. See samples/bpf/test_probe_write_user.bpf.c for a usage example of that helper (with kprobes but the principle should be the same for uprobes).