Skip to contentSkip to conversation

landlock: Remove useless include

PATCH In review Mickaël Salaün 2 participants 10 messages Dec 19, 2025 – Dec 23, 2025

Subsystems (2)
lore
Share & tools
lore

Mickaël Salaün

author maintainer
#0 lore raw

PATCH 1/5 landlock: Remove useless include

Remove useless audit.h include.

Cc Günther Noack <[email protected]>
Fixes 33e65b0d3add ("landlock: Add AUDIT_LANDLOCK_ACCESS and log ptrace denials")
---
 security/landlock/ruleset.c | 1 -
 1 file changed, 1 deletion(-)
security/landlock/ruleset.c +0 -1
index dfcdc19ea268..0a5b0c76b3f7 100644
@@ -23,7 +23,6 @@
 #include <linux/workqueue.h>
 
 #include "access.h"
-#include "audit.h"
 #include "domain.h"
 #include "limits.h"
 #include "object.h"
Signature · 1 line
2.52.0
author maintainer
#1 lore raw

PATCH 2/5 landlock: Improve erratum documentation

Improve description about scoped signal handling.

---
 security/landlock/errata/abi-6.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
security/landlock/errata/abi-6.h +1 -1
index df7bc0e1fdf4..5113a829f87e 100644
@@ -9,7 +9,7 @@
  * This fix addresses an issue where signal scoping was overly restrictive,
  * preventing sandboxed threads from signaling other threads within the same
  * process if they belonged to different domains.  Because threads are not
- * security boundaries, user space might assume that any thread within the same
+ * security boundaries, user space might assume that all threads within the same
  * process can send signals between themselves (see :manpage:`nptl(7)` and
  * :manpage:`libpsx(3)`).  Consistent with :manpage:`ptrace(2)` behavior, direct
  * interaction between threads of the same process should always be allowed.
Signature · 1 line
2.52.0
author maintainer
#3 lore raw

PATCH 3/5 landlock: Clean up hook_ptrace_access_check()

In reply to Mickaël Salaün

Make variable's scope minimal in hook_ptrace_access_check().

---
 security/landlock/task.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
security/landlock/task.c +2 -2
index 2385017418ca..bf4ed15a7f01 100644
@@ -86,7 +86,6 @@ static int hook_ptrace_access_check(struct task_struct *const child,
 				    const unsigned int mode)
 {
 	const struct landlock_cred_security *parent_subject;
-	const struct landlock_ruleset *child_dom;
 	int err;
 
 	/* Quick return for non-landlocked tasks. */
@@ -96,7 +95,8 @@ static int hook_ptrace_access_check(struct task_struct *const child,
 
 	scoped_guard(rcu)
 	{
-		child_dom = landlock_get_task_domain(child);
+		const struct landlock_ruleset *const child_dom =
+			landlock_get_task_domain(child);
 		err = domain_ptrace(parent_subject->domain, child_dom);
 	}
 
Signature · 1 line
2.52.0
author maintainer
#5 lore raw

PATCH 4/5 landlock: Fix spelling

In reply to Mickaël Salaün
---
 security/landlock/domain.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
security/landlock/domain.h +1 -1
index 7fb70b25f85a..621f054c9a2b 100644
@@ -97,7 +97,7 @@ struct landlock_hierarchy {
 	 */
 	atomic64_t num_denials;
 	/**
-	 * @id: Landlock domain ID, sets once at domain creation time.
+	 * @id: Landlock domain ID, set once at domain creation time.
 	 */
 	u64 id;
 	/**
Signature · 1 line
2.52.0
Reviewed-by on v1 4/5
#6 lore raw

Re: [PATCH v1 4/5] landlock: Fix spelling

Quoted 22 lines · Mickaël Salaün
---
 security/landlock/domain.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
security/landlock/domain.h +1 -1
index 7fb70b25f85a..621f054c9a2b 100644
@@ -97,7 +97,7 @@ struct landlock_hierarchy {
 	 */
 	atomic64_t num_denials;
 	/**
-	 * @id: Landlock domain ID, sets once at domain creation time.
+	 * @id: Landlock domain ID, set once at domain creation time.
 	 */
 	u64 id;
 	/**
Signature · 1 line
2.52.0
author maintainer
#7 lore raw

PATCH 5/5 landlock: Fix formatting

In reply to Mickaël Salaün

Format with clang-format -i security/landlock/*.[ch]

Cc Christian Brauner <[email protected]>
Cc Günther Noack <[email protected]>
Cc Mateusz Guzik <[email protected]>
Fixes b4dbfd8653b3 ("Coccinelle-based conversion to use ->i_state accessors")
---
 security/landlock/fs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
security/landlock/fs.c +2 -1
index fe794875ad46..e3c3a8a9ac27 100644
@@ -1314,7 +1314,8 @@ static void hook_sb_delete(struct super_block *const sb)
 		 * second call to iput() for the same Landlock object.  Also
 		 * checks I_NEW because such inode cannot be tied to an object.
 		 */
-		if (inode_state_read(inode) & (I_FREEING | I_WILL_FREE | I_NEW)) {
+		if (inode_state_read(inode) &
+		    (I_FREEING | I_WILL_FREE | I_NEW)) {
 			spin_unlock(&inode->i_lock);
 			continue;
 		}
Signature · 1 line
2.52.0
Reviewed-by on v1 5/5
#8 lore raw

Re: [PATCH v1 5/5] landlock: Fix formatting

Quoted 28 lines · Mickaël Salaün

Format with clang-format -i security/landlock/*.[ch]

Cc Christian Brauner <[email protected]>
Cc Günther Noack <[email protected]>
Cc Mateusz Guzik <[email protected]>
Fixes b4dbfd8653b3 ("Coccinelle-based conversion to use ->i_state accessors")
---
 security/landlock/fs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
security/landlock/fs.c +2 -1
index fe794875ad46..e3c3a8a9ac27 100644
@@ -1314,7 +1314,8 @@ static void hook_sb_delete(struct super_block *const sb)
 		 * second call to iput() for the same Landlock object.  Also
 		 * checks I_NEW because such inode cannot be tied to an object.
 		 */
-		if (inode_state_read(inode) & (I_FREEING | I_WILL_FREE | I_NEW)) {
+		if (inode_state_read(inode) &
+		    (I_FREEING | I_WILL_FREE | I_NEW)) {
 			spin_unlock(&inode->i_lock);
 			continue;
 		}
Signature · 1 line
2.52.0
Reviewed-by on v1 1/5
#9 lore raw
In reply to Mickaël Salaün
Quoted 24 lines · Mickaël Salaün

Remove useless audit.h include.

Cc Günther Noack <[email protected]>
Fixes 33e65b0d3add ("landlock: Add AUDIT_LANDLOCK_ACCESS and log ptrace denials")
---
 security/landlock/ruleset.c | 1 -
 1 file changed, 1 deletion(-)
security/landlock/ruleset.c +0 -1
index dfcdc19ea268..0a5b0c76b3f7 100644
@@ -23,7 +23,6 @@
 #include <linux/workqueue.h>
 
 #include "access.h"
-#include "audit.h"
 #include "domain.h"
 #include "limits.h"
 #include "object.h"
Signature · 1 line
2.52.0