Skip to contentSkip to conversation

setns: add missing info about time ns

PATCH In review Michal Clapinski 2 participants 2 messages Jan 7, 2025 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 setns: add missing info about time ns

Only singlethreaded processes can setns into time ns.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/time/namespace.c?h=v6.12#n309

---
 man/man2/setns.2 | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
man/man2/setns.2 +11 -1
index f32a91bd8..619717b77 100644
@@ -237,7 +237,17 @@ Using
 to change the caller's cgroup namespace does not change
 the caller's cgroup memberships.
 .TP
-Network, IPC, time, and UTS namespaces
+Time namespaces
+In order to reassociate itself with a new time namespace,
+the caller must have the
+.B CAP_SYS_ADMIN
+capability both in its own user namespace and in the user namespace
+that owns the target namespace.
+.IP
+A multithreaded process may not change time namespace with
+.BR setns ().
+.TP
+Network, IPC, and UTS namespaces
 In order to reassociate itself with a new network, IPC, time, or UTS namespace,
 the caller must have the
 .B CAP_SYS_ADMIN
Signature · 1 line
2.47.1.613.gc27f4b7a9f-goog
#1 lore raw

Hi Michael,

Quoted 4 lines · Michal Clapinski

Only singlethreaded processes can setns into time ns.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/time/namespace.c?h=v6.12#n309

Thanks for the patch! I have slightly adapted the commit message, and applied the patch.
<https://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/commit/?h=contrib&id=48618d7701d55ca9401b259bb4e6200d841df6d0>

Cheers,
Alex

Quoted 30 lines
---
 man/man2/setns.2 | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
man/man2/setns.2 +11 -1
index f32a91bd8..619717b77 100644
@@ -237,7 +237,17 @@ Using
 to change the caller's cgroup namespace does not change
 the caller's cgroup memberships.
 .TP
-Network, IPC, time, and UTS namespaces
+Time namespaces
+In order to reassociate itself with a new time namespace,
+the caller must have the
+.B CAP_SYS_ADMIN
+capability both in its own user namespace and in the user namespace
+that owns the target namespace.
+.IP
+A multithreaded process may not change time namespace with
+.BR setns ().
+.TP
+Network, IPC, and UTS namespaces
 In order to reassociate itself with a new network, IPC, time, or UTS namespace,
 the caller must have the
 .B CAP_SYS_ADMIN
Signature · 1 line
2.47.1.613.gc27f4b7a9f-goog
Signature · 1 line
<https://www.alejandro-colomar.es/>