All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selftests/bpf: Add test for sleepable lsm_cgroup rejection
@ 2026-06-11 14:35 David Windsor
  2026-06-11 22:37 ` Emil Tsalapatis
  2026-06-15  2:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: David Windsor @ 2026-06-11 14:35 UTC (permalink / raw)
  To: ast, daniel, andrii, eddyz87, memxor, shuah
  Cc: martin.lau, song, yonghong.song, jolsa, emil, bpf,
	linux-kselftest, linux-kernel, David Windsor

Confirm the verifier rejects loading a sleepable BPF_LSM_CGROUP program,
as introduced in commit 5b038319be44 ("bpf: Reject sleepable
BPF_LSM_CGROUP programs at load time").

Signed-off-by: David Windsor <dwindsor@gmail.com>
---
 tools/testing/selftests/bpf/progs/verifier_lsm.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tools/testing/selftests/bpf/progs/verifier_lsm.c b/tools/testing/selftests/bpf/progs/verifier_lsm.c
index 38e8e9176862..2f8103bfa14e 100644
--- a/tools/testing/selftests/bpf/progs/verifier_lsm.c
+++ b/tools/testing/selftests/bpf/progs/verifier_lsm.c
@@ -188,4 +188,13 @@ int BPF_PROG(null_check, struct file *file)
 	return 0;
 }
 
+SEC("lsm_cgroup/file_open")
+__description("sleepable lsm_cgroup program is rejected")
+__failure __msg("Program of this type cannot be sleepable")
+__flag(BPF_F_SLEEPABLE)
+int BPF_PROG(sleepable_lsm_cgroup)
+{
+	return 0;
+}
+
 char _license[] SEC("license") = "GPL";

base-commit: 30dee2c176e7954f63d1fa3e52d172f30beb9bfb
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] selftests/bpf: Add test for sleepable lsm_cgroup rejection
  2026-06-11 14:35 [PATCH] selftests/bpf: Add test for sleepable lsm_cgroup rejection David Windsor
@ 2026-06-11 22:37 ` Emil Tsalapatis
  2026-06-15  2:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Emil Tsalapatis @ 2026-06-11 22:37 UTC (permalink / raw)
  To: David Windsor, ast, daniel, andrii, eddyz87, memxor, shuah
  Cc: martin.lau, song, yonghong.song, jolsa, emil, bpf,
	linux-kselftest, linux-kernel

On Thu Jun 11, 2026 at 10:35 AM EDT, David Windsor wrote:
> Confirm the verifier rejects loading a sleepable BPF_LSM_CGROUP program,
> as introduced in commit 5b038319be44 ("bpf: Reject sleepable
> BPF_LSM_CGROUP programs at load time").
>
> Signed-off-by: David Windsor <dwindsor@gmail.com>

Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>

> ---
>  tools/testing/selftests/bpf/progs/verifier_lsm.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/tools/testing/selftests/bpf/progs/verifier_lsm.c b/tools/testing/selftests/bpf/progs/verifier_lsm.c
> index 38e8e9176862..2f8103bfa14e 100644
> --- a/tools/testing/selftests/bpf/progs/verifier_lsm.c
> +++ b/tools/testing/selftests/bpf/progs/verifier_lsm.c
> @@ -188,4 +188,13 @@ int BPF_PROG(null_check, struct file *file)
>  	return 0;
>  }
>  
> +SEC("lsm_cgroup/file_open")
> +__description("sleepable lsm_cgroup program is rejected")
> +__failure __msg("Program of this type cannot be sleepable")
> +__flag(BPF_F_SLEEPABLE)
> +int BPF_PROG(sleepable_lsm_cgroup)
> +{
> +	return 0;
> +}
> +
>  char _license[] SEC("license") = "GPL";
>
> base-commit: 30dee2c176e7954f63d1fa3e52d172f30beb9bfb


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] selftests/bpf: Add test for sleepable lsm_cgroup rejection
  2026-06-11 14:35 [PATCH] selftests/bpf: Add test for sleepable lsm_cgroup rejection David Windsor
  2026-06-11 22:37 ` Emil Tsalapatis
@ 2026-06-15  2:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-06-15  2:50 UTC (permalink / raw)
  To: David Windsor
  Cc: ast, daniel, andrii, eddyz87, memxor, shuah, martin.lau, song,
	yonghong.song, jolsa, emil, bpf, linux-kselftest, linux-kernel

Hello:

This patch was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:

On Thu, 11 Jun 2026 10:35:49 -0400 you wrote:
> Confirm the verifier rejects loading a sleepable BPF_LSM_CGROUP program,
> as introduced in commit 5b038319be44 ("bpf: Reject sleepable
> BPF_LSM_CGROUP programs at load time").
> 
> Signed-off-by: David Windsor <dwindsor@gmail.com>
> ---
>  tools/testing/selftests/bpf/progs/verifier_lsm.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> [...]

Here is the summary with links:
  - selftests/bpf: Add test for sleepable lsm_cgroup rejection
    https://git.kernel.org/bpf/bpf-next/c/05ae621d4e3c

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-15  2:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-11 14:35 [PATCH] selftests/bpf: Add test for sleepable lsm_cgroup rejection David Windsor
2026-06-11 22:37 ` Emil Tsalapatis
2026-06-15  2:50 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.