Patch "dmaengine: qcom-adm: fix wrong sizeof config in slave_config" has been added to the 6.0-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

    dmaengine: qcom-adm: fix wrong sizeof config in slave_config

to the 6.0-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:
     dmaengine-qcom-adm-fix-wrong-sizeof-config-in-slave_config.patch
and it can be found in the queue-6.0 subdirectory.

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


>From 7c8765308371be30f50c1b5b97618b731514b207 Mon Sep 17 00:00:00 2001
From: Christian Marangi <ansuelsmth@xxxxxxxxx>
Date: Thu, 15 Sep 2022 22:48:44 +0200
Subject: dmaengine: qcom-adm: fix wrong sizeof config in slave_config

From: Christian Marangi <ansuelsmth@xxxxxxxxx>

commit 7c8765308371be30f50c1b5b97618b731514b207 upstream.

Fix broken slave_config function that uncorrectly compare the
peripheral_size with the size of the config pointer instead of the size
of the config struct. This cause the crci value to be ignored and cause
a kernel panic on any slave that use adm driver.

To fix this, compare to the size of the struct and NOT the size of the
pointer.

Fixes: 03de6b273805 ("dmaengine: qcom-adm: stop abusing slave_id config")
Signed-off-by: Christian Marangi <ansuelsmth@xxxxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx # v5.17+
Reviewed-by: Arnd Bergmann <arnd@xxxxxxxx>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx>
Link: https://lore.kernel.org/r/20220915204844.3838-1-ansuelsmth@xxxxxxxxx
Signed-off-by: Vinod Koul <vkoul@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/dma/qcom/qcom_adm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/dma/qcom/qcom_adm.c
+++ b/drivers/dma/qcom/qcom_adm.c
@@ -494,7 +494,7 @@ static int adm_slave_config(struct dma_c
 
 	spin_lock_irqsave(&achan->vc.lock, flag);
 	memcpy(&achan->slave, cfg, sizeof(struct dma_slave_config));
-	if (cfg->peripheral_size == sizeof(config))
+	if (cfg->peripheral_size == sizeof(*config))
 		achan->crci = config->crci;
 	spin_unlock_irqrestore(&achan->vc.lock, flag);
 


Patches currently in stable-queue which might be from ansuelsmth@xxxxxxxxx are

queue-6.0/dmaengine-qcom-adm-fix-wrong-sizeof-config-in-slave_config.patch
queue-6.0/dmaengine-qcom-adm-fix-wrong-calling-convention-for-prep_slave_sg.patch



[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