[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <593de98e-6b94-43dc-c62f-12388b11533e@huawei.com>
Date: Fri, 25 Feb 2022 11:15:08 +0800
From: "yukuai (C)" <yukuai3@...wei.com>
To: Ming Lei <ming.lei@...hat.com>
CC: <axboe@...nel.dk>, <linux-block@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <yi.zhang@...wei.com>
Subject: Re: [PATCH RFC] blk-mq: fix potential uaf for 'queue_hw_ctx'
在 2022/02/25 10:40, Ming Lei 写道:
>> +static inline struct blk_mq_hw_ctx *queue_hctx(struct request_queue *q, int id)
>> +{
>> + struct blk_mq_hw_ctx *hctx;
>> +
>> + rcu_read_lock();
>> + hctx = *(rcu_dereference(q->queue_hw_ctx) + id);
>> + rcu_read_unlock();
>> +
>> + return hctx;
>> +}
>
> queue_hctx() should be moved into linux/blk-mq.h, otherwise feel free to
> add:
>
> Reviewed-by: Ming Lei <ming.lei@...hat.com>
Thanks for the review, I will send a new patch and move queue_hctx.
Kuai
>
> Also it should be fine to implement queue_for_each_hw_ctx() as list, then we
> can avoid the allocation for q->queue_hw_ctx without extra cost. I will work
> toward that direction for improving the code.
>
> Thanks,
> Ming
>
> .
>
Powered by blists - more mailing lists