All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: idxd: add RO check for wq max_transfer_size write
@ 2022-04-11 22:08 Dave Jiang
  2022-04-20 11:47 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Jiang @ 2022-04-11 22:08 UTC (permalink / raw)
  To: vkoul; +Cc: dmaengine

Block wq_max_transfer_size_store() when the device is configured as
read-only and not configurable.

Fixes: d7aad5550eca ("dmaengine: idxd: add support for configurable max wq xfer size")
Reported-by: Bernice Zhang <bernice.zhang@intel.com>
Tested-by: Bernice Zhang <bernice.zhang@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
 drivers/dma/idxd/sysfs.c |    3 +++
 1 file changed, 3 insertions(+)

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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] dmaengine: idxd: add RO check for wq max_transfer_size write
  2022-04-11 22:08 [PATCH] dmaengine: idxd: add RO check for wq max_transfer_size write Dave Jiang
@ 2022-04-20 11:47 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2022-04-20 11:47 UTC (permalink / raw)
  To: Dave Jiang; +Cc: dmaengine

On 11-04-22, 15:08, Dave Jiang wrote:
> Block wq_max_transfer_size_store() when the device is configured as
> read-only and not configurable.

Applied, thanks

> 
> Fixes: d7aad5550eca ("dmaengine: idxd: add support for configurable max wq xfer size")
> Reported-by: Bernice Zhang <bernice.zhang@intel.com>
> Tested-by: Bernice Zhang <bernice.zhang@intel.com>
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> ---
>  drivers/dma/idxd/sysfs.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/dma/idxd/sysfs.c b/drivers/dma/idxd/sysfs.c
> index 7e19ab92b61a..ec13ca4808f9 100644
> --- a/drivers/dma/idxd/sysfs.c
> +++ b/drivers/dma/idxd/sysfs.c
> @@ -905,6 +905,9 @@ static ssize_t wq_max_transfer_size_store(struct device *dev, struct device_attr
>  	u64 xfer_size;
>  	int rc;
>  
> +	if (!test_bit(IDXD_FLAG_CONFIGURABLE, &idxd->flags))
> +		return -EPERM;
> +
>  	if (wq->state != IDXD_WQ_DISABLED)
>  		return -EPERM;
>  
> 

-- 
~Vinod

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-20 11:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-11 22:08 [PATCH] dmaengine: idxd: add RO check for wq max_transfer_size write Dave Jiang
2022-04-20 11:47 ` Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.