OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
* [Devel] [PATCH RHEL10 COMMIT] dm-qcow2: fix ALLOW_ERROR_INJECTION class on qcow2_alloc_delta (ERRNO not NULL)
       [not found] <20260706110002.1024515-23-khorenko@virtuozzo.com>
@ 2026-08-05 20:39 ` Konstantin Khorenko
  0 siblings, 0 replies; only message in thread
From: Konstantin Khorenko @ 2026-08-05 20:39 UTC (permalink / raw)


The commit is pushed to "branch-rh10-6.12.0-211.39.1.16.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh10-6.12.0-211.39.1.16.2.vz10
------>
commit 54ac024fe0a363532284b47134aabf00a55a9cee
Author: Konstantin Khorenko <khorenko@virtuozzo.com>
Date:   Mon Jul 6 13:00:00 2026 +0200

    dm-qcow2: fix ALLOW_ERROR_INJECTION class on qcow2_alloc_delta (ERRNO not NULL)
    
    qcow2_alloc_delta() returns a valid pointer or ERR_PTR(-ENOMEM); it
    never returns NULL, and its only caller qcow2_ctr() checks IS_ERR()
    only, then dereferences the result (qcow2->img_id = i).
    
    It was annotated ALLOW_ERROR_INJECTION(..., NULL), whose default
    injected return value is 0 (NULL), which slips past the IS_ERR() check
    and NULL-derefs.
    
    Use ERRNO (error pointers only), matching the function's contract and
    the caller's handling.
    
    Fixes: b800ab29c49d1 ("dm-qcow2: Enable injection fault")
    Feature: dm-qcow2: block device over QCOW2 files driver
    https://virtuozzo.atlassian.net/browse/VSTOR-137234
    Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
    Reviewed-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
---
 drivers/md/dm-qcow2-target.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/dm-qcow2-target.c b/drivers/md/dm-qcow2-target.c
index 3f65897ce9da2..de1fb628735b7 100644
--- a/drivers/md/dm-qcow2-target.c
+++ b/drivers/md/dm-qcow2-target.c
@@ -678,7 +678,7 @@ static struct qcow2 *qcow2_alloc_delta(struct qcow2_target *tgt, struct qcow2 *u
 
 	return qcow2;
 }
-ALLOW_ERROR_INJECTION(qcow2_alloc_delta, NULL);
+ALLOW_ERROR_INJECTION(qcow2_alloc_delta, ERRNO);
 
 static int qcow2_attach_file(struct dm_target *ti, struct qcow2_target *tgt,
 			     struct qcow2 *qcow2, int fd)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-05 20:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20260706110002.1024515-23-khorenko@virtuozzo.com>
2026-08-05 20:39 ` [Devel] [PATCH RHEL10 COMMIT] dm-qcow2: fix ALLOW_ERROR_INJECTION class on qcow2_alloc_delta (ERRNO not NULL) Konstantin Khorenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox