lkml.org 
[lkml]   [2022]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH RFC] blk-mq: fix potential uaf for 'queue_hw_ctx'
From
Date
在 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@redhat.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
>
> .
>

\
 
 \ /
  Last update: 2022-02-25 04:15    [W:0.109 / U:1.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site