Re: [PATCH v2 bpf-next 3/5] bpf: Allow kfuncs to be used in LSM programs

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

 



On Tue, Jun 21, 2022 at 06:58:09AM IST, KP Singh wrote:
> In preparation for the addition of bpf_getxattr kfunc.
>
> Signed-off-by: KP Singh <kpsingh@xxxxxxxxxx>
> ---
>  kernel/bpf/btf.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
> index 02d7951591ae..541cf4635aa1 100644
> --- a/kernel/bpf/btf.c
> +++ b/kernel/bpf/btf.c
> @@ -7264,6 +7264,7 @@ static int bpf_prog_type_to_kfunc_hook(enum bpf_prog_type prog_type)
>  	case BPF_PROG_TYPE_STRUCT_OPS:
>  		return BTF_KFUNC_HOOK_STRUCT_OPS;
>  	case BPF_PROG_TYPE_TRACING:
> +	case BPF_PROG_TYPE_LSM:
>  		return BTF_KFUNC_HOOK_TRACING;

Should we define another BTF_KFUNC_HOOK_LSM instead? Otherwise when you register
for tracing or lsm progs, you write to the same hook instead, so kfunc enabled
for tracing progs also gets enabled for lsm, I guess that is not what user
intends when registering kfunc set.

>  	case BPF_PROG_TYPE_SYSCALL:
>  		return BTF_KFUNC_HOOK_SYSCALL;
> --
> 2.37.0.rc0.104.g0611611a94-goog
>

--
Kartikeya



[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