Unverified Commit 87e637b2 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!14617 block: fix uaf for flush rq while iterating tags

parents c4e833d5 56afd3da
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -894,10 +894,8 @@ int blk_register_queue(struct gendisk *disk)
	 * faster to shut down and is made fully functional here as
	 * request_queues for non-existent devices never get registered.
	 */
	if (!blk_queue_init_done(q)) {
	blk_queue_flag_set(QUEUE_FLAG_INIT_DONE, q);
	percpu_ref_switch_to_percpu(&q->q_usage_counter);
	}

	return ret;

+3 −6
Original line number Diff line number Diff line
@@ -710,14 +710,11 @@ void del_gendisk(struct gendisk *disk)
	 * If the disk does not own the queue, allow using passthrough requests
	 * again.  Else leave the queue frozen to fail all I/O.
	 */
	if (!test_bit(GD_OWNS_QUEUE, &disk->state)) {
		blk_queue_flag_clear(QUEUE_FLAG_INIT_DONE, q);
	if (!test_bit(GD_OWNS_QUEUE, &disk->state))
		__blk_mq_unfreeze_queue(q, true);
	} else {
		if (queue_is_mq(q))
	else if (queue_is_mq(q))
		blk_mq_exit_queue(q);
}
}
EXPORT_SYMBOL(del_gendisk);

/**