Files
linux/include/linux
Ming Lei 2d87d455ea blk-mq: don't add non-pt request with ->end_io to batch
dm-rq implements ->end_io callback for request issued to underlying queue,
and it isn't passthrough request.

Commit ab3e1d3bba ("block: allow end_io based requests in the completion
batch handling") doesn't clear rq->bio and rq->__data_len for request
with ->end_io in blk_mq_end_request_batch(), and this way is actually
dangerous, but so far it is only for nvme passthrough request.

dm-rq needs to clean up remained bios in case of partial completion,
and req->bio is required, then use-after-free is triggered, so the
underlying clone request can't be completed in blk_mq_end_request_batch.

Fix panic by not adding such request into batch list, and the issue
can be triggered simply by exposing nvme pci to dm-mpath simply.

Fixes: ab3e1d3bba ("block: allow end_io based requests in the completion batch handling")
Cc: dm-devel@redhat.com
Cc: Mike Snitzer <snitzer@kernel.org>
Reported-by: Changhui Zhong <czhong@redhat.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20221027085709.513175-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-10-27 07:15:44 -06:00
..
2022-05-22 20:44:29 +01:00
2022-03-23 19:58:38 +01:00
2022-07-05 20:25:39 +02:00
2022-09-21 11:18:28 +09:00
2022-09-26 10:13:13 -07:00
2022-09-26 10:13:13 -07:00
2022-09-12 16:51:22 +02:00
2022-09-26 10:13:14 -07:00
2022-03-15 10:32:44 +01:00
2022-06-28 10:37:25 -03:00
2022-07-01 14:53:01 +02:00
2022-06-03 06:52:57 -07:00
2022-08-31 14:57:28 +01:00
2022-08-16 12:46:26 +02:00
2022-06-09 21:53:09 -07:00
2022-06-09 21:53:12 -07:00
2022-06-09 21:53:09 -07:00
2022-09-26 10:13:15 -07:00
2022-02-28 23:26:27 -08:00
2022-09-01 18:04:43 +02:00
2022-06-27 06:29:12 -06:00
2022-09-01 18:08:44 +02:00
2022-07-17 17:31:38 -07:00
2022-05-02 14:06:20 -06:00
2022-09-26 12:37:21 -04:00
2022-05-03 16:09:03 -04:00
2022-06-19 10:38:26 +01:00
2022-07-27 14:04:52 +02:00
2022-08-28 14:02:44 -07:00
2022-04-28 23:16:14 -07:00
2022-09-26 10:13:13 -07:00
2022-08-02 12:34:04 -04:00
2022-09-01 17:39:49 -04:00
2022-08-22 14:26:30 +01:00
2022-05-17 13:32:46 -04:00
2022-08-09 14:11:34 -04:00
2022-07-29 20:16:58 -04:00
2022-02-09 09:24:40 -05:00
2022-10-03 17:34:32 -07:00
2022-07-01 16:38:35 -06:00
2022-09-26 10:13:15 -07:00
2022-02-09 08:04:44 +01:00
2022-02-09 08:04:44 +01:00
2022-09-19 06:17:05 -07:00
2022-03-08 14:33:36 -06:00
2022-03-17 20:16:29 -07:00
2022-03-23 19:58:41 +01:00
2022-05-22 21:03:01 +01:00
2022-04-07 12:53:54 +02:00
2022-06-27 14:41:31 +02:00
2022-02-24 15:04:51 +00:00
2022-09-30 12:31:46 +01:00
2022-05-08 01:33:08 -07:00
2022-09-07 12:42:25 +01:00
2022-02-25 09:36:06 +01:00
2022-04-11 19:18:27 -06:00
2022-03-22 15:57:11 -07:00
2022-09-22 16:12:34 +02:00
2022-09-22 16:12:34 +02:00
2022-08-31 13:37:32 +02:00
2022-09-01 11:42:12 +01:00
2022-09-16 10:56:08 +01:00
2022-08-28 16:52:28 +01:00
2022-08-11 04:31:14 -04:00
2022-06-13 09:54:52 -07:00
2022-07-10 21:17:30 -04:00