All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: Vasileios Almpanis <vasileios.almpanis@virtuozzo.com>
To: Konstantin Khorenko <khorenko@virtuozzo.com>,
	"Denis V. Lunev" <den@openvz.org>,
	Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
Cc: devel@openvz.org, Artem Bulgakov <artem.bulgakov@virtuozzo.com>
Subject: [Devel] [PATCH hci-8.2 1/2] block/blk-cbt: don't WARN on an ABI version mismatch
Date: Fri, 27 Nov 2026 12:31:04 +0000	[thread overview]
Message-ID: <20261127-cbt-ploop-fixes-v1-1-d6559232b819@virtuozzo.com> (raw)
In-Reply-To: <20261127-cbt-ploop-fixes-v1-0-d6559232b819@virtuozzo.com>

blk_cbt_ioctl() checks the ABI version that userspace passes before it
checks CAP_SYS_ADMIN, and BLKCBTGET does not need CAP_SYS_ADMIN at all.
So anyone who can open a block device can trigger the WARN_ONCE with a
wrong version. Inside a container, root can open its own disk and do
this. On a node with panic_on_warn=1 this panics the host.

A wrong ABI version is a userspace error, so print a warning instead.

https://virtuozzo.atlassian.net/browse/VSTOR-157563

Fixes: 421362cbc789 ("block/blk-cbt: introduce ABI versioning")
Feature: cbt: changed block tracking (for backup)
Reported-by: Artem Bulgakov <artem.bulgakov@virtuozzo.com>
Signed-off-by: Vasileios Almpanis <vasileios.almpanis@virtuozzo.com>
---
 block/blk-cbt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/blk-cbt.c b/block/blk-cbt.c
index baa56ab1a538..af897e2677ee 100644
--- a/block/blk-cbt.c
+++ b/block/blk-cbt.c
@@ -1322,8 +1322,8 @@ int blk_cbt_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg)
 		return -EFAULT;
 
 	if (abi_version != CBT_ABI_VERSION) {
-		WARN_ONCE(1, "blk-cbt ABI mimatch: kernel has %d, userspace uses %d",
-			  CBT_ABI_VERSION, abi_version);
+		pr_warn_once("blk-cbt ABI mismatch: kernel has %d, userspace uses %u\n",
+			     CBT_ABI_VERSION, abi_version);
 		return -EOPNOTSUPP;
 	}
 

-- 
2.43.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

  reply	other threads:[~2026-11-27 12:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 12:31 [Devel] [PATCH hci-8.2 0/2] blk-cbt and dm-ploop: fix a host WARN and a NULL put_page Vasileios Almpanis
2026-11-27 12:31 ` Vasileios Almpanis [this message]
2026-11-30 11:58   ` [Devel] [PATCH hci-8.2 1/2] block/blk-cbt: don't WARN on an ABI version mismatch Konstantin Khorenko
2026-12-01  0:47   ` no-reply
2026-11-27 12:31 ` [Devel] [PATCH hci-8.2 2/2] dm-ploop: don't put a NULL bat page in ploop_free_piwb() Vasileios Almpanis
2026-11-30 11:58   ` Konstantin Khorenko
2026-12-01  0:48   ` no-reply
2026-11-30 11:58 ` [Devel] [PATCH hci-8.2 0/2] blk-cbt and dm-ploop: fix a host WARN and a NULL put_page Konstantin Khorenko
2026-11-30 11:58 ` Konstantin Khorenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261127-cbt-ploop-fixes-v1-1-d6559232b819@virtuozzo.com \
    --to=vasileios.almpanis@virtuozzo.com \
    --cc=andrey.zhadchenko@virtuozzo.com \
    --cc=artem.bulgakov@virtuozzo.com \
    --cc=den@openvz.org \
    --cc=devel@openvz.org \
    --cc=khorenko@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.