[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <86215760-0EEF-449C-983B-A84E57450166@fb.com>
Date: Tue, 6 Aug 2024 22:22:40 +0000
From: Song Liu <songliubraving@...a.com>
To: Song Liu <song@...nel.org>
CC: bpf <bpf@...r.kernel.org>, Linux-Fsdevel <linux-fsdevel@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Kernel Team <kernel-team@...a.com>,
Andrii Nakryiko <andrii@...nel.org>,
Eduard Zingerman <eddyz87@...il.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Martin KaFai Lau <martin.lau@...ux.dev>,
Al Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>,
KP Singh
<kpsingh@...nel.org>, Liam Wisehart <liamwisehart@...a.com>,
Liang Tang
<lltang@...a.com>,
Shankaran Gnanashanmugam <shankaran@...a.com>
Subject: Re: [PATCH v3 bpf-next 3/3] selftests/bpf: Add tests for
bpf_get_dentry_xattr
> On Aug 6, 2024, at 1:33 PM, Song Liu <song@...nel.org> wrote:
>
> Add test for bpf_get_dentry_xattr on hook security_inode_getxattr.
> Verify that the kfunc can read the xattr. Also test failing getxattr
> from user space by returning non-zero from the LSM bpf program.
>
> Acked-by: Christian Brauner <brauner@...nel.org>
> Signed-off-by: Song Liu <song@...nel.org>
> ---
> tools/testing/selftests/bpf/bpf_kfuncs.h | 8 ++++
> .../selftests/bpf/prog_tests/fs_kfuncs.c | 9 ++++-
> .../selftests/bpf/progs/test_get_xattr.c | 37 ++++++++++++++++---
> 3 files changed, 48 insertions(+), 6 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/bpf_kfuncs.h b/tools/testing/selftests/bpf/bpf_kfuncs.h
> index 3b6675ab4086..cf25421c36c9 100644
> --- a/tools/testing/selftests/bpf/bpf_kfuncs.h
> +++ b/tools/testing/selftests/bpf/bpf_kfuncs.h
> @@ -78,4 +78,12 @@ extern int bpf_verify_pkcs7_signature(struct bpf_dynptr *data_ptr,
>
> extern bool bpf_session_is_return(void) __ksym __weak;
> extern __u64 *bpf_session_cookie(void) __ksym __weak;
> +
> +/* Description
> + * Returns xattr of a dentry
> + * Returns__bpf_kfunc
> + * Error code
> + */
> +extern int bpf_get_dentry_xattr(struct dentry *dentry, const char *name,
> + struct bpf_dynptr *value_ptr) __ksym __weak;
> #endif
Oops.. forgot to declare struct dentry. Let me fix this. Sorry for the noise.
Thanks,
Song
Powered by blists - more mailing lists