mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Song Liu <songliubraving@meta.com>
To: Song Liu <song@kernel.org>
Cc: bpf <bpf@vger.kernel.org>,
	Linux-Fsdevel <linux-fsdevel@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Kernel Team <kernel-team@meta.com>,
	Andrii Nakryiko <andrii@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
	KP Singh <kpsingh@kernel.org>,
	Liam Wisehart <liamwisehart@meta.com>,
	Liang Tang <lltang@meta.com>,
	Shankaran Gnanashanmugam <shankaran@meta.com>
Subject: Re: [PATCH v3 bpf-next 3/3] selftests/bpf: Add tests for bpf_get_dentry_xattr
Date: Tue, 6 Aug 2024 22:22:40 +0000	[thread overview]
Message-ID: <86215760-0EEF-449C-983B-A84E57450166@fb.com> (raw)
In-Reply-To: <20240806203340.3503805-4-song@kernel.org>



> On Aug 6, 2024, at 1:33 PM, Song Liu <song@kernel.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@kernel.org>
> Signed-off-by: Song Liu <song@kernel.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


      reply	other threads:[~2024-08-06 22:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-06 20:33 [PATCH v3 bpf-next 0/3] Add bpf_get_dentry_xattr Song Liu
2024-08-06 20:33 ` [PATCH v3 bpf-next 1/3] bpf: Move bpf_get_file_xattr to fs/bpf_fs_kfuncs.c Song Liu
2024-08-06 20:33 ` [PATCH v3 bpf-next 2/3] bpf: Add kfunc bpf_get_dentry_xattr() to read xattr from dentry Song Liu
2024-08-06 20:33 ` [PATCH v3 bpf-next 3/3] selftests/bpf: Add tests for bpf_get_dentry_xattr Song Liu
2024-08-06 22:22   ` Song Liu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86215760-0EEF-449C-983B-A84E57450166@fb.com \
    --to=songliubraving@meta.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=brauner@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=jack@suse.cz \
    --cc=kernel-team@meta.com \
    --cc=kpsingh@kernel.org \
    --cc=liamwisehart@meta.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lltang@meta.com \
    --cc=martin.lau@linux.dev \
    --cc=shankaran@meta.com \
    --cc=song@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®