Re: [PATCH bpf-next v8 6/7] bpf: Allow local storage to be used from LSM programs
From: KP Singh
Date: Wed Aug 19 2020 - 09:04:59 EST
On 8/18/20 6:16 AM, Martin KaFai Lau wrote:
> On Mon, Aug 03, 2020 at 06:46:54PM +0200, KP Singh wrote:
>> From: KP Singh <kpsingh@xxxxxxxxxx>
>>
>> Adds support for both bpf_{sk, inode}_storage_{get, delete} to be used
>> in LSM programs. These helpers are not used for tracing programs
[...]
>> @@ -2823,6 +2823,10 @@ union bpf_attr {
>> * "type". The bpf-local-storage "type" (i.e. the *map*) is
>> * searched against all bpf-local-storages residing at *sk*.
>> *
>> + * For socket programs, *sk* should be a **struct bpf_sock** pointer
>> + * and an **ARG_PTR_TO_BTF_ID** of type **struct sock** for LSM
>> + * programs.
> I found it a little vague on what "socket programs" is. May be:
>
> *sk* is a kernel **struct sock** pointer for LSM program.
> *sk* is a **struct bpf_sock** pointer for other program types.
This is better, Thanks!
- KP
>
> Others LGTM
>
> Acked-by: Martin KaFai Lau <kafai@xxxxxx>
>