Commit 498f6e4
bpf: implement KF_IMPLICIT_PROG_AUX_ARG flag
Define KF_IMPLICIT_PROG_AUX_ARG and handle it in the BPF verifier.
The mechanism of patching is exactly the same as for __prog parameter
annotation: in check_kfunc_args() detect the relevant parameter and
remember regno in cur_aux(env)->arg_prog.
Then the (unchanged in this patch) fixup_kfunc_call() adds a mov
instruction to set the actual pointer to prog_aux.
The caveat for KF_IMPLICIT_PROG_AUX_ARG is in implicitness. We have to
separately check that the number of arguments is under
MAX_BPF_FUNC_REG_ARGS.
Signed-off-by: Ihor Solodrai <[email protected]>1 parent 2225dd1 commit 498f6e4
2 files changed
+39
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11948 | 11948 | | |
11949 | 11949 | | |
11950 | 11950 | | |
| 11951 | + | |
| 11952 | + | |
| 11953 | + | |
| 11954 | + | |
| 11955 | + | |
11951 | 11956 | | |
11952 | 11957 | | |
11953 | 11958 | | |
| |||
12029 | 12034 | | |
12030 | 12035 | | |
12031 | 12036 | | |
| 12037 | + | |
| 12038 | + | |
| 12039 | + | |
| 12040 | + | |
| 12041 | + | |
| 12042 | + | |
| 12043 | + | |
| 12044 | + | |
| 12045 | + | |
| 12046 | + | |
| 12047 | + | |
| 12048 | + | |
12032 | 12049 | | |
12033 | 12050 | | |
12034 | 12051 | | |
| |||
13050 | 13067 | | |
13051 | 13068 | | |
13052 | 13069 | | |
| 13070 | + | |
| 13071 | + | |
| 13072 | + | |
| 13073 | + | |
| 13074 | + | |
| 13075 | + | |
| 13076 | + | |
| 13077 | + | |
| 13078 | + | |
| 13079 | + | |
| 13080 | + | |
| 13081 | + | |
| 13082 | + | |
| 13083 | + | |
| 13084 | + | |
13053 | 13085 | | |
13054 | 13086 | | |
13055 | 13087 | | |
| |||
13066 | 13098 | | |
13067 | 13099 | | |
13068 | 13100 | | |
| 13101 | + | |
13069 | 13102 | | |
13070 | | - | |
13071 | | - | |
13072 | | - | |
13073 | | - | |
13074 | | - | |
13075 | | - | |
13076 | | - | |
| 13103 | + | |
| 13104 | + | |
| 13105 | + | |
13077 | 13106 | | |
13078 | 13107 | | |
13079 | 13108 | | |
| |||
0 commit comments