From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konstantin Khorenko Date: Wed, 19 Aug 2026 18:57:36 +0200 Subject: [Devel] [PATCH RHEL10 COMMIT] dm-ploop: use the ERRNO fault injection class for ploop_get_delta_file() In-Reply-To: <20260819165629.497296-1-khorenko@virtuozzo.com> Message-ID: <202608191657.67JGvaFT497426@f0.sw.ru> List-Id: 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.6.vz10 ------> commit 1ab5dd2ffa73d34985c1e57dd4e3ab27c04fb4d4 Author: Konstantin Khorenko Date: Wed Aug 19 18:33:35 2026 +0200 dm-ploop: use the ERRNO fault injection class for ploop_get_delta_file() ploop_get_delta_file() returns a valid struct file * or an ERR_PTR(), never NULL, and its only caller relies on exactly that. The function, however, is annotated as ALLOW_ERROR_INJECTION(ploop_get_delta_file, ERRNO_NULL); So injecting a failure the default way makes the function return NULL, the NULL sails past IS_ERR() and vfs_fsync() dereferences it. This is the annotation misdescribing the function rather than a missing check in the caller: NULL is not a value ploop_get_delta_file() can ever return. Use the ERRNO class, which injects error pointers only. Fixes: 4fc49f0700e2 ("dm-ploop: Allow fault injection for all ploop functions") Feature: dm-ploop: ploop target driver https://virtuozzo.atlassian.net/browse/VSTOR-137234 Signed-off-by: Konstantin Khorenko Reviewed-by: Pavel Tikhomirov --- drivers/md/dm-ploop-target.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-ploop-target.c b/drivers/md/dm-ploop-target.c index 0de0e84d440d0..7dab95402def7 100644 --- a/drivers/md/dm-ploop-target.c +++ b/drivers/md/dm-ploop-target.c @@ -255,7 +255,7 @@ static struct file *ploop_get_delta_file(struct ploop *ploop, int fd) return ERR_PTR(ret); } -ALLOW_ERROR_INJECTION(ploop_get_delta_file, ERRNO_NULL); +ALLOW_ERROR_INJECTION(ploop_get_delta_file, ERRNO); static int ploop_check_top_delta(struct ploop *ploop, struct file *file) {