From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (unknown [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 17BBA80799 for ; Tue, 6 Oct 2026 21:55:31 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 696LsAi4028131; Wed, 7 Oct 2026 00:54:11 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 696LsAi4028131 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="IVuPxZU9" Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 696Ls9JM028109 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Wed, 7 Oct 2026 00:54:09 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 696Ls9JM028109 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-49cdc4080ddso9986825e9.1 for ; Tue, 06 Oct 2026 14:54:09 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvBx1hkr4H9LGt91IopHJ16o3WEG2LhkCzMYpq5BGQA8kmtJHz67NMI+0yvlAinjKx71JcaYHjg==@openvz.org X-Gm-Message-State: AFuF++mh2+hUZCAhsIUhYF1wNfc9e7OIPXVlSffuh0xVKYBURuBBjiMz U9ubzsM5WuotA27Hk+mayx7V9myUIhpOtb1E1R0INk3M4gjKKcmPolg4Zmw0s47Y58yS69vqWIz nSw9QxXVvTTRrXwFu4iEKP1zoNaqEmalN7PEGYrxL5U/V7tlggY0nCg== X-Gm-Gg: AYBFou1bT5NVVyeiBEK5c/f0rq8eIuLQVj+HWrD7QBxrE//EbH7C24vibPT3isRJEzj PMHl6SgWdEE9fCeOqdm9871GdHV/ghJy5618LMdfQ5kHZJT4OFma4w+fEP5+jRgeLaE+FVwWaMy cH87q4i0xsTvEZgf9YlP+zLnHJCYi/jnYBBoUnAeCcfjkVujintsLlqdAYYPGgiAaGUNcc5k/YM 67GVmcNorhnsGnltS5TEY7wwXBQSnPH0a00j2DkQMQQeobv/VdxYryE1lfXaYrPrMDE/xAW0J3a 3tlKSn+F3qqUpckfs+XANAXApEGF4VsWSwUThuRqThjSQEotj74LYH55J23KKl8fvrc+M6jBVss O12zc9BJbMiY88nNG72t4IxJyLNsv X-Received: by 2002:a05:600d:6414:10b0:4a0:1b50:a9f0 with SMTP id 5b1f17b1804b1-4a178a1afaemr61541235e9.9.1791323648802; Tue, 06 Oct 2026 14:54:08 -0700 (PDT) X-Received: by 2002:a05:600d:6414:10b0:4a0:1b50:a9f0 with SMTP id 5b1f17b1804b1-4a178a1afaemr61541025e9.9.1791323648334; Tue, 06 Oct 2026 14:54:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1791323648; cv=none; d=google.com; s=arc-20260327; b=jwdgNm+fM3aHFXahx+5kJDD88Zpw5dWwa45w2eXZ9dqNZJjCVwdocU4GuiNZnct9th llYunI6ix16Q76gDMoAr/8fAF8X6kvyZaUTiCvu9N0iWpVbE0oVB2h/tG+UZEken22g6 mr5IANPjPHIdF9BeO863S2D35xubIa2qhCtFHyQ1+J7++iDk4qx3RjSuGztix5bBbDTR gNPPIjEbbqHXyTKFLCOqZqj/whigWd1IdBJM4se42TfKHhe6QdZsOjYAkQC3AonR7g2o aC+sOTgk9ttB8Vtq0vex6gWDK/IbZpy9WKZjhQgG+tVou/254RMml2bBCyUWRScWJ3hh xC2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:dkim-signature; bh=UomsCR1PxM/ila3UJnLNwphIjUOzqMz2ha6ieYZuqRA=; fh=qxDc+R3aPG8cEdp5mmd3IFOllj1eLCwZHAcc+Tf/KXA=; b=p11bIi1x0Yrmqs/9U0xsYDyb8FqsarOqQhL12nDbFhX4UdgBUgMqyZQM0dMErsEipi FvUeXAx08pYs3N2FDe3+UvErkQ/OdtidSdbxlBC3zUSLwIa+36gJJSrbW8G0oaGz1cC4 MRG/O7XfJV5uoQJcEjwykL+95rKVW69as6NLuWieI3SOXKeqKDCJBDVF2htODzmX2GwE SNpMbIyr67nNQkZTZHJp8RjlXcVzonnLX2HdmR2tbTU5qu1NapZZUeC+c+U9i/XX2PMN vUaKCJ1WyHWSfOZgWfmBB5PoP0EBPCDTLIkzK3qxnResHL1bcTIPP0mRYacE1S4AXJgA 4T/g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=IVuPxZU9; spf=pass (google.com: domain of vladimir.riabchun@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=vladimir.riabchun@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id ffacd0b85a97d-48c724a3204si1394349f8f.335.2026.10.06.14.54.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Oct 2026 14:54:08 -0700 (PDT) Received-SPF: pass (google.com: domain of vladimir.riabchun@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=IVuPxZU9; spf=pass (google.com: domain of vladimir.riabchun@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=vladimir.riabchun@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=Content-Type:MIME-Version:Message-Id:Date:Subject :From; bh=UomsCR1PxM/ila3UJnLNwphIjUOzqMz2ha6ieYZuqRA=; b=IVuPxZU9IAeyhQZg9iR VlLKucKU8fcD7yyQTYyS/8d56bhbPRo0xjo0X7S/Vgn/mUY10jmZ7hOVc2h6YmyuhRjCV5zgq2OO+ EVemN6tfALVzA+BpnyUxGXNayGOn3wVRGOxtaVbvweqcI1zrXlUnzkC1PYPVUBbAnPPi2jXTcyOav JJYs/GA//6d5gTEUp2Y3ZOQqmiFuRUJfvP05nxZddLGhKJPuqh3UnSxaAbwHSSzwH+hDTITJY2Jhh 6Ie4N36LgLoyheqoPStpSZ0llGoyh6EulOsvFczxcUrKRce2Km6mbtzR8s/MsUBoP8dbdCSaVvFkD qPMkDtWXsHDhJYQ==; Received: from ch-demo-asa.virtuozzo.com ([130.117.225.8] helo=192.168.1.87) by relay.virtuozzo.com with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1xED3e-004Dgb-1G; Tue, 06 Oct 2026 23:53:57 +0200 From: Vladimir Riabchun Date: Tue, 06 Oct 2026 23:53:51 +0200 Message-Id: <20261006-ve-printk-irq-v2-0-db1dc4f6ed07@virtuozzo.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAO9txWoC/12Nyw6CMBBFf4XM2iFtseWx8j8MCy1FJkaKU2wUw r9bWbo8ObnnrhAckwvQZCuwixTIjwnUIQM7XMabQ+oSgxLKiFoVGB1OTON8R+InClXaoigrY0Q PaTOx6+m9984wWMIql9AmMVCYPX/2nyh3/UtKIdRfMkoUaK9aV7XpjlrbUySeX35ZfG79A9pt2 75uXlYDtwAAAA== X-Change-ID: 20260923-ve-printk-irq-027c3378660f To: vasileios.almpanis@virtuozzo.com, Konstantin Khorenko X-Mailer: b4 0.14.3 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 v2 0/6] ve/printk: Fix logs leakage via ve_printk called from IRQ context X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org Printk function that printed logs to containers' dmesgs mostly used get_exec_env() for getting VE. This is fine for task contexts and might be wrong for IRQ contexts. This patchset fixes this in the following way: - Report non-task usages of ve_printk function which get VE from current task. Do it with WARN so users will be frightened and will report it to us so we can fix it. This will also make an issue visible to our internal tests. - Reject printing to containers when VE is unreliable. - Calculate correct time offsets when calling printk. It can be delayed and the context might change, we can see time travels if time was taken from a different container. With these fixes failcounts can be now used in any context, so the last failcount - neigh_tbl - is added. This was tested by our neoltp tests on host and inside containers. No tests crashed, so there an no obvious IRQ callers of ve_printk functions. https://virtuozzo.atlassian.net/browse/VSTOR-146839 Feature: ve printk Signed-off-by: Vladimir Riabchun --- Changes in v2: - Patch 2: fixed uninitialized r value in ve_dev_printk_emit. - Patch 3: fixed incorrect __printf annotation for ve_printk_deferred. - Patch 3: now on IRQ case ve_printk_ratelimited falls back to ve0. - Patch 3: removed forgotten get_exec_env() usages from ve_printk functions. - Patch 4: completely reworked and simplified. - Patch 5: fix __ve_printk_ratelimited stub. - Patch 6: brought back table type logging to host. - Link to v1: http://lore.virtuozzo.com/20261002-ve-printk-irq-v1-0-cb55896d455c@virtuozzo.com --- 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 drivers/base/core.c | 8 ++- include/linux/net.h | 16 +++--- include/linux/printk.h | 42 ++++++++++++--- include/linux/ratelimit_types.h | 6 ++- include/linux/ve.h | 17 +++--- kernel/printk/internal.h | 4 ++ kernel/printk/printk.c | 101 ++++++++++++++++++++++++++++-------- kernel/ve/ve.c | 3 ++ lib/ratelimit.c | 7 +-- net/core/neighbour.c | 5 +- net/core/utils.c | 4 +- net/netfilter/nf_conntrack_core.c | 2 +- net/netfilter/nf_conntrack_expect.c | 2 +- net/netfilter/xt_TCPMSS.c | 4 +- 14 files changed, 162 insertions(+), 59 deletions(-) --- base-commit: ca54f152160587a74ff17cb52feef16f7b9d4e2b change-id: 20260923-ve-printk-irq-027c3378660f Best regards, -- Vladimir Riabchun _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel