[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACYkzJ6bZBybX5tg2DvyJUkBPQ6_qP5FVKvMxdCe+CbA-OmPag@mail.gmail.com>
Date: Sat, 21 Nov 2020 01:14:04 +0100
From: KP Singh <kpsingh@...omium.org>
To: Yonghong Song <yhs@...com>
Cc: James Morris <jmorris@...ei.org>,
open list <linux-kernel@...r.kernel.org>,
bpf <bpf@...r.kernel.org>,
Linux Security Module list
<linux-security-module@...r.kernel.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Florent Revest <revest@...omium.org>,
Brendan Jackman <jackmanb@...omium.org>,
Mimi Zohar <zohar@...ux.ibm.com>
Subject: Re: [PATCH bpf-next 2/3] bpf: Add a BPF helper for getting the IMA
hash of an inode
[...]
> > + * long bpf_ima_inode_hash(struct inode *inode, void *dst, u32 size)
> > + * Description
> > + * Returns the stored IMA hash of the *inode* (if it's avaialable).
> > + * If the hash is larger than *size*, then only *size*
> > + * bytes will be copied to *dst*
> > + * Return > + * The **hash_algo** of is returned on success,
>
> of => if?
Just changed it to:
"The **hash_algo** is returned on success"
>
> > + * **-EOPNOTSUP** if IMA is disabled and **-EINVAL** if
>
> and => or
Done. (and the same for tools/)
>
[...]
> > + .gpl_only = false,
> > + .ret_type = RET_INTEGER,
> > + .arg1_type = ARG_PTR_TO_BTF_ID,
> > + .arg1_btf_id = &bpf_ima_inode_hash_btf_ids[0],
> > + .arg2_type = ARG_PTR_TO_UNINIT_MEM,
> > + .arg3_type = ARG_CONST_SIZE_OR_ZERO,
>
> I know ARG_CONST_SIZE_OR_ZERO provides some flexibility and may
> make verifier easier to verify programs. But beyond that did
> you see any real use case user will pass a zero size buf to
> get hash value?
>
I agree, in this case it makes more sense to ARG_CONST_SIZE.
> > + .allowed = bpf_ima_inode_hash_allowed,
> > +};
[...]
Powered by blists - more mailing lists