lkml.org 
[lkml]   [2020]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [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,
> > +};

[...]

\
 
 \ /
  Last update: 2020-11-21 01:16    [W:0.111 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site