Skip to contentSkip to conversation

landlock_restrict_self.2: Fix max number of nested sandboxes

PATCH In review Mickaël Salaün 3 participants 7 messages Mar 12, 2024 – Mar 14, 2024 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 landlock_restrict_self.2: Fix max number of nested sandboxes

This limit was updated and backported with commit 75c542d6c6cc ("landlock: Reduce the maximum number of layers to 16") to all supported Linux versions.

Cc Alejandro Colomar <[email protected]>
Cc Günther Noack <[email protected]>
---
 man2/landlock_restrict_self.2 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
man2/landlock_restrict_self.2 +1 -1
index 43f15c932a83..fb7e48234098 100644
@@ -102,7 +102,7 @@ in its user namespace.
 .TP
 .B E2BIG
 The maximum number of composed rulesets is reached for the calling thread.
-This limit is currently 64.
+This limit is currently 16.
 .SH STANDARDS
 Linux.
 .SH HISTORY
Signature · 1 line
2.44.0
#1 lore raw
Quoted 27 lines · Mickaël Salaün

This limit was updated and backported with commit 75c542d6c6cc ("landlock: Reduce the maximum number of layers to 16") to all supported Linux versions.

Cc Alejandro Colomar <[email protected]>
Cc Günther Noack <[email protected]>
---
 man2/landlock_restrict_self.2 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
man2/landlock_restrict_self.2 +1 -1
index 43f15c932a83..fb7e48234098 100644
@@ -102,7 +102,7 @@ in its user namespace.
 .TP
 .B E2BIG
 The maximum number of composed rulesets is reached for the calling thread.
-This limit is currently 64.
+This limit is currently 16.
 .SH STANDARDS
 Linux.
 .SH HISTORY
Signature · 1 line
2.44.0
Reviewed-by on v1 1/1
#2 lore raw
In reply to Mickaël Salaün
Quoted 27 lines · Mickaël Salaün

This limit was updated and backported with commit 75c542d6c6cc ("landlock: Reduce the maximum number of layers to 16") to all supported Linux versions.

Cc Alejandro Colomar <[email protected]>
Cc Günther Noack <[email protected]>
---
 man2/landlock_restrict_self.2 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
man2/landlock_restrict_self.2 +1 -1
index 43f15c932a83..fb7e48234098 100644
@@ -102,7 +102,7 @@ in its user namespace.
 .TP
 .B E2BIG
 The maximum number of composed rulesets is reached for the calling thread.
-This limit is currently 64.
+This limit is currently 16.
 .SH STANDARDS
 Linux.
 .SH HISTORY
Signature · 1 line
2.44.0

Of course, I meant to write:

(I need a coffee)

#3 lore raw

Hi Mickaël and Günther!

Quoted 31 lines · Günther Noack
Quoted 27 lines · Mickaël Salaün

This limit was updated and backported with commit 75c542d6c6cc ("landlock: Reduce the maximum number of layers to 16") to all supported Linux versions.

Cc Alejandro Colomar <[email protected]>
Cc Günther Noack <[email protected]>
---
 man2/landlock_restrict_self.2 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
man2/landlock_restrict_self.2 +1 -1
index 43f15c932a83..fb7e48234098 100644
@@ -102,7 +102,7 @@ in its user namespace.
 .TP
 .B E2BIG
 The maximum number of composed rulesets is reached for the calling thread.
-This limit is currently 64.
+This limit is currently 16.
 .SH STANDARDS
 Linux.
 .SH HISTORY
Signature · 1 line
2.44.0

Of course, I meant to write:

Quoted 1 line

Patch and tag applied. Thank you both!

Quoted 2 lines

(I need a coffee)

Have a lovely day! (and a coffe :)

Alex

Signature · 1 line
<https://www.alejandro-colomar.es/>
#4 lore raw

Hi Günther, Mickaël,

Quoted 5 lines · Alejandro Colomar
Quoted 5 lines

man2/landlock_restrict_self.2 in its user namespace. · line 105

Quoted 5 lines

.TP
.B E2BIG
The maximum number of composed rulesets is reached for the calling thread.

man2/landlock_restrict_self.2 +1 -1
-This limit is currently 64.
+This limit is currently 16.

BTW, do you think this limit change is something relevant for HISTORY? Or should we maybe not document the limit? Or maybe should the kernel provide a macro to name that limit (and thus let a user grep it in their headers to learn their specific value)? Or maybe a combination?

Cheers,
Alex

Signature · 1 line
<https://www.alejandro-colomar.es/>
#5 lore raw
Quoted 13 lines · Alejandro Colomar

Hi Günther, Mickaël,

Quoted 5 lines · Alejandro Colomar
Quoted 5 lines

man2/landlock_restrict_self.2 in its user namespace. · line 105

Quoted 5 lines

.TP
.B E2BIG
The maximum number of composed rulesets is reached for the calling thread.

man2/landlock_restrict_self.2 +1 -1
-This limit is currently 64.
+This limit is currently 16.

BTW, do you think this limit change is something relevant for HISTORY? Or should we maybe not document the limit? Or maybe should the kernel provide a macro to name that limit (and thus let a user grep it in their headers to learn their specific value)? Or maybe a combination?

I doubt that anyone has run into that limit in real life yet (but I'd be happy to learn about it if they did).

I think the most important reason why this limit is mentionworthy is because landlock_restrict_self() can fail when a process is trying to stack the N+1th Landlock policy on top. For programs that don't know all of their parent processes in detail, they anyway can't make assumptions about how many policies can still be stacked. So whether the limit is 64 or 16, it does not make much of a difference for the code that people have to write.

—Günther

#6 lore raw
Quoted 18 lines · Günther Noack
Quoted 13 lines · Alejandro Colomar

Hi Günther, Mickaël,

Quoted 5 lines · Alejandro Colomar
Quoted 5 lines

man2/landlock_restrict_self.2 in its user namespace. · line 105

Quoted 5 lines

.TP
.B E2BIG
The maximum number of composed rulesets is reached for the calling thread.

man2/landlock_restrict_self.2 +1 -1
-This limit is currently 64.
+This limit is currently 16.

BTW, do you think this limit change is something relevant for HISTORY? Or should we maybe not document the limit? Or maybe should the kernel provide a macro to name that limit (and thus let a user grep it in their headers to learn their specific value)? Or maybe a combination?

I doubt that anyone has run into that limit in real life yet (but I'd be happy to learn about it if they did).

Quoted 6 lines

I think the most important reason why this limit is mentionworthy is because landlock_restrict_self() can fail when a process is trying to stack the N+1th Landlock policy on top. For programs that don't know all of their parent processes in detail, they anyway can't make assumptions about how many policies can still be stacked. So whether the limit is 64 or 16, it does not make much of a difference for the code that people have to write.

Hmmm, thanks!

Cheers,
Alex

Quoted 1 line

—Günther

Signature · 1 line
<https://www.alejandro-colomar.es/>