mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
add infrastructure for tagging functions as error injectable
Using BPF we can override kprob'ed functions and return arbitrary values. Obviously this can be a bit unsafe, so make this feature opt-in for functions. Simply tag a function with KPROBE_ERROR_INJECT_SYMBOL in order to give BPF access to that function for error injection purposes. Signed-off-by: Josef Bacik <jbacik@fb.com> Acked-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
parent
a23967c181
commit
92ace9991d
6 changed files with 195 additions and 1 deletions
|
@ -475,6 +475,11 @@ struct module {
|
|||
ctor_fn_t *ctors;
|
||||
unsigned int num_ctors;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BPF_KPROBE_OVERRIDE
|
||||
unsigned int num_kprobe_ei_funcs;
|
||||
unsigned long *kprobe_ei_funcs;
|
||||
#endif
|
||||
} ____cacheline_aligned __randomize_layout;
|
||||
#ifndef MODULE_ARCH_INIT
|
||||
#define MODULE_ARCH_INIT {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue