Skip to contentSkip to conversation

landlock: Extend documentation for kernel support

PATCH In review Mickaël Salaün 3 participants 7 messages Feb 27, 2024 – Mar 19, 2024

Subsystems (4)
lore
Share & tools
lore

Mickaël Salaün

author maintainer
#0 lore raw

PATCH v2 1/2 landlock: Extend documentation for kernel support

Extend the kernel support section with one subsection for build time configuration and another for boot time configuration.

Extend the boot time subsection with a concrete example.

Update the journalctl command to include the boot option.

Cc Günther Noack <[email protected]>
Cc Kees Cook <[email protected]>

---

Changes since v1:
* New patch, suggested by Kees Cook.

---
 Documentation/userspace-api/landlock.rst | 57 +++++++++++++++++++++---
 1 file changed, 51 insertions(+), 6 deletions(-)
Documentation/userspace-api/landlock.rst +51 -6
index 2e3822677061..838cc27db232 100644
@@ -19,11 +19,12 @@ unexpected/malicious behaviors in user space applications.  Landlock empowers
 any process, including unprivileged ones, to securely restrict themselves.
 
 We can quickly make sure that Landlock is enabled in the running system by
-looking for "landlock: Up and running" in kernel logs (as root): ``dmesg | grep
-landlock || journalctl -kg landlock`` .  Developers can also easily check for
-Landlock support with a :ref:`related system call <landlock_abi_versions>`.  If
-Landlock is not currently supported, we need to :ref:`configure the kernel
-appropriately <kernel_support>`.
+looking for "landlock: Up and running" in kernel logs (as root):
+``dmesg | grep landlock || journalctl -kb -g landlock`` .
+Developers can also easily check for Landlock support with a
+:ref:`related system call <landlock_abi_versions>`.
+If Landlock is not currently supported, we need to
+:ref:`configure the kernel appropriately <kernel_support>`.
 
 Landlock rules
 ==============
@@ -499,6 +500,9 @@ access rights.
 Kernel support
 ==============
 
+Build time configuration
+------------------------
+
 Landlock was first introduced in Linux 5.13 but it must be configured at build
 time with ``CONFIG_SECURITY_LANDLOCK=y``.  Landlock must also be enabled at boot
 time as the other security modules.  The list of security modules enabled by
@@ -507,11 +511,52 @@ contains ``CONFIG_LSM=landlock,[...]`` with ``[...]``  as the list of other
 potentially useful security modules for the running system (see the
 ``CONFIG_LSM`` help).
 
+Boot time configuration
+-----------------------
+
 If the running kernel does not have ``landlock`` in ``CONFIG_LSM``, then we can
-still enable it by adding ``lsm=landlock,[...]`` to
+enable Landlock by adding ``lsm=landlock,[...]`` to
 Documentation/admin-guide/kernel-parameters.rst thanks to the bootloader
 configuration.
 
+For example, if the current built-in configuration is:
+
+.. code-block:: console
+
+    $ zgrep -h "^CONFIG_LSM=" "/boot/config-$(uname -r)" /proc/config.gz 2>/dev/null
+    CONFIG_LSM="lockdown,yama,integrity,apparmor"
+
+...and if the cmdline doesn't contain ``landlock`` either:
+
+.. code-block:: console
+
+    $ sed -n 's/.*\(\<lsm=\S\+\).*/\1/p' /proc/cmdline
+    lsm=lockdown,yama,integrity,apparmor
+
+...we should configure the bootloader to set a cmdline extending the ``lsm``
+list with the ``landlock,`` prefix::
+
+  lsm=landlock,lockdown,yama,integrity,apparmor
+
+After a reboot, we can check that Landlock is up and running by looking at
+kernel logs:
+
+.. code-block:: console
+
+    # dmesg | grep landlock || journalctl -kb -g landlock
+    [    0.000000] Command line: [...] lsm=landlock,lockdown,yama,integrity,apparmor
+    [    0.000000] Kernel command line: [...] lsm=landlock,lockdown,yama,integrity,apparmor
+    [    0.000000] LSM: initializing lsm=lockdown,capability,landlock,yama,integrity,apparmor
+    [    0.000000] landlock: Up and running.
+
+Note that according to the built time kernel configuration,
+``lockdown,capability,`` may always stay at the beginning of the ``LSM:
+initializing lsm=`` list even if they are not configured with the bootloader,
+which is OK.
+
+Network support
+---------------
+
 To be able to explicitly allow TCP operations (e.g., adding a network rule with
 ``LANDLOCK_ACCESS_NET_BIND_TCP``), the kernel must support TCP
 (``CONFIG_INET=y``).  Otherwise, sys_landlock_add_rule() returns an

