Patch "pinctrl: freescale: Fix a memory out of bounds when num_configs is 1" has been added to the 6.3-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

    pinctrl: freescale: Fix a memory out of bounds when num_configs is 1

to the 6.3-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:
     pinctrl-freescale-fix-a-memory-out-of-bounds-when-nu.patch
and it can be found in the queue-6.3 subdirectory.

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



commit a83e9e9d7563ccfd0d17fea08aed028c9ce9fe13
Author: Xiaolei Wang <xiaolei.wang@xxxxxxxxxxxxx>
Date:   Fri May 5 07:37:36 2023 +0800

    pinctrl: freescale: Fix a memory out of bounds when num_configs is 1
    
    [ Upstream commit 9063777ca1e2e895c5fdd493ee0c3f18fa710ed4 ]
    
    The config passed in by pad wakeup is 1, when num_configs is 1,
    Configuration [1] should not be fetched, which will be detected
    by KASAN as a memory out of bounds condition. Modify to get
    configs[1] when num_configs is 2.
    
    Fixes: f60c9eac54af ("gpio: mxc: enable pad wakeup on i.MX8x platforms")
    Signed-off-by: Xiaolei Wang <xiaolei.wang@xxxxxxxxxxxxx>
    Reviewed-by: Peng Fan <peng.fan@xxxxxxx>
    Link: https://lore.kernel.org/r/20230504233736.3766296-1-xiaolei.wang@xxxxxxxxxxxxx
    Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/pinctrl/freescale/pinctrl-scu.c b/drivers/pinctrl/freescale/pinctrl-scu.c
index ea261b6e74581..3b252d684d723 100644
--- a/drivers/pinctrl/freescale/pinctrl-scu.c
+++ b/drivers/pinctrl/freescale/pinctrl-scu.c
@@ -90,7 +90,7 @@ int imx_pinconf_set_scu(struct pinctrl_dev *pctldev, unsigned pin_id,
 	struct imx_sc_msg_req_pad_set msg;
 	struct imx_sc_rpc_msg *hdr = &msg.hdr;
 	unsigned int mux = configs[0];
-	unsigned int conf = configs[1];
+	unsigned int conf;
 	unsigned int val;
 	int ret;
 
@@ -115,6 +115,7 @@ int imx_pinconf_set_scu(struct pinctrl_dev *pctldev, unsigned pin_id,
 	 * Set mux and conf together in one IPC call
 	 */
 	WARN_ON(num_configs != 2);
+	conf = configs[1];
 
 	val = conf | BM_PAD_CTL_IFMUX_ENABLE | BM_PAD_CTL_GP_ENABLE;
 	val |= mux << BP_PAD_CTL_IFMUX;



[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