[19/21] linux: Enable Landlock support

Message ID 6f89772f-8082-e4bd-d2eb-8c0a16f00a42@ipfire.org
State Accepted
Commit 41d58ef4f39924322c6517e1efc27d7f57be4dd0
Headers
Series linux: Update to 5.15.85 and backport many IPFire 3.x changes |

Commit Message

Peter Müller Dec. 26, 2022, 7:30 p.m. UTC
  From the kernel's documentation:

> Landlock is a sandboxing mechanism that enables processes to restrict
> themselves (and their future children) by gradually enforcing
> tailored access control policies. A Landlock security policy is a
> set of access rights (e.g. open a file in read-only, make a
> directory, etc.) tied to a file hierarchy. Such policy can be
> configured and enforced by any processes for themselves using the
> dedicated system calls: landlock_create_ruleset(),
> landlock_add_rule(), and landlock_restrict_self().

There is no harm in enabling this security feature, so applications
supporting Landlock can benefit from it.

Rolled forward from https://patchwork.ipfire.org/project/ipfire/patch/d7ac0caf-5a7c-bcca-6293-16c773523942@ipfire.org/
to submit all kernel-related changes as a single patchset.

Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
---
 config/kernel/kernel.config.x86_64-ipfire | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Michael Tremer Dec. 27, 2022, 11:36 a.m. UTC | #1
I believe that nothing will use this, yet, so it should not break anything turning it on:

Acked-by: Michael Tremer <michael.tremer@ipfire.org>

> On 26 Dec 2022, at 20:30, Peter Müller <peter.mueller@ipfire.org> wrote:
> 
> From the kernel's documentation:
> 
>> Landlock is a sandboxing mechanism that enables processes to restrict
>> themselves (and their future children) by gradually enforcing
>> tailored access control policies. A Landlock security policy is a
>> set of access rights (e.g. open a file in read-only, make a
>> directory, etc.) tied to a file hierarchy. Such policy can be
>> configured and enforced by any processes for themselves using the
>> dedicated system calls: landlock_create_ruleset(),
>> landlock_add_rule(), and landlock_restrict_self().
> 
> There is no harm in enabling this security feature, so applications
> supporting Landlock can benefit from it.
> 
> Rolled forward from https://patchwork.ipfire.org/project/ipfire/patch/d7ac0caf-5a7c-bcca-6293-16c773523942@ipfire.org/
> to submit all kernel-related changes as a single patchset.
> 
> Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
> Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
> ---
> config/kernel/kernel.config.x86_64-ipfire | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/config/kernel/kernel.config.x86_64-ipfire b/config/kernel/kernel.config.x86_64-ipfire
> index 3d9e01e38..3bdbf3476 100644
> --- a/config/kernel/kernel.config.x86_64-ipfire
> +++ b/config/kernel/kernel.config.x86_64-ipfire
> @@ -6874,7 +6874,7 @@ CONFIG_SECURITY_DMESG_RESTRICT=y
> CONFIG_SECURITY=y
> CONFIG_SECURITYFS=y
> # CONFIG_SECURITY_NETWORK is not set
> -# CONFIG_SECURITY_PATH is not set
> +CONFIG_SECURITY_PATH=y
> # CONFIG_INTEL_TXT is not set
> CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y
> CONFIG_HARDENED_USERCOPY=y
> @@ -6893,7 +6893,7 @@ CONFIG_SECURITY_LOCKDOWN_LSM_EARLY=y
> CONFIG_LOCK_DOWN_KERNEL_FORCE_NONE=y
> # CONFIG_LOCK_DOWN_KERNEL_FORCE_INTEGRITY is not set
> # CONFIG_LOCK_DOWN_KERNEL_FORCE_CONFIDENTIALITY is not set
> -# CONFIG_SECURITY_LANDLOCK is not set
> +CONFIG_SECURITY_LANDLOCK=y
> CONFIG_INTEGRITY=y
> # CONFIG_INTEGRITY_SIGNATURE is not set
> # CONFIG_IMA is not set
> -- 
> 2.35.3
  

Patch

diff --git a/config/kernel/kernel.config.x86_64-ipfire b/config/kernel/kernel.config.x86_64-ipfire
index 3d9e01e38..3bdbf3476 100644
--- a/config/kernel/kernel.config.x86_64-ipfire
+++ b/config/kernel/kernel.config.x86_64-ipfire
@@ -6874,7 +6874,7 @@  CONFIG_SECURITY_DMESG_RESTRICT=y
 CONFIG_SECURITY=y
 CONFIG_SECURITYFS=y
 # CONFIG_SECURITY_NETWORK is not set
-# CONFIG_SECURITY_PATH is not set
+CONFIG_SECURITY_PATH=y
 # CONFIG_INTEL_TXT is not set
 CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y
 CONFIG_HARDENED_USERCOPY=y
@@ -6893,7 +6893,7 @@  CONFIG_SECURITY_LOCKDOWN_LSM_EARLY=y
 CONFIG_LOCK_DOWN_KERNEL_FORCE_NONE=y
 # CONFIG_LOCK_DOWN_KERNEL_FORCE_INTEGRITY is not set
 # CONFIG_LOCK_DOWN_KERNEL_FORCE_CONFIDENTIALITY is not set
-# CONFIG_SECURITY_LANDLOCK is not set
+CONFIG_SECURITY_LANDLOCK=y
 CONFIG_INTEGRITY=y
 # CONFIG_INTEGRITY_SIGNATURE is not set
 # CONFIG_IMA is not set