diff mbox series

[v3,1/4] Add landlock ABI v6 fallback

Message ID 20250328-landlock_unix_socket-v3-1-e2643f65b25e@suse.com
State New
Headers show
Series Landlock tests for ABI v6 | expand

Checks

Context Check Description
acer/alpine_latest_gcc success success
acer/alpine_latest_gcc success success
acer/fedora_latest_clang fail cancelled
acer/opensuse_leap_latest_gcc fail cancelled
acer/alpine_latest_gcc fail cancelled
acer/debian_stable_s390x-linux-gnu-gcc_s390x fail success
acer/debian_stable_aarch64-linux-gnu-gcc_arm64 fail success
acer/debian_stable_powerpc64le-linux-gnu-gcc_ppc64el fail success
acer/ubuntu_jammy_gcc fail success
acer/fedora_latest_clang success success
acer/opensuse_leap_latest_gcc success success
acer/debian_stable_gcc fail success
acer/debian_testing_gcc fail success
acer/debian_oldstable_gcc fail success
acer/debian_testing_clang fail success
acer/debian_stable_gcc fail success
acer/debian_oldstable_clang fail success
acer/alpine_latest_gcc success success
acer/debian_stable_powerpc64le-linux-gnu-gcc_ppc64el success success
acer/debian_stable_s390x-linux-gnu-gcc_s390x success success
acer/debian_stable_aarch64-linux-gnu-gcc_arm64 success success
acer/opensuse_leap_latest_gcc success success
acer/ubuntu_jammy_gcc success success
acer/debian_stable_gcc success success
acer/debian_testing_clang success success
acer/fedora_latest_clang success success
acer/debian_oldstable_clang success success
acer/alpine_latest_gcc success success
acer/debian_testing_gcc success success
acer/debian_stable_gcc success success
acer/debian_oldstable_gcc success success
acer/debian_stable_aarch64-linux-gnu-gcc_arm64 success success
acer/ubuntu_bionic_gcc fail failure
acer/debian_stable_powerpc64le-linux-gnu-gcc_ppc64el success success
acer/debian_testing_clang fail cancelled
acer/debian_oldstable_clang fail cancelled
acer/debian_stable_gcc fail cancelled
acer/alpine_latest_gcc fail cancelled
acer/fedora_latest_clang fail cancelled
acer/debian_stable_s390x-linux-gnu-gcc_s390x fail cancelled
acer/ubuntu_jammy_gcc fail cancelled
acer/debian_oldstable_gcc fail cancelled
acer/debian_testing_gcc fail cancelled

Commit Message

Andrea Cervesato March 28, 2025, 2:24 p.m. UTC
From: Andrea Cervesato <andrea.cervesato@suse.com>

The new ABI v6 is defining the following IPC scoped operations:

* LANDLOCK_SCOPE_ABSTRACT_UNIX_SOCKET
* LANDLOCK_SCOPE_SIGNAL

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
 include/lapi/landlock.h | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/include/lapi/landlock.h b/include/lapi/landlock.h
index b3c8c548e661680541cdf6e4a8fb68a3f5029fec..e579500ec26cdc0a568620bc35386f3d2b68952e 100644
--- a/include/lapi/landlock.h
+++ b/include/lapi/landlock.h
@@ -15,15 +15,19 @@ 
 
 #include "lapi/syscalls.h"
 
-struct tst_landlock_ruleset_attr_abi1
-{
+struct tst_landlock_ruleset_attr_abi1 {
 	uint64_t handled_access_fs;
 };
 
-struct tst_landlock_ruleset_attr_abi4
-{
+struct tst_landlock_ruleset_attr_abi4 {
+	uint64_t handled_access_fs;
+	uint64_t handled_access_net;
+};
+
+struct tst_landlock_ruleset_attr_abi6 {
 	uint64_t handled_access_fs;
 	uint64_t handled_access_net;
+	uint64_t scoped;
 };
 
 #ifndef HAVE_STRUCT_LANDLOCK_PATH_BENEATH_ATTR
@@ -43,8 +47,7 @@  struct landlock_path_beneath_attr
 #endif
 
 #ifndef HAVE_STRUCT_LANDLOCK_NET_PORT_ATTR
-struct landlock_net_port_attr
-{
+struct landlock_net_port_attr {
 	uint64_t allowed_access;
 	uint64_t port;
 };
@@ -126,6 +129,14 @@  struct landlock_net_port_attr
 # define LANDLOCK_ACCESS_NET_CONNECT_TCP	(1ULL << 1)
 #endif
 
+#ifndef LANDLOCK_SCOPE_ABSTRACT_UNIX_SOCKET
+# define LANDLOCK_SCOPE_ABSTRACT_UNIX_SOCKET		(1ULL << 0)
+#endif
+
+#ifndef LANDLOCK_SCOPE_SIGNAL
+# define LANDLOCK_SCOPE_SIGNAL		                (1ULL << 1)
+#endif
+
 static inline int safe_landlock_create_ruleset(const char *file, const int lineno,
 	const void *attr, size_t size , uint32_t flags)
 {