Skip to content

Commit 6f117cb

Browse files
Stefan Haberlandaxboe
Stefan Haberland
authored andcommitted
s390/dasd: fix null pointer dereference for ERP requests
When requeueing all requests on the device request queue to the blocklayer we might get to an ERP (error recovery) request that is a copy of an original CQR. Those requests do not have blocklayer request information or a pointer to the dasd_queue set. When trying to access those data it will lead to a null pointer dereference in dasd_requeue_all_requests(). Fix by checking if the request is an ERP request that can simply be ignored. The blocklayer request will be requeued by the original CQR that is on the device queue right behind the ERP request. Fixes: 9487cfd ("s390/dasd: fix handling of internal requests") Cc: <[email protected]> #4.16 Signed-off-by: Stefan Haberland <[email protected]> Reviewed-by: Jan Hoeppner <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent b7131ee commit 6f117cb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/s390/block/dasd.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2980,6 +2980,12 @@ static int _dasd_requeue_request(struct dasd_ccw_req *cqr)
29802980

29812981
if (!block)
29822982
return -EINVAL;
2983+
/*
2984+
* If the request is an ERP request there is nothing to requeue.
2985+
* This will be done with the remaining original request.
2986+
*/
2987+
if (cqr->refers)
2988+
return 0;
29832989
spin_lock_irq(&cqr->dq->lock);
29842990
req = (struct request *) cqr->callback_data;
29852991
blk_mq_requeue_request(req, false);

0 commit comments

Comments
 (0)