base-commit: b4007fd27206c478a4b76e299bddf4a71787f520

Signature · 1 line
2.44.0
author maintainer
#1 lore raw

PATCH v2 2/2 landlock: Warn once if a Landlock action is requested while disabled

Because sandboxing can be used as an opportunistic security measure, user space may not log unsupported features. Let the system administrator know if an application tries to use Landlock but failed because it isn't enabled at boot time. This may be caused by bootloader configurations with outdated "lsm" kernel's command-line parameter.

Fixes 265885daf3e5 ("landlock: Add syscall implementations")

---

Changes since v1:
* Add Kees's and Günther's Reviewed-by.
* Rename is_not_initialized() to not_initialized() and invert the logic, as suggested by Günther. This is a cosmetic change without global behavioral changed.
* Update link to point to a new subsection.

---
 security/landlock/syscalls.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
security/landlock/syscalls.c +15 -3
index 898358f57fa0..6788e73b6681 100644
@@ -33,6 +33,18 @@
 #include "ruleset.h"
 #include "setup.h"
 
+static bool is_initialized(void)
+{
+	if (likely(landlock_initialized))
+		return true;
+
+	pr_warn_once(
+		"Disabled but requested by user space. "
+		"You should enable Landlock at boot time: "
+		"https://docs.kernel.org/userspace-api/landlock.html#boot-time-configuration\n");
+	return false;
+}
+
 /**
  * copy_min_struct_from_user - Safe future-proof argument copying
  *
@@ -173,7 +185,7 @@ SYSCALL_DEFINE3(landlock_create_ruleset,
 	/* Build-time checks. */
 	build_check_abi();
 
