[Devel] [PATCH hci-8.1 v3 0/6] ve/printk: Fix logs leakage via ve_printk called from IRQ context

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:27 +0200, Vladimir Riabchun <vladimir.riabchun at virtuozzo.com> wrote:
> Vladimir Riabchun (6):
>       ve/printk: Add sanity checks in ve_printk functions
>       ve/printk: Report potentially leaking usage of ve_printk functions
>       ve/printk: Specify ve in printks
>       ve/printk: Fix time virtualization
>       ve/failcount: Use ve_printk with specified ve
>       ve: add neigh_tbl failcounter

The approach is fine: after the series nothing outside task context
picks a container log from get_exec_env(). What to change for v4:

1. Patch 3: rename the local "__ve" in ve_printk_ratelimited() to a
   name no caller uses, and write "(dst)" in the macro.

2. Patch 3: make __ve_log_state() static, it is used only in printk.c.
   Drop its prototype from internal.h in patch 4.

3. Patch 3: rewrite the message. Say what users see change: the
   conntrack table full, expectation table full and TCPMSS messages
   now go to the log of net->owner_ve, and ve_printk_ratelimited()
   with VE_LOG outside task context warns and prints to the host log.
   Add Fixes tags for a335738ad21cf and bc279343e9663.

4. Patch 4: rewrite the message around the real broken case, and say
   that records stored while the CT has no ve_nsproxy keep host time.
   Add Fixes tags for 1249fbadd45b3 and 8b42370ae936e.

5. Patch 6: count and warn only when !ve_is_super(ve), as Vasileios
   asked.

6. Patch 6: keep one Feature: line, "per-ve failcounters".

7. Patch 2: add a Fixes tag for 8c24627ed5346 ("ve/printk: Introduce
   ve_printk()").

8. Patch 5: double space in "Use new  __ve_printk helpers".

9. Patch 1: say why the condition is reordered (so that patch 2 can
   put the WARN before the get_exec_env() check), or fold the reorder
   into patch 2.

10. Cover letter:
    - "No tests crashed" says nothing here: these WARNs do not crash
      without panic_on_warn. Say whether dmesg showed a WARNING from
      these functions in the neoltp runs.
    - "failcounts can be now used in any context": not under the
      scheduler locks, __ve_printk() is not deferred. "can now be
      used" in softirq and hardirq.
    - Typos: "there an no", "GET)VE_LOG".

Separate patches, not needed for v4:

1. WARN_ON_ONCE() sits inside the shared functions, so only the first
   offending call site per boot gets a backtrace. A once flag per
   caller would report all of them.

2. ve_offline() does kfree(ve->ve_name) without RCU, while conntrack
   and now neigh_alloc() read ve_name(net->owner_ve) from softirq. The
   netns can outlive the offline cgroup.

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team



More information about the Devel mailing list