public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] s390/dasd: fix locking error
@ 2023-06-09 15:37 Stefan Haberland
  2023-06-09 15:37 ` [PATCH 1/1] s390/dasd: Use correct lock while counting channel queue length Stefan Haberland
  2023-06-09 17:36 ` [PATCH 0/1] s390/dasd: fix locking error Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Stefan Haberland @ 2023-06-09 15:37 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Jan Hoeppner, linux-s390, Heiko Carstens,
	Vasily Gorbik, Christian Borntraeger

Hi Jens,

please apply the following patch that fixes a locking error in the DASD
driver. Thanks.

Jan Höppner (1):
  s390/dasd: Use correct lock while counting channel queue length

 drivers/s390/block/dasd_ioctl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.39.2


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

* [PATCH 1/1] s390/dasd: Use correct lock while counting channel queue length
  2023-06-09 15:37 [PATCH 0/1] s390/dasd: fix locking error Stefan Haberland
@ 2023-06-09 15:37 ` Stefan Haberland
  2023-06-09 17:36 ` [PATCH 0/1] s390/dasd: fix locking error Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Haberland @ 2023-06-09 15:37 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Jan Hoeppner, linux-s390, Heiko Carstens,
	Vasily Gorbik, Christian Borntraeger

From: Jan Höppner <hoeppner@linux.ibm.com>

The lock around counting the channel queue length in the BIODASDINFO
ioctl was incorrectly changed to the dasd_block->queue_lock with commit
583d6535cb9d ("dasd: remove dead code"). This can lead to endless list
iterations and a subsequent crash.

The queue_lock is supposed to be used only for queue lists belonging to
dasd_block. For dasd_device related queue lists the ccwdev lock must be
used.

Fix the mentioned issues by correctly using the ccwdev lock instead of
the queue lock.

Fixes: 583d6535cb9d ("dasd: remove dead code")
Cc: stable@vger.kernel.org # v5.0+
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
---
 drivers/s390/block/dasd_ioctl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c
index 9327dcdd6e5e..8fca725b3dae 100644
--- a/drivers/s390/block/dasd_ioctl.c
+++ b/drivers/s390/block/dasd_ioctl.c
@@ -552,10 +552,10 @@ static int __dasd_ioctl_information(struct dasd_block *block,
 
 	memcpy(dasd_info->type, base->discipline->name, 4);
 
-	spin_lock_irqsave(&block->queue_lock, flags);
+	spin_lock_irqsave(get_ccwdev_lock(base->cdev), flags);
 	list_for_each(l, &base->ccw_queue)
 		dasd_info->chanq_len++;
-	spin_unlock_irqrestore(&block->queue_lock, flags);
+	spin_unlock_irqrestore(get_ccwdev_lock(base->cdev), flags);
 	return 0;
 }
 
-- 
2.39.2


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

* Re: [PATCH 0/1] s390/dasd: fix locking error
  2023-06-09 15:37 [PATCH 0/1] s390/dasd: fix locking error Stefan Haberland
  2023-06-09 15:37 ` [PATCH 1/1] s390/dasd: Use correct lock while counting channel queue length Stefan Haberland
@ 2023-06-09 17:36 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2023-06-09 17:36 UTC (permalink / raw)
  To: Stefan Haberland
  Cc: linux-block, Jan Hoeppner, linux-s390, Heiko Carstens,
	Vasily Gorbik, Christian Borntraeger


On Fri, 09 Jun 2023 17:37:49 +0200, Stefan Haberland wrote:
> please apply the following patch that fixes a locking error in the DASD
> driver. Thanks.
> 
> Jan Höppner (1):
>   s390/dasd: Use correct lock while counting channel queue length
> 
> drivers/s390/block/dasd_ioctl.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> [...]

Applied, thanks!

[1/1] s390/dasd: Use correct lock while counting channel queue length
      commit: ccc45cb4e7271c74dbb27776ae8f73d84557f5c6

Best regards,
-- 
Jens Axboe




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

end of thread, other threads:[~2023-06-09 17:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-09 15:37 [PATCH 0/1] s390/dasd: fix locking error Stefan Haberland
2023-06-09 15:37 ` [PATCH 1/1] s390/dasd: Use correct lock while counting channel queue length Stefan Haberland
2023-06-09 17:36 ` [PATCH 0/1] s390/dasd: fix locking error Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox