netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 bpf-next 0/4] af_unix: Allow BPF LSM to filter SCM_RIGHTS at sendmsg().
@ 2025-06-13 22:22 Kuniyuki Iwashima
  2025-06-13 22:22 ` [PATCH v2 bpf-next 1/4] af_unix: Don't pass struct socket to security_unix_may_send() Kuniyuki Iwashima
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Kuniyuki Iwashima @ 2025-06-13 22:22 UTC (permalink / raw)
  To: Martin KaFai Lau, Daniel Borkmann, John Fastabend,
	Alexei Starovoitov, Andrii Nakryiko
  Cc: Eduard Zingerman, Song Liu, Yonghong Song, KP Singh,
	Stanislav Fomichev, Hao Luo, Jiri Olsa, Kumar Kartikeya Dwivedi,
	Paul Moore, James Morris, Serge E. Hallyn,
	Mickaël Salaün, Günther Noack, Stephen Smalley,
	Ondrej Mosnacek, Casey Schaufler, Kuniyuki Iwashima,
	Kuniyuki Iwashima, bpf, linux-security-module, selinux, netdev

From: Kuniyuki Iwashima <kuniyu@google.com>

Since commit 77cbe1a6d873 ("af_unix: Introduce SO_PASSRIGHTS."),
we can disable SCM_RIGHTS per socket, but it's not flexible.

This series allows us to implement more fine-grained filtering for
SCM_RIGHTS with BPF LSM.


Changes:
  v2: Remove SCM_RIGHTS fd scrubbing functionality

  v1: https://lore.kernel.org/bpf/20250505215802.48449-1-kuniyu@amazon.com/


Kuniyuki Iwashima (4):
  af_unix: Don't pass struct socket to security_unix_may_send().
  af_unix: Call security_unix_may_send() in sendmsg() for all socket
    types
  af_unix: Pass skb to security_unix_may_send().
  selftest: bpf: Add test for BPF LSM on unix_may_send().

 include/linux/lsm_hook_defs.h                 |   3 +-
 include/linux/security.h                      |   7 +-
 net/unix/af_unix.c                            |  32 ++--
 security/landlock/task.c                      |  16 +-
 security/security.c                           |   5 +-
 security/selinux/hooks.c                      |  14 +-
 security/smack/smack_lsm.c                    |  12 +-
 .../bpf/prog_tests/lsm_unix_may_send.c        | 168 ++++++++++++++++++
 .../selftests/bpf/progs/lsm_unix_may_send.c   |  83 +++++++++
 9 files changed, 309 insertions(+), 31 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/lsm_unix_may_send.c
 create mode 100644 tools/testing/selftests/bpf/progs/lsm_unix_may_send.c

-- 
2.49.0


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

end of thread, other threads:[~2025-06-19 18:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-13 22:22 [PATCH v2 bpf-next 0/4] af_unix: Allow BPF LSM to filter SCM_RIGHTS at sendmsg() Kuniyuki Iwashima
2025-06-13 22:22 ` [PATCH v2 bpf-next 1/4] af_unix: Don't pass struct socket to security_unix_may_send() Kuniyuki Iwashima
2025-06-14 17:32   ` kernel test robot
2025-06-13 22:22 ` [PATCH v2 bpf-next 2/4] af_unix: Call security_unix_may_send() in sendmsg() for all socket types Kuniyuki Iwashima
2025-06-13 22:22 ` [PATCH v2 bpf-next 3/4] af_unix: Pass skb to security_unix_may_send() Kuniyuki Iwashima
2025-06-13 22:22 ` [PATCH v2 bpf-next 4/4] selftest: bpf: Add test for BPF LSM on unix_may_send() Kuniyuki Iwashima
2025-06-14 11:43 ` [PATCH v2 bpf-next 0/4] af_unix: Allow BPF LSM to filter SCM_RIGHTS at sendmsg() Paul Moore
2025-06-14 20:40   ` Kuniyuki Iwashima
2025-06-19  3:23     ` Paul Moore
2025-06-19  4:00       ` Kuniyuki Iwashima
2025-06-19 18:55         ` Paul Moore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).