Thread (28 messages) 28 messages, 7 authors, 2023-04-06

Re: [PATCH v6 04/11] LSM: syscalls for current process attributes

From: "Arnd Bergmann" <arnd@arndb.de>
Date: 2023-03-03 18:43:09
Also in: linux-security-module, lkml

Possibly related (same subject, not in this thread)

On Wed, Feb 22, 2023, at 21:08, Casey Schaufler wrote:
+/**
+ * sys_lsm_set_self_attr - Set current task's security module attribute
+ * @ctx: the LSM contexts
+ * @size: size of @ctx
+ * @flags: which attribute to set
+ *
+ * Sets the calling task's LSM context. On success this function
+ * returns 0. If the attribute specified cannot be set a negative
+ * value indicating the reason for the error is returned.
+ */
+SYSCALL_DEFINE3(lsm_set_self_attr, struct lsm_ctx __user *, ctx, 
size_t __user,
+		size, u64, flags)
+{
+	return security_setselfattr(flags, ctx, size);
+}
+
+SYSCALL_DEFINE3(lsm_get_self_attr, struct lsm_ctx __user *, ctx,
+		size_t __user *, size, u64, flags)
+{
+	return security_getselfattr(flags, ctx, size);
+}
As with the other patch I commented on, I think it's better to use a
32-bit 'flags' argument here, to make this work for compat tasks.

      Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help