[Devel] [PATCH hci-8.2 1/2] block/blk-cbt: don't WARN on an ABI version mismatch

Vasileios Almpanis vasileios.almpanis at virtuozzo.com
Fri Nov 27 15:31:04 MSK 2026


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 at virtuozzo.com>
Signed-off-by: Vasileios Almpanis <vasileios.almpanis at 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



More information about the Devel mailing list