[Devel] [PATCH hci-8.1 v3 4/6] ve/printk: Fix time virtualization
Konstantin Khorenko
khorenko at virtuozzo.com
Thu Nov 12 19:35:40 MSK 2026
I won't apply this version, please send v4 with the changes below.
On Mon, 12 Oct 2026 00:52:31 +0200, Vladimir Riabchun <vladimir.riabchun at virtuozzo.com> wrote:
> The usage of get_exec_env() in ve_timens_add_boottime_ns can lead
> to time travels - a printk from IRQ might use container time for
> printing to host dmesg and vice versa.
Item 4 of the cover letter reply: describe the real broken case and
the records that stay unshifted, and add the Fixes tags.
Why: the shift was applied by whoever formatted the record. A CT log
is read only by tasks of that CT, so "vice versa" did not happen. The
host log was formatted for the console by any context that flushed
it: a CT task's own printk, or an IRQ on top of a CT task. Host
console lines then carried that CT's uptime.
The code is fine. But records stored while the CT has no ve_nsproxy,
before start or after stop, now keep host time for good. Explicit-ve
writers such as netfilter can reach a CT log then. Please say so.
The Fixes tags name commits 1249fbadd45b3 ("syslog: Virtualize
timestamps in the data reported") and 8b42370ae936e ("kmsg: Virtualize
timestamps in /dev/ksmg output").
> struct log_state *ve_log_state(void);
> +struct log_state *__ve_log_state(struct ve_struct *ve);
Item 2 of the cover letter reply: drop this line, __ve_log_state()
becomes static in patch 3.
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
More information about the Devel
mailing list