* [Bug 217547] New: The shell example in time_namespaces doesn't behave as documented
@ 2023-06-13 15:00 bugzilla-daemon
2023-06-25 12:06 ` [Bug 217547] " bugzilla-daemon
2023-06-25 15:59 ` bugzilla-daemon
0 siblings, 2 replies; 3+ messages in thread
From: bugzilla-daemon @ 2023-06-13 15:00 UTC (permalink / raw)
To: linux-man
https://bugzilla.kernel.org/show_bug.cgi?id=217547
Bug ID: 217547
Summary: The shell example in time_namespaces doesn't behave as
documented
Product: Documentation
Version: unspecified
Hardware: All
OS: Linux
Status: NEW
Severity: normal
Priority: P3
Component: man-pages
Assignee: documentation_man-pages@kernel-bugs.osdl.org
Reporter: goeran@uddeborg.se
Regression: No
Trying the shell example in the manual page for time_namespaces(7) does not
behave for me the way the manual page says it should. From what I can tell, it
appears that the new shell ITSELF immediately enters the new namespace, rather
than allowing for children to enter. This makes it impossible to write anything
to the time_for_children file.
Using the --boottime flag to unshare gives the expected behavior. Does an
exec() trigger entering the new time namespace nowadays?
This was tested on a Fedora 38 system running kernel 6.2.14-300.fc38.
Example session:
kalle$$ readlink /proc/$$/ns/time
time:[4026531834]
kalle$$ LANG=en_US.utf8 PS1="ns2# " sudo unshare -T -- bash --norc
[sudo] password for göran:
bash-5.2# echo "monotonic $((2*24*60*60)) 0" > /proc/$$/timens_offsets
bash: echo: write error: Permission denied
bash-5.2# readlink /proc/$$/ns/time
time:[4026532249]
bash-5.2# readlink /proc/$$/ns/time_for_children
time:[4026532249]
--
You may reply to this email to add a comment.
You are receiving this mail because:
You are watching the assignee of the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug 217547] The shell example in time_namespaces doesn't behave as documented
2023-06-13 15:00 [Bug 217547] New: The shell example in time_namespaces doesn't behave as documented bugzilla-daemon
@ 2023-06-25 12:06 ` bugzilla-daemon
2023-06-25 15:59 ` bugzilla-daemon
1 sibling, 0 replies; 3+ messages in thread
From: bugzilla-daemon @ 2023-06-25 12:06 UTC (permalink / raw)
To: linux-man
https://bugzilla.kernel.org/show_bug.cgi?id=217547
Thomas Weißschuh (kernel@t-8ch.de) changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kernel@t-8ch.de
--- Comment #1 from Thomas Weißschuh (kernel@t-8ch.de) ---
It seems in commit 2b5f9dad32ed ("fs/exec: switch timens when a task gets a new
mm")
the time namespace is frozen on exec().
begin_new_exec()
exec_task_namespaces()
timens_on_fork()
timens_commit()
timens_set_vvar_page()
ns->frozen_offsets = true
As a workaround you could use "unshare -T --monotonic $((2*24*60*60))" to let
unshare set the offsets directly.
--
You may reply to this email to add a comment.
You are receiving this mail because:
You are watching the assignee of the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug 217547] The shell example in time_namespaces doesn't behave as documented
2023-06-13 15:00 [Bug 217547] New: The shell example in time_namespaces doesn't behave as documented bugzilla-daemon
2023-06-25 12:06 ` [Bug 217547] " bugzilla-daemon
@ 2023-06-25 15:59 ` bugzilla-daemon
1 sibling, 0 replies; 3+ messages in thread
From: bugzilla-daemon @ 2023-06-25 15:59 UTC (permalink / raw)
To: linux-man
https://bugzilla.kernel.org/show_bug.cgi?id=217547
--- Comment #2 from Göran Uddeborg (goeran@uddeborg.se) ---
That command works as expected, but unfortunately it doesn't illustrate the
behaviour as nicely. For example, the direct writes will not be visible, and
"time" and "time_for_children" will no longer differ.
--
You may reply to this email to add a comment.
You are receiving this mail because:
You are watching the assignee of the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-06-25 15:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-13 15:00 [Bug 217547] New: The shell example in time_namespaces doesn't behave as documented bugzilla-daemon
2023-06-25 12:06 ` [Bug 217547] " bugzilla-daemon
2023-06-25 15:59 ` bugzilla-daemon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox