Files
linux/include/uapi/linux
Christian Göttsche 6140be90ec fs/xattr: add *at family syscalls
Add the four syscalls setxattrat(), getxattrat(), listxattrat() and
removexattrat().  Those can be used to operate on extended attributes,
especially security related ones, either relative to a pinned directory
or on a file descriptor without read access, avoiding a
/proc/<pid>/fd/<fd> detour, requiring a mounted procfs.

One use case will be setfiles(8) setting SELinux file contexts
("security.selinux") without race conditions and without a file
descriptor opened with read access requiring SELinux read permission.

Use the do_{name}at() pattern from fs/open.c.

Pass the value of the extended attribute, its length, and for
setxattrat(2) the command (XATTR_CREATE or XATTR_REPLACE) via an added
struct xattr_args to not exceed six syscall arguments and not
merging the AT_* and XATTR_* flags.

[AV: fixes by Christian Brauner folded in, the entire thing rebased on
top of {filename,file}_...xattr() primitives, treatment of empty
pathnames regularized.  As the result, AT_EMPTY_PATH+NULL handling
is cheap, so f...(2) can use it]

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Link: https://lore.kernel.org/r/20240426162042.191916-1-cgoettsche@seltendoof.de
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Christian Brauner <brauner@kernel.org>
CC: x86@kernel.org
CC: linux-alpha@vger.kernel.org
CC: linux-kernel@vger.kernel.org
CC: linux-arm-kernel@lists.infradead.org
CC: linux-ia64@vger.kernel.org
CC: linux-m68k@lists.linux-m68k.org
CC: linux-mips@vger.kernel.org
CC: linux-parisc@vger.kernel.org
CC: linuxppc-dev@lists.ozlabs.org
CC: linux-s390@vger.kernel.org
CC: linux-sh@vger.kernel.org
CC: sparclinux@vger.kernel.org
CC: linux-fsdevel@vger.kernel.org
CC: audit@vger.kernel.org
CC: linux-arch@vger.kernel.org
CC: linux-api@vger.kernel.org
CC: linux-security-module@vger.kernel.org
CC: selinux@vger.kernel.org
[brauner: slight tweaks]
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2024-11-06 12:59:44 -05:00
..
2024-07-31 13:56:00 +02:00
2024-04-15 13:42:38 +02:00
2021-01-25 18:44:44 +01:00
2021-11-01 13:36:08 +00:00
2022-08-11 10:31:19 -07:00
2024-08-20 14:02:22 -04:00
2024-08-28 06:53:58 -07:00
2022-06-07 10:20:42 -07:00
2021-11-26 16:48:59 +01:00
2024-08-28 06:53:58 -07:00
2023-01-20 09:33:22 +00:00
2024-04-08 14:10:45 +01:00
2024-06-11 12:57:49 -05:00
2023-03-16 21:20:32 -07:00
2024-09-04 16:51:11 +02:00
2023-09-21 19:22:05 +02:00
2022-08-10 13:49:50 +01:00
2021-02-08 13:01:24 +01:00
2024-05-07 01:35:57 +02:00
2024-08-29 10:39:37 +02:00
2021-11-15 07:53:10 -08:00
2021-06-03 15:31:34 -07:00
2024-05-07 01:35:57 +02:00
2024-04-01 10:49:28 +01:00
2024-08-26 09:37:23 -07:00
2024-08-26 09:37:23 -07:00
2024-08-26 12:02:03 -03:00
2024-06-01 07:28:21 +02:00
2024-09-01 20:26:05 -07:00
2022-09-20 09:13:38 +02:00
2024-09-16 23:50:52 +02:00
2024-08-19 22:36:26 -04:00
2021-03-10 09:34:06 +01:00
2023-12-15 17:01:30 +01:00
2024-09-06 08:31:40 -06:00
2024-09-11 20:44:32 -07:00
2022-09-07 16:46:03 +02:00
2024-08-12 17:50:34 -07:00
2023-11-28 19:05:16 +00:00
2024-09-19 14:25:26 -05:00
2023-12-20 19:26:31 -05:00
2022-11-17 11:04:23 -08:00
2021-01-07 16:17:32 +01:00
2022-09-27 17:29:09 -07:00
2023-06-05 09:36:35 +02:00
2024-02-28 18:47:08 -07:00
2023-12-29 11:58:24 -08:00
2023-03-23 17:25:46 +01:00
2021-06-12 13:16:45 -07:00
2024-11-06 12:59:44 -05:00