Patch "net: wwan: iosm: Fix tainted pointer delete is case of region creation fail" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: wwan: iosm: Fix tainted pointer delete is case of region creation fail

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-wwan-iosm-fix-tainted-pointer-delete-is-case-of-.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 039c9a66d803ebf62a965e963c78c034fe011b28
Author: Aleksandr Mishin <amishin@xxxxxxxxxx>
Date:   Tue Jun 4 11:25:00 2024 +0300

    net: wwan: iosm: Fix tainted pointer delete is case of region creation fail
    
    [ Upstream commit b0c9a26435413b81799047a7be53255640432547 ]
    
    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: 4dcd183fbd67 ("net: wwan: iosm: devlink registration")
    Signed-off-by: Aleksandr Mishin <amishin@xxxxxxxxxx>
    Acked-by: Sergey Ryazanov <ryazanov.s.a@xxxxxxxxx>
    Reviewed-by: Simon Horman <horms@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240604082500.20769-1-amishin@xxxxxxxxxx
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/wwan/iosm/iosm_ipc_devlink.c b/drivers/net/wwan/iosm/iosm_ipc_devlink.c
index 2fe724d623c06..33c5a46f1b922 100644
--- a/drivers/net/wwan/iosm/iosm_ipc_devlink.c
+++ b/drivers/net/wwan/iosm/iosm_ipc_devlink.c
@@ -210,7 +210,7 @@ static int ipc_devlink_create_region(struct iosm_devlink *devlink)
 			rc = PTR_ERR(devlink->cd_regions[i]);
 			dev_err(devlink->dev, "Devlink region fail,err %d", rc);
 			/* Delete previously created regions */
-			for ( ; i >= 0; i--)
+			for (i--; i >= 0; i--)
 				devlink_region_destroy(devlink->cd_regions[i]);
 			goto region_create_fail;
 		}




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux