linux-stable/drivers/s390/block
Jan Höppner db46cd1e04 s390/dasd: protect device queue against concurrent access
In dasd_profile_start() the amount of requests on the device queue are
counted. The access to the device queue is unprotected against
concurrent access. With a lot of parallel I/O, especially with alias
devices enabled, the device queue can change while dasd_profile_start()
is accessing the queue. In the worst case this leads to a kernel panic
due to incorrect pointer accesses.

Fix this by taking the device lock before accessing the queue and
counting the requests. Additionally the check for a valid profile data
pointer can be done earlier to avoid unnecessary locking in a hot path.

Cc:  <stable@vger.kernel.org>
Fixes: 4fa52aa7a8 ("[S390] dasd: add enhanced DASD statistics interface")
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Link: https://lore.kernel.org/r/20231025132437.1223363-3-sth@linux.ibm.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2023-11-20 11:50:54 -07:00
..
dasd.c s390/dasd: protect device queue against concurrent access 2023-11-20 11:50:54 -07:00
dasd_3990_erp.c s390/dasd: print copy pair message only for the correct error 2023-07-24 13:05:29 -06:00
dasd_alias.c s390/dasd: sort out physical vs virtual pointers usage 2023-02-09 17:05:43 -07:00
dasd_devmap.c s390/dasd: fix string length handling 2023-09-01 07:47:43 -06:00
dasd_diag.c s390: include linux/io.h instead of asm/io.h 2023-07-03 11:19:40 +02:00
dasd_diag.h
dasd_eckd.c s390/dasd: fix string length handling 2023-09-01 07:47:43 -06:00
dasd_eckd.h s390/dasd: add device ping attribute 2022-09-21 08:32:51 -06:00
dasd_eer.c s390/dasd: add autoquiesce feature 2023-04-11 19:53:08 -06:00
dasd_erp.c s390/dasd: handle request magic consistently as unsigned int 2021-10-20 08:10:41 -06:00
dasd_fba.c s390: include linux/io.h instead of asm/io.h 2023-07-03 11:19:40 +02:00
dasd_fba.h
dasd_genhd.c s390/dasd: Convert to bdev_open_by_path() 2023-10-28 13:29:18 +02:00
dasd_int.h s390/dasd: resolve spelling mistake 2023-11-20 11:50:54 -07:00
dasd_ioctl.c s390/dasd: Convert to bdev_open_by_path() 2023-10-28 13:29:18 +02:00
dasd_proc.c
dcssblk.c s390/dcssblk: fix lockdep warning 2023-08-30 11:03:27 +02:00
Kconfig dax: remove CONFIG_DAX_DRIVER 2021-12-04 08:58:51 -08:00
Makefile s390: remove xpram device driver 2021-09-07 13:38:42 +02:00
scm_blk.c s390/mm: make virt_to_pfn() a static inline 2023-08-16 15:13:03 +02:00
scm_blk.h block: remove genhd.h 2022-02-02 07:49:59 -07:00
scm_drv.c s390/scm: Make struct scm_driver::remove return void 2021-07-21 11:53:42 +02:00