-
Notifications
You must be signed in to change notification settings - Fork 380
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
Add dynamic extraction of a parameter attribute #3143
base: main
Are you sure you want to change the base?
Changes from all commits
7e6600a
291d411
083e578
a4713ec
b66a26d
4c447f3
8c3b2c5
48549b3
fa9ea58
9ec44b4
135ade1
e80e73d
bd2b422
f817507
391c5a8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,6 +142,19 @@ struct selector_arg_filters { | |
__u32 argoff[5]; | ||
} __attribute__((packed)); | ||
|
||
struct config_btf_arg { | ||
__u32 offset; | ||
__u16 is_pointer; | ||
__u16 is_initialized; | ||
} __attribute__((packed)); | ||
|
||
struct extract_arg_data { | ||
struct config_btf_arg *btf_config; | ||
unsigned long *arg; | ||
}; | ||
|
||
#define MAX_BTF_ARG_DEPTH 10 | ||
|
||
struct event_config { | ||
__u32 func_id; | ||
__s32 arg0; | ||
|
@@ -172,6 +185,11 @@ struct event_config { | |
*/ | ||
__u32 policy_id; | ||
__u32 flags; | ||
struct config_btf_arg btf_arg0[MAX_BTF_ARG_DEPTH]; | ||
struct config_btf_arg btf_arg1[MAX_BTF_ARG_DEPTH]; | ||
struct config_btf_arg btf_arg2[MAX_BTF_ARG_DEPTH]; | ||
struct config_btf_arg btf_arg3[MAX_BTF_ARG_DEPTH]; | ||
struct config_btf_arg btf_arg4[MAX_BTF_ARG_DEPTH]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not follow the user space part and have just |
||
} __attribute__((packed)); | ||
|
||
#define MAX_ARGS_SIZE 80 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: cilium.io/v1alpha1 | ||
kind: TracingPolicy | ||
metadata: | ||
name: "lsm" | ||
spec: | ||
lsmhooks: | ||
- hook: "bprm_check_security" | ||
args: | ||
- index: 0 | ||
type: "linux_binprm" | ||
extractParam: "mm.owner.real_parent.real_parent.comm" | ||
overwriteType: "string" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need overwriteType? could we maybe just do something like:
the overwrite stuff might cause headaches later also maybe rename cc @kkourt |
||
selectors: | ||
- matchActions: | ||
- action: Post |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not follow the user space and have just
btf_arg[5][10]
I don't see
btf_arg[1-4]
being used anywhere