Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

landlock: Fix documentation for landlock_create_ruleset(2)

Move and fix the flags documentation, and improve formatting.

It makes more sense and it eases maintenance to document syscall flags
in landlock.h, where they are defined. This is already the case for
landlock_restrict_self(2)'s flags.

The flags are now rendered like the syscall's parameters and
description.

Cc: Günther Noack <gnoack@google.com>
Cc: Paul Moore <paul@paul-moore.com>
Link: https://lore.kernel.org/r/20250416154716.1799902-1-mic@digikod.net
Signed-off-by: Mickaël Salaün <mic@digikod.net>

+16 -13
+9 -5
include/uapi/linux/landlock.h
··· 53 53 __u64 scoped; 54 54 }; 55 55 56 - /* 57 - * sys_landlock_create_ruleset() flags: 56 + /** 57 + * DOC: landlock_create_ruleset_flags 58 58 * 59 - * - %LANDLOCK_CREATE_RULESET_VERSION: Get the highest supported Landlock ABI 60 - * version. 61 - * - %LANDLOCK_CREATE_RULESET_ERRATA: Get a bitmask of fixed issues. 59 + * **Flags** 60 + * 61 + * %LANDLOCK_CREATE_RULESET_VERSION 62 + * Get the highest supported Landlock ABI version (starting at 1). 63 + * 64 + * %LANDLOCK_CREATE_RULESET_ERRATA 65 + * Get a bitmask of fixed issues for the current Landlock ABI version. 62 66 */ 63 67 /* clang-format off */ 64 68 #define LANDLOCK_CREATE_RULESET_VERSION (1U << 0)
+7 -8
security/landlock/syscalls.c
··· 169 169 * the new ruleset. 170 170 * @size: Size of the pointed &struct landlock_ruleset_attr (needed for 171 171 * backward and forward compatibility). 172 - * @flags: Supported value: 172 + * @flags: Supported values: 173 + * 173 174 * - %LANDLOCK_CREATE_RULESET_VERSION 174 175 * - %LANDLOCK_CREATE_RULESET_ERRATA 175 176 * 176 177 * This system call enables to create a new Landlock ruleset, and returns the 177 178 * related file descriptor on success. 178 179 * 179 - * If @flags is %LANDLOCK_CREATE_RULESET_VERSION and @attr is NULL and @size is 180 - * 0, then the returned value is the highest supported Landlock ABI version 181 - * (starting at 1). 182 - * 183 - * If @flags is %LANDLOCK_CREATE_RULESET_ERRATA and @attr is NULL and @size is 184 - * 0, then the returned value is a bitmask of fixed issues for the current 185 - * Landlock ABI version. 180 + * If %LANDLOCK_CREATE_RULESET_VERSION or %LANDLOCK_CREATE_RULESET_ERRATA is 181 + * set, then @attr must be NULL and @size must be 0. 186 182 * 187 183 * Possible returned errors are: 188 184 * ··· 187 191 * - %E2BIG: @attr or @size inconsistencies; 188 192 * - %EFAULT: @attr or @size inconsistencies; 189 193 * - %ENOMSG: empty &landlock_ruleset_attr.handled_access_fs. 194 + * 195 + * .. kernel-doc:: include/uapi/linux/landlock.h 196 + * :identifiers: landlock_create_ruleset_flags 190 197 */ 191 198 SYSCALL_DEFINE3(landlock_create_ruleset, 192 199 const struct landlock_ruleset_attr __user *const, attr,