From bed9d72177abe904979991a99cd191173579a567 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Tue, 30 Sep 2025 14:44:45 -0400 Subject: kern: mac: Add MAC resource querying Introduce a feature where a program with the correct rights may get information about a MAC object Signed-off-by: Ian Moffett --- src/sys/include/compat/unix/syscall.h | 8 +++++++- src/sys/include/sys/mac.h | 10 ++++++++++ src/sys/include/sys/syscall.h | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) (limited to 'src/sys/include') diff --git a/src/sys/include/compat/unix/syscall.h b/src/sys/include/compat/unix/syscall.h index 88c86ba..d39f627 100644 --- a/src/sys/include/compat/unix/syscall.h +++ b/src/sys/include/compat/unix/syscall.h @@ -49,12 +49,18 @@ scret_t sys_write(struct syscall_args *scargs); */ scret_t sys_cross(struct syscall_args *scargs); +/* + * Query a syscall border - L5 mandatory + */ +scret_t sys_query(struct syscall_args *scargs); + #ifdef _NEED_UNIX_SCTAB scret_t(*g_unix_sctab[])(struct syscall_args *) = { [SYS_none] = NULL, [SYS_exit] = sys_exit, [SYS_write] = sys_write, - [SYS_cross] = sys_cross + [SYS_cross] = sys_cross, + [SYS_query] = sys_query }; #endif /* !_NEED_UNIX_SCTAB */ diff --git a/src/sys/include/sys/mac.h b/src/sys/include/sys/mac.h index 4bd46c0..72c0ba2 100644 --- a/src/sys/include/sys/mac.h +++ b/src/sys/include/sys/mac.h @@ -61,5 +61,15 @@ ssize_t cross( int flags, void *res ); +/* + * Query a resource border + * + * @id: Border ID + * @buf: Buffer to store data + * @len: Length of buffer + * @flags: Optional flags + */ +int query(border_id_t id, void *buf, size_t len, int flags); + #endif /* _KERNEL */ #endif /* !_SYS_MAC_H_ */ diff --git a/src/sys/include/sys/syscall.h b/src/sys/include/sys/syscall.h index 5ec48c3..215ea22 100644 --- a/src/sys/include/sys/syscall.h +++ b/src/sys/include/sys/syscall.h @@ -47,6 +47,7 @@ #define SYS_write 0x02 #define SYS_cross 0x03 /* cross a border (mandatory) */ #define SYS_sigaction 0x04 +#define SYS_query 0x05 /* query a border (mandatory) */ typedef __ssize_t scret_t; typedef __ssize_t scarg_t; -- cgit v1.2.3