Skip to content

Commit fbc3c89

Browse files
committed
net: wwan: iosm: Fix tainted pointer delete is case of region creation fail
jira LE-1907 cve CVE-2024-40939 Rebuild_History Non-Buildable kernel-5.14.0-427.33.1.el9_4 commit-author Aleksandr Mishin <[email protected]> commit b0c9a26 In case of region creation fail in ipc_devlink_create_region(), previously created regions delete process starts from tainted pointer which actually holds error code value. Fix this bug by decreasing region index before delete. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 4dcd183 ("net: wwan: iosm: devlink registration") Signed-off-by: Aleksandr Mishin <[email protected]> Acked-by: Sergey Ryazanov <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]> (cherry picked from commit b0c9a26) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 76a3d6c commit fbc3c89

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/wwan/iosm/iosm_ipc_devlink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ static int ipc_devlink_create_region(struct iosm_devlink *devlink)
210210
rc = PTR_ERR(devlink->cd_regions[i]);
211211
dev_err(devlink->dev, "Devlink region fail,err %d", rc);
212212
/* Delete previously created regions */
213-
for ( ; i >= 0; i--)
213+
for (i--; i >= 0; i--)
214214
devlink_region_destroy(devlink->cd_regions[i]);
215215
goto region_create_fail;
216216
}

0 commit comments

Comments
 (0)