Re: [PATCH v2 bpf-next 2/7] libbpf: fix __arg_ctx type enforcement for perf_event programs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2024-01-25 at 12:55 -0800, Andrii Nakryiko wrote:
[...]

> @@ -6379,11 +6388,21 @@ static bool need_func_arg_type_fixup(const struct btf *btf, const struct bpf_pro
>  	/* special cases */
>  	switch (prog->type) {
>  	case BPF_PROG_TYPE_KPROBE:
> -	case BPF_PROG_TYPE_PERF_EVENT:
>  		/* `struct pt_regs *` is expected, but we need to fix up */
>  		if (btf_is_struct(t) && strcmp(tname, "pt_regs") == 0)
>  			return true;
>  		break;

Sorry, this was probably discussed, but I got lost a bit.
Kernel side does not change pt_regs for BPF_PROG_TYPE_KPROBE
(in ./kernel/bpf/btf.c:btf_validate_prog_ctx_type)
but here we do, why do it differently?

[...]





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux