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 7536A8017D for ; Fri, 2 Oct 2026 21:28:07 +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 692LQnwc026195; Sat, 3 Oct 2026 00:26:50 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 692LQnwc026195 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="ea+buCKK" Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 692LQifV026162 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Sat, 3 Oct 2026 00:26:44 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 692LQifV026162 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-48b09f01f56so187163f8f.1 for ; Fri, 02 Oct 2026 14:26:44 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvBwVYPbGV3egY4FgVBwFT05YcnKUUPe6LZt6oZCW/FPqFd3hT/hn/TWNoZ8mr6/cDxP/A2fQhg==@openvz.org X-Gm-Message-State: AFuF++kof13ZSVpCcLlxiBbi3Jz4D/tI950XmfzXfdyGCG8b8DKrSKEA W1k15fbY0DmTf0XF3EFt6Gorx+BKzdpHq6K0HD+Y8WyUUWi2o0RcAWp8I+mhnK6NoRGF1p/B5IK PrXgjbdF3kzmn0WI2sFPpZ0i6AdsKW/mkKSFQyuFFkSR1U1wKiVgdXQ== X-Gm-Gg: AYBFou2oGzQxuAzX4M/J0s1SSVb72Z7d7GuciadTGRLz8OjqXGhLBmJelsTi2AZY69Q 1jgsYC3pyM+ffnvL/j8MYyrTolsmoSddB46VUQVuK2Grc7yj4FYJhvYGH0Ipc+/1/wbVI5QwMRq y3jYZM2XpBbpsbO5owEg2BRHSQCXtdWZ5uz75hEZzlh93Y3x0445Z3ORADKHnopzaJfjrEd9vjC fj6sVi9zHAdtniqqvKJK4yiqI61aqV6tbABb+68CVRgxe4NDjWNb32AF/BbVIIyYNH2DG5VWy4O aX2Ww4qWIwnwHbj9LAYZ1AGoVo8AG9B7tj67myvfSWRduwY669LiMdutvyYI9GdRdRA/d/yckpC aJ2PGDyz1ucApdbFmoHIXeN32/zoimw== X-Received: by 2002:a05:600c:5303:b0:4a0:1c10:1419 with SMTP id 5b1f17b1804b1-4a027597b34mr63442835e9.26.1790976404000; Fri, 02 Oct 2026 14:26:44 -0700 (PDT) X-Received: by 2002:a05:600c:5303:b0:4a0:1c10:1419 with SMTP id 5b1f17b1804b1-4a027597b34mr63442735e9.26.1790976403484; Fri, 02 Oct 2026 14:26:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1790976403; cv=none; d=google.com; s=arc-20260327; b=KDmZI66NJJMKGiqyuXXQcwu04XL2v3oqPbZ/lCKKvLvGevpXU2jiZlUuod336gWO6F q7Y7iJ52L4EiWSoDDcfPJ7J8wd1Cn7eMamQu6U9Kmw6dbx2z54Lcp0TJzrXLRchRrmVm WdMzJFTO82jIRgGup9+0QFJcjVXsZUg3loYMNp0qXmvE9vnGvKLIHSuEcmbWBoBmb40D DrPgEiQbD8iGZVWVCzGuzggrFgs+xZYohZ1gymbKias2JClH9VzPkahMl84jk6FPv9K5 ZVPPrq2auh/ML//jjwob097AIpMnszCKGDyWg7cDfYmTcOw+ZzWJsTnoii3eZSkBZ1LX BZSQ== 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=cKhQ/7QVsE9hXy689o6XIuK/FBTClgRnKP3gKcqewn8=; fh=vUECVpjOjIdz431s8bRiKYBdScEDOVhPZlDu2AQ+txg=; b=qnbBTj3oM8lKUynxyHJJQ4oENqxrIegvk5eHGWTEXmbQ9XMf8YVQpD7AOmmp+XFlh7 Kcw4DsRarf5LuUUFCaBvRawqB3cm4EO63C5rXveuiHt5iuHXCwv+rriFUsMcaG+IzhbU kA9I73uE9H9XFsUlTCe+mpI2+ah8nH+IYQuhogM4ljg3GT8s8GItupW/1zFw/+MpeFsS DKC4gXFQCsT54zOVT1wv0YPaGqqloOuCeCAYT3jJ9Q86FyIIMUMBpuNuBbGeIXSEfIJc 1kctAbg+q0hjdE5xLp0lFpD7gEi0jWZKshtB+SSapPR5jwQMxVmCR5hm8HRw4wAl6qig 7HRQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=ea+buCKK; 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-48b5b42f548si9541287f8f.327.2026.10.02.14.26.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Oct 2026 14:26:43 -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=ea+buCKK; 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=cKhQ/7QVsE9hXy689o6XIuK/FBTClgRnKP3gKcqewn8=; b=ea+buCKKjgrZibREARB 2pu3DtNPeiodYDn/YkR5tekjiM0oyBt9saXe2vGvMy2KpH1SzWFjiQ/50Dmtgou2m0oh9ywifXq3j NPrei1tFC+5W3yflT/igfWX/DOF7uhYZErMK4ScYUufB3VUi/74r5ECwCjjQKUoXeocriGDG2aiob 5E1oGx6S3FjvsnuV8nOlQOxkK1MLx4IiNAFWJficuaK7hpIzn3PNwsGHGFBchcrivpANRbmb98HoI E66vcWPqKNTpSBI8iR+79Fm8lcH9QMm4YBaX/5tfhmpQQquyspq2fW3JWDa1NQSwllhFQ0UweM24O 96VlWFYUcJ57pOQ==; 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 1xCkj1-00GcBK-2G; Fri, 02 Oct 2026 23:26:38 +0200 From: Vladimir Riabchun Date: Fri, 02 Oct 2026 23:26:09 +0200 Message-Id: <20261002-ve-printk-irq-v1-0-cb55896d455c@virtuozzo.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAHEhwGoC/x3MQQqAIBBA0avErJswBa2uEi3CxhoCqzEiiO6et HyL/x9IJEwJuuIBoYsTbzGjLgvwyxhnQp6yQSttVasNXoS7cDxXZDlQaeeNcY21KkBudqHA9// rYfGMTVXD8L4fcXaco2gAAAA= X-Change-ID: 20260923-ve-printk-irq-027c3378660f To: Konstantin Khorenko , vasileios.almpanis@virtuozzo.com X-Mailer: b4 0.14.3 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1 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 --- 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 | 6 +- include/linux/net.h | 16 ++--- include/linux/printk.h | 37 ++++++++-- include/linux/ratelimit_types.h | 6 +- include/linux/ve.h | 17 ++--- kernel/printk/internal.h | 6 ++ kernel/printk/printk.c | 132 ++++++++++++++++++++++++++++-------- kernel/printk/printk_ringbuffer.h | 2 + kernel/ve/ve.c | 3 + lib/ratelimit.c | 7 +- net/core/neighbour.c | 3 +- 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 +- 15 files changed, 181 insertions(+), 66 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