-	if (!landlock_initialized)
+	if (!is_initialized())
 		return -EOPNOTSUPP;
 
 	if (flags) {
@@ -398,7 +410,7 @@ SYSCALL_DEFINE4(landlock_add_rule, const int, ruleset_fd,
 	struct landlock_ruleset *ruleset;
 	int err;
 
-	if (!landlock_initialized)
+	if (!is_initialized())
 		return -EOPNOTSUPP;
 
 	/* No flag for now. */
@@ -458,7 +470,7 @@ SYSCALL_DEFINE2(landlock_restrict_self, const int, ruleset_fd, const __u32,
 	struct landlock_cred_security *new_llcred;
 	int err;
 
-	if (!landlock_initialized)
+	if (!is_initialized())
 		return -EOPNOTSUPP;
 
 	/*
Signature · 1 line
2.44.0
reviewer Reviewed-by on v2 1/2
#2 lore raw
In reply to Mickaël Salaün
Quoted 22 lines · Mickaël Salaün

Extend the kernel support section with one subsection for build time configuration and another for boot time configuration.

Extend the boot time subsection with a concrete example.

Update the journalctl command to include the boot option.

Cc Günther Noack <[email protected]>
Cc Kees Cook <[email protected]>

---

Changes since v1:
* New patch, suggested by Kees Cook.

---
 Documentation/userspace-api/landlock.rst | 57 +++++++++++++++++++++---
 1 file changed, 51 insertions(+), 6 deletions(-)
Documentation/userspace-api/landlock.rst +0 -0
index 2e3822677061..838cc27db232 100644

Documentation/userspace-api/landlock.rst contains ``CONFIG_LSM=landlock,[...]`` with ``[...]`` as the list of other · line 520

Quoted 8 lines
Documentation/userspace-api/landlock.rst +4 -1
+Boot time configuration
+-----------------------
+
 If the running kernel does not have ``landlock`` in ``CONFIG_LSM``, then we can
-still enable it by adding ``lsm=landlock,[...]`` to
+enable Landlock by adding ``lsm=landlock,[...]`` to
 Documentation/admin-guide/kernel-parameters.rst thanks to the bootloader
 configuration.

I would suggest: s/thanks to/in/

Quoted 6 lines
Documentation/userspace-api/landlock.rst +6 -0
+For example, if the current built-in configuration is:
+
+.. code-block:: console
+
+    $ zgrep -h "^CONFIG_LSM=" "/boot/config-$(uname -r)" /proc/config.gz 2>/dev/null
+    CONFIG_LSM="lockdown,yama,integrity,apparmor"

Documentation/userspace-api/landlock.rst contains ``CONFIG_LSM=landlock,[...]`` with ``[...]`` as the list of other · line 537

Quoted 10 lines
Documentation/userspace-api/landlock.rst +10 -0
+
+...and if the cmdline doesn't contain ``landlock`` either:
+
+.. code-block:: console
+
+    $ sed -n 's/.*\(\<lsm=\S\+\).*/\1/p' /proc/cmdline
+    lsm=lockdown,yama,integrity,apparmor
+
+...we should configure the bootloader to set a cmdline extending the ``lsm``
+list with the ``landlock,`` prefix::

Nit: Is the double colon at the end of this line accidental? (It does not appear before the previous code block.)

Quoted 5 lines
Documentation/userspace-api/landlock.rst +5 -0
+
+  lsm=landlock,lockdown,yama,integrity,apparmor
+
+After a reboot, we can check that Landlock is up and running by looking at
+kernel logs:

Documentation/userspace-api/landlock.rst contains ``CONFIG_LSM=landlock,[...]`` with ``[...]`` as the list of other · line 552

Quoted 10 lines
Documentation/userspace-api/landlock.rst +10 -0
+
+.. code-block:: console
+
+    # dmesg | grep landlock || journalctl -kb -g landlock
+    [    0.000000] Command line: [...] lsm=landlock,lockdown,yama,integrity,apparmor
+    [    0.000000] Kernel command line: [...] lsm=landlock,lockdown,yama,integrity,apparmor
+    [    0.000000] LSM: initializing lsm=lockdown,capability,landlock,yama,integrity,apparmor
+    [    0.000000] landlock: Up and running.
+
+Note that according to the built time kernel configuration,

s/built time/build time/

                 ^

It feels like the phrase "according to" could be slightly more specific here.

To paraphrase Alejandro Colomar, "Note that" is usually redundant.
https://lore.kernel.org/all/[email protected]/

I'd suggest:

The kernel may be configured at build time to always load the ``lockdown`` and ``capability`` LSMs. In that case, these LSMs will appear at the beginning of the ``LSM: initializing`` log line as well, even if they are not configured in the boot loader.

Quoted 2 lines

+``lockdown,capability,`` may always stay at the beginning of the ``LSM:
+initializing lsm=`` list even if they are not configured with the bootloader,

Nit: The man pages spell this in two words as "boot loader".

Quoted 9 lines
Documentation/userspace-api/landlock.rst +5 -0
+which is OK.
+
+Network support
+---------------
+
 To be able to explicitly allow TCP operations (e.g., adding a network rule with
 ``LANDLOCK_ACCESS_NET_BIND_TCP``), the kernel must support TCP
 (``CONFIG_INET=y``).  Otherwise, sys_landlock_add_rule() returns an
Quoted 4 lines

base-commit: b4007fd27206c478a4b76e299bddf4a71787f520

Signature · 1 line
2.44.0
author maintainer
#3 lore raw

CCing Alejandro

Quoted 19 lines · Günther Noack
Quoted 18 lines · Mickaël Salaün

Extend the kernel support section with one subsection for build time configuration and another for boot time configuration.

Extend the boot time subsection with a concrete example.

Update the journalctl command to include the boot option.

Cc Günther Noack <[email protected]>
Cc Kees Cook <[email protected]>

---

Changes since v1:
* New patch, suggested by Kees Cook.

---
 Documentation/userspace-api/landlock.rst | 57 +++++++++++++++++++++---
 1 file changed, 51 insertions(+), 6 deletions(-)
Quoted 14 lines

Documentation/userspace-api/landlock.rst contains ``CONFIG_LSM=landlock,[...]`` with ``[...]`` as the list of other · line 520

Quoted 12 lines
Documentation/userspace-api/landlock.rst +4 -1
index 2e3822677061..838cc27db232 100644
+Boot time configuration
+-----------------------
+
 If the running kernel does not have ``landlock`` in ``CONFIG_LSM``, then we can
-still enable it by adding ``lsm=landlock,[...]`` to
+enable Landlock by adding ``lsm=landlock,[...]`` to
 Documentation/admin-guide/kernel-parameters.rst thanks to the bootloader
 configuration.

I would suggest: s/thanks to/in/

OK

Quoted 12 lines
Quoted 12 lines
Documentation/userspace-api/landlock.rst +11 -0
+For example, if the current built-in configuration is:
+
+.. code-block:: console
+
+    $ zgrep -h "^CONFIG_LSM=" "/boot/config-$(uname -r)" /proc/config.gz 2>/dev/null
+    CONFIG_LSM="lockdown,yama,integrity,apparmor"
+
+...and if the cmdline doesn't contain ``landlock`` either:
+
+.. code-block:: console
+
Quoted 8 lines

Documentation/userspace-api/landlock.rst contains ``CONFIG_LSM=landlock,[...]`` with ``[...]`` as the list of other · line 537

Quoted 5 lines
Documentation/userspace-api/landlock.rst +5 -0
+    $ sed -n 's/.*\(\<lsm=\S\+\).*/\1/p' /proc/cmdline
+    lsm=lockdown,yama,integrity,apparmor
+
+...we should configure the bootloader to set a cmdline extending the ``lsm``
+list with the ``landlock,`` prefix::

Nit: Is the double colon at the end of this line accidental? (It does not appear before the previous code block.)

The "::" creates an implicit text block with the following text. For the other block I used an explicit code-block, which then doesn't require this "::".

Quoted 18 lines
Quoted 6 lines
Documentation/userspace-api/landlock.rst +5 -0
+
+  lsm=landlock,lockdown,yama,integrity,apparmor
+
+After a reboot, we can check that Landlock is up and running by looking at
+kernel logs:

Documentation/userspace-api/landlock.rst contains ``CONFIG_LSM=landlock,[...]`` with ``[...]`` as the list of other · line 552

Quoted 10 lines
Documentation/userspace-api/landlock.rst +10 -0
+
+.. code-block:: console
+
+    # dmesg | grep landlock || journalctl -kb -g landlock
+    [    0.000000] Command line: [...] lsm=landlock,lockdown,yama,integrity,apparmor
+    [    0.000000] Kernel command line: [...] lsm=landlock,lockdown,yama,integrity,apparmor
+    [    0.000000] LSM: initializing lsm=lockdown,capability,landlock,yama,integrity,apparmor
+    [    0.000000] landlock: Up and running.
+
+Note that according to the built time kernel configuration,

s/built time/build time/

Quoted 1 line
                 ^

OK

Quoted 6 lines

It feels like the phrase "according to" could be slightly more specific here.

To paraphrase Alejandro Colomar, "Note that" is usually redundant.
https://lore.kernel.org/all/[email protected]/

Quoted 6 lines

I'd suggest:

The kernel may be configured at build time to always load the ``lockdown`` and ``capability`` LSMs. In that case, these LSMs will appear at the beginning of the ``LSM: initializing`` log line as well, even if they are not configured in the boot loader.

OK, I integrated your suggestion. I guess capability is not really considered an LSM but it would be too confusing and out of scope for an user documentation to explain that.

Quoted 5 lines
Quoted 3 lines

+``lockdown,capability,`` may always stay at the beginning of the ``LSM:
+initializing lsm=`` list even if they are not configured with the bootloader,

Nit: The man pages spell this in two words as "boot loader".

OK, I'll use "boot loader" too.

Quoted 11 lines
Quoted 11 lines
Documentation/userspace-api/landlock.rst +5 -0
+which is OK.
+
+Network support
+---------------
+
 To be able to explicitly allow TCP operations (e.g., adding a network rule with
 ``LANDLOCK_ACCESS_NET_BIND_TCP``), the kernel must support TCP
 (``CONFIG_INET=y``).  Otherwise, sys_landlock_add_rule() returns an
Quoted 6 lines
Quoted 4 lines

base-commit: b4007fd27206c478a4b76e299bddf4a71787f520

Signature · 1 line
2.44.0

Thanks!

Reviewed-by
#4 lore raw

Hi Mickaël, Günther,

Sorry for the delay!

Quoted 21 lines · Mickaël Salaün

CCing Alejandro

Quoted 18 lines · Günther Noack
Quoted 17 lines · Mickaël Salaün

Extend the kernel support section with one subsection for build time configuration and another for boot time configuration.

Extend the boot time subsection with a concrete example.

Update the journalctl command to include the boot option.

Cc Günther Noack <[email protected]>
Cc Kees Cook <[email protected]>

---

Changes since v1:
* New patch, suggested by Kees Cook.

---
 Documentation/userspace-api/landlock.rst | 57 +++++++++++++++++++++---
 1 file changed, 51 insertions(+), 6 deletions(-)

[...]

Quoted 19 lines
Quoted 17 lines
Quoted 5 lines
Documentation/userspace-api/landlock.rst +5 -0
+
+  lsm=landlock,lockdown,yama,integrity,apparmor
+
+After a reboot, we can check that Landlock is up and running by looking at
+kernel logs:

Documentation/userspace-api/landlock.rst contains ``CONFIG_LSM=landlock,[...]`` with ``[...]`` as the list of other · line 552

Quoted 10 lines
Documentation/userspace-api/landlock.rst +10 -0
+
+.. code-block:: console
+
+    # dmesg | grep landlock || journalctl -kb -g landlock
+    [    0.000000] Command line: [...] lsm=landlock,lockdown,yama,integrity,apparmor
+    [    0.000000] Kernel command line: [...] lsm=landlock,lockdown,yama,integrity,apparmor
+    [    0.000000] LSM: initializing lsm=lockdown,capability,landlock,yama,integrity,apparmor
+    [    0.000000] landlock: Up and running.
+
+Note that according to the built time kernel configuration,

s/built time/build time/

Quoted 1 line
                 ^
Quoted 1 line

OK

Here, this should actually be "build-time" since it works as an adjective.

Quoted 7 lines
Quoted 7 lines

It feels like the phrase "according to" could be slightly more specific here.

To paraphrase Alejandro Colomar, "Note that" is usually redundant.
https://lore.kernel.org/all/[email protected]/

Quoted 6 lines
Quoted 6 lines

I'd suggest:

The kernel may be configured at build time to always load the ``lockdown`` and ``capability`` LSMs. In that case, these LSMs will appear at the beginning of the ``LSM: initializing`` log line as well, even if they are not configured in the boot loader.

LGTM

Quoted 24 lines

OK, I integrated your suggestion. I guess capability is not really considered an LSM but it would be too confusing and out of scope for an user documentation to explain that.

Quoted 5 lines
Quoted 3 lines

+``lockdown,capability,`` may always stay at the beginning of the ``LSM:
+initializing lsm=`` list even if they are not configured with the bootloader,

Nit: The man pages spell this in two words as "boot loader".

OK, I'll use "boot loader" too.

Quoted 11 lines
Quoted 11 lines
Documentation/userspace-api/landlock.rst +5 -0
+which is OK.
+
+Network support
+---------------
+
 To be able to explicitly allow TCP operations (e.g., adding a network rule with
 ``LANDLOCK_ACCESS_NET_BIND_TCP``), the kernel must support TCP
 (``CONFIG_INET=y``).  Otherwise, sys_landlock_add_rule() returns an
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

base-commit: b4007fd27206c478a4b76e299bddf4a71787f520

Signature · 1 line
2.44.0

Thanks!

Have a lovely day!
Alex

Signature · 2 lines
<https://www.alejandro-colomar.es/>
Looking for a remote C programming job at the moment.
author maintainer
#5 lore raw
Quoted 48 lines · Alejandro Colomar

Hi Mickaël, Günther,

Sorry for the delay!

Quoted 21 lines · Mickaël Salaün

CCing Alejandro

Quoted 18 lines · Günther Noack
Quoted 17 lines · Mickaël Salaün

Extend the kernel support section with one subsection for build time configuration and another for boot time configuration.

Extend the boot time subsection with a concrete example.

Update the journalctl command to include the boot option.

Cc Günther Noack <[email protected]>
Cc Kees Cook <[email protected]>

---

Changes since v1:
* New patch, suggested by Kees Cook.

---
 Documentation/userspace-api/landlock.rst | 57 +++++++++++++++++++++---
 1 file changed, 51 insertions(+), 6 deletions(-)

[...]

Quoted 19 lines
Quoted 18 lines
Quoted 5 lines
Documentation/userspace-api/landlock.rst +5 -0
+
+  lsm=landlock,lockdown,yama,integrity,apparmor
+
+After a reboot, we can check that Landlock is up and running by looking at
+kernel logs:

Documentation/userspace-api/landlock.rst contains ``CONFIG_LSM=landlock,[...]`` with ``[...]`` as the list of other · line 552

Quoted 10 lines
Documentation/userspace-api/landlock.rst +10 -0
+
+.. code-block:: console
+
+    # dmesg | grep landlock || journalctl -kb -g landlock
+    [    0.000000] Command line: [...] lsm=landlock,lockdown,yama,integrity,apparmor
+    [    0.000000] Kernel command line: [...] lsm=landlock,lockdown,yama,integrity,apparmor
+    [    0.000000] LSM: initializing lsm=lockdown,capability,landlock,yama,integrity,apparmor
+    [    0.000000] landlock: Up and running.
+
+Note that according to the built time kernel configuration,

s/built time/build time/

                 ^
Quoted 4 lines
Quoted 1 line

OK

Here, this should actually be "build-time" since it works as an adjective.

Thanks Alex but this was already merged:
https://git.kernel.org/torvalds/c/35e886e88c803920644c9d3abb45a9ecb7f1e761

Because I picked Günther's below suggestion, it should be good right?

Quoted 58 lines
Quoted 8 lines
Quoted 8 lines

It feels like the phrase "according to" could be slightly more specific here.

To paraphrase Alejandro Colomar, "Note that" is usually redundant.
https://lore.kernel.org/all/[email protected]/

Quoted 6 lines
Quoted 6 lines

I'd suggest:

The kernel may be configured at build time to always load the ``lockdown`` and ``capability`` LSMs. In that case, these LSMs will appear at the beginning of the ``LSM: initializing`` log line as well, even if they are not configured in the boot loader.

LGTM

Quoted 24 lines

OK, I integrated your suggestion. I guess capability is not really considered an LSM but it would be too confusing and out of scope for an user documentation to explain that.

Quoted 5 lines
Quoted 3 lines

+``lockdown,capability,`` may always stay at the beginning of the ``LSM:
+initializing lsm=`` list even if they are not configured with the bootloader,

Nit: The man pages spell this in two words as "boot loader".

OK, I'll use "boot loader" too.

Quoted 11 lines
Quoted 11 lines
Documentation/userspace-api/landlock.rst +5 -0
+which is OK.
+
+Network support
+---------------
+
 To be able to explicitly allow TCP operations (e.g., adding a network rule with
 ``LANDLOCK_ACCESS_NET_BIND_TCP``), the kernel must support TCP
 (``CONFIG_INET=y``).  Otherwise, sys_landlock_add_rule() returns an
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

base-commit: b4007fd27206c478a4b76e299bddf4a71787f520

Signature · 1 line
2.44.0

Thanks!

Have a lovely day!
Alex

Signature · 2 lines
<https://www.alejandro-colomar.es/>
Looking for a remote C programming job at the moment.
#6 lore raw

Hi Mickaël!

Quoted 51 lines · Mickaël Salaün
Quoted 50 lines · Alejandro Colomar

Hi Mickaël, Günther,

Sorry for the delay!

Quoted 21 lines · Mickaël Salaün

CCing Alejandro

Quoted 18 lines · Günther Noack
Quoted 17 lines · Mickaël Salaün

Extend the kernel support section with one subsection for build time configuration and another for boot time configuration.

Extend the boot time subsection with a concrete example.

Update the journalctl command to include the boot option.

Cc Günther Noack <[email protected]>
Cc Kees Cook <[email protected]>

---

Changes since v1:
* New patch, suggested by Kees Cook.

---
 Documentation/userspace-api/landlock.rst | 57 +++++++++++++++++++++---
 1 file changed, 51 insertions(+), 6 deletions(-)

[...]

Quoted 20 lines
Quoted 17 lines
Quoted 5 lines
Documentation/userspace-api/landlock.rst +5 -0
+
+  lsm=landlock,lockdown,yama,integrity,apparmor
+
+After a reboot, we can check that Landlock is up and running by looking at
+kernel logs:

Documentation/userspace-api/landlock.rst contains ``CONFIG_LSM=landlock,[...]`` with ``[...]`` as the list of other · line 552

Quoted 10 lines
Documentation/userspace-api/landlock.rst +10 -0
+
+.. code-block:: console
+
+    # dmesg | grep landlock || journalctl -kb -g landlock
+    [    0.000000] Command line: [...] lsm=landlock,lockdown,yama,integrity,apparmor
+    [    0.000000] Kernel command line: [...] lsm=landlock,lockdown,yama,integrity,apparmor
+    [    0.000000] LSM: initializing lsm=lockdown,capability,landlock,yama,integrity,apparmor
+    [    0.000000] landlock: Up and running.
+
+Note that according to the built time kernel configuration,

s/built time/build time/

Quoted 1 line
                 ^

OK

Quoted 7 lines
Quoted 2 lines

Here, this should actually be "build-time" since it works as an adjective.

Thanks Alex but this was already merged:
https://git.kernel.org/torvalds/c/35e886e88c803920644c9d3abb45a9ecb7f1e761

Because I picked Günther's below suggestion, it should be good right?

Yeah, it's a minor grammar mistake that is widespread elsewhere. If you want to patch it, go ahead, if you want to keep it until next time you revise this text, it's not something that will significantly hurt the understanding of the text.

See also: <https://www.grammar-monster.com/lessons/hyphens_in_compound_adjectives.htm>

Have a lovely day!
Alex

Quoted 61 lines
Quoted 59 lines
Quoted 9 lines
Quoted 9 lines

It feels like the phrase "according to" could be slightly more specific here.

To paraphrase Alejandro Colomar, "Note that" is usually redundant.
https://lore.kernel.org/all/[email protected]/

Quoted 6 lines
Quoted 6 lines

I'd suggest:

The kernel may be configured at build time to always load the ``lockdown`` and ``capability`` LSMs. In that case, these LSMs will appear at the beginning of the ``LSM: initializing`` log line as well, even if they are not configured in the boot loader.

LGTM

Quoted 24 lines

OK, I integrated your suggestion. I guess capability is not really considered an LSM but it would be too confusing and out of scope for an user documentation to explain that.

Quoted 5 lines
Quoted 3 lines

+``lockdown,capability,`` may always stay at the beginning of the ``LSM:
+initializing lsm=`` list even if they are not configured with the bootloader,

Nit: The man pages spell this in two words as "boot loader".

OK, I'll use "boot loader" too.

Quoted 11 lines
Quoted 11 lines
Documentation/userspace-api/landlock.rst +5 -0
+which is OK.
+
+Network support
+---------------
+
 To be able to explicitly allow TCP operations (e.g., adding a network rule with
 ``LANDLOCK_ACCESS_NET_BIND_TCP``), the kernel must support TCP
 (``CONFIG_INET=y``).  Otherwise, sys_landlock_add_rule() returns an
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

base-commit: b4007fd27206c478a4b76e299bddf4a71787f520

Signature · 1 line
2.44.0

Thanks!

Have a lovely day!
Alex

Signature · 2 lines
<https://www.alejandro-colomar.es/>
Looking for a remote C programming job at the moment.
Signature · 2 lines
<https://www.alejandro-colomar.es/>
Looking for a remote C programming job at the moment.