Patch "dmaengine: idxd: add RO check for wq max_batch_size write" has been added to the 5.17-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: idxd: add RO check for wq max_batch_size write

to the 5.17-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-idxd-add-ro-check-for-wq-max_batch_size-wr.patch
and it can be found in the queue-5.17 subdirectory.

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



commit dcd7292d5feda9e4f1def1776f5b0590b431392e
Author: Dave Jiang <dave.jiang@xxxxxxxxx>
Date:   Mon Apr 11 15:08:55 2022 -0700

    dmaengine: idxd: add RO check for wq max_batch_size write
    
    [ Upstream commit 66903461ffed0b66fc3e0200082d4e09365aacdc ]
    
    Block wq_max_batch_size_store() when the device is configured as read-only
    and not configurable.
    
    Fixes: e7184b159dd3 ("dmaengine: idxd: add support for configurable max wq batch size")
    Reported-by: Bernice Zhang <bernice.zhang@xxxxxxxxx>
    Tested-by: Bernice Zhang <bernice.zhang@xxxxxxxxx>
    Signed-off-by: Dave Jiang <dave.jiang@xxxxxxxxx>
    Link: https://lore.kernel.org/r/164971493551.2201159.1942042593642155209.stgit@xxxxxxxxxxxxxxxxxxxxxxxxxx
    Signed-off-by: Vinod Koul <vkoul@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/dma/idxd/sysfs.c b/drivers/dma/idxd/sysfs.c
index 7e19ab92b61a..6c41d429bd89 100644
--- a/drivers/dma/idxd/sysfs.c
+++ b/drivers/dma/idxd/sysfs.c
@@ -939,6 +939,9 @@ static ssize_t wq_max_batch_size_store(struct device *dev, struct device_attribu
 	u64 batch_size;
 	int rc;
 
+	if (!test_bit(IDXD_FLAG_CONFIGURABLE, &idxd->flags))
+		return -EPERM;
+
 	if (wq->state != IDXD_WQ_DISABLED)
 		return -EPERM;
 



[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