Skip to content

Commit 0a003a5

Browse files
AsphalttKernel Patches Daemon
authored andcommitted
bpf, x64: Add union argument support in trampoline
As verifier allows functions with 'union' argument can be traced, add 'union' arguments support in trampoline if the argument's size is in range '(8, 16]'. Signed-off-by: Leon Hwang <[email protected]>
1 parent eafcaa1 commit 0a003a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/net/bpf_jit_comp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3164,7 +3164,7 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *rw_im
31643164

31653165
/* extra registers for struct arguments */
31663166
for (i = 0; i < m->nr_args; i++) {
3167-
if (m->arg_flags[i] & BTF_FMODEL_STRUCT_ARG)
3167+
if (m->arg_flags[i] & (BTF_FMODEL_STRUCT_ARG | BTF_FMODEL_UNION_ARG))
31683168
nr_regs += (m->arg_size[i] + 7) / 8 - 1;
31693169
}
31703170

0 commit comments

Comments
 (0)