new: uprobe OverrideCall action#4990
Conversation
✅ Deploy Preview for tetragon ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Also, update `hasEnforcementActions` with the new `HasOverrideCall`. Check only for uprobes since `OverrideCall` is only supported for them. Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
We treat OverrideCall just like a specific case of Override action. We are just going to override the instruction pointer register with the address of the desired function, after all. Following the above, ebpf `regs_map` was expanded to 2 elements: * [0] is for ActionTypeOverride registers * [1] is for ActionTypeOverrideCall registers Basically, we compute the correct address we need to jump to by: * computing the diff between real symbol being called and new symbol to be called * intrument the intruction pointer register as an `ASM_ASSIGNMENT_TYPE_REG_OFF` This way, we ask the uprobe code to jump from current instruction ptr (that is at entry of symbol being traced) to instruction ptr + diff(real symbol, new symbol) and we reach new symbol. Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
38275dc to
709198c
Compare
As we've seen in the userspace commit, OverrideCall action is treated exactly like an override. Remember that we need to avoid `write_reg` outside of offload context, or verifier will fail. Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
709198c to
5a3fa99
Compare
|
Thanks @mtardy for the pointer, didn't notice that PR had a new |
|
Not sure what this PR is doing but the overall shape of the clearGoString override is: |
|
Interesting! A few comments.
Does this mean a security team needs to pre-compile and seed the binary?
|
Yes, exactly. In case the binary is going to be stripped, one can provide directly the
Yes; this is mostly an initial feature set, of course. We can expand it later! |
Description
This PR introduces a new Action for uprobes:
OverrideCall. It allows to route the uprobesymbolcalls to the specifiednewSymbolsymbol.Shortcomings:
OverrideandOverrideCallis unsupported (makes no sense anyway); but the code to support it is there, the mixing only gets gated behind a conditional checkChangelog