blkdev: Annotate struct request_queue with __counted_by_ptr#577
blkdev: Annotate struct request_queue with __counted_by_ptr#577blktests-ci[bot] wants to merge 1 commit intolinus-master_basefrom
Conversation
|
Upstream branch: 2961f84 |
f714aad to
df85678
Compare
|
Upstream branch: 2b7a25d |
bba8116 to
261f66e
Compare
df85678 to
50e7070
Compare
|
Upstream branch: 32a92f8 |
261f66e to
4e8abc8
Compare
50e7070 to
c90f83b
Compare
|
Upstream branch: 6de23f8 |
4e8abc8 to
ab303d0
Compare
|
Upstream branch: 6de23f8 |
ab303d0 to
d10c27e
Compare
c90f83b to
c475e20
Compare
|
Upstream branch: 7dff99b |
d10c27e to
c2a3f52
Compare
|
Upstream branch: 7dff99b |
c2a3f52 to
0f121be
Compare
c475e20 to
14f6b99
Compare
|
Upstream branch: 11439c4 |
2b041af to
07c97f0
Compare
40967f0 to
d4e9bad
Compare
|
Upstream branch: af4e9ef |
07c97f0 to
960e8ac
Compare
ecd10e2 to
d0e1bed
Compare
|
Upstream branch: af4e9ef |
960e8ac to
f900112
Compare
d0e1bed to
6b51c57
Compare
|
Upstream branch: 0031c06 |
f900112 to
1996126
Compare
6b51c57 to
78036b2
Compare
|
Upstream branch: ecc64d2 |
1996126 to
98a5436
Compare
78036b2 to
bbb3394
Compare
|
Upstream branch: c107785 |
98a5436 to
b9ff0f6
Compare
bbb3394 to
901a429
Compare
|
Upstream branch: 5ee8dbf |
b9ff0f6 to
a30fc60
Compare
901a429 to
1f19ba6
Compare
|
Upstream branch: 1f318b9 |
a30fc60 to
96d69e7
Compare
1f19ba6 to
e79276a
Compare
|
Upstream branch: None |
The queue_hw_ctx field in struct request_queue is an array of pointers to struct blk_mq_hw_ctx. The number of elements in this array is tracked by the nr_hw_queues field. The array is allocated in __blk_mq_realloc_hw_ctxs() using kcalloc_node() with set->nr_hw_queues elements. q->nr_hw_queues is subsequently updated to set->nr_hw_queues. When growing the array, the new array is assigned to queue_hw_ctx before nr_hw_queues is updated. This is safe because nr_hw_queues (the old smaller count) is used for bounds checking, which is within the new larger allocation. When shrinking the array, nr_hw_queues is updated to the smaller value, while queue_hw_ctx retains the larger allocation. This is also safe as the count is within the allocation bounds. Annotating queue_hw_ctx with __counted_by_ptr(nr_hw_queues) allows the compiler (with kSAN) to verify that accesses to queue_hw_ctx are within the valid range defined by nr_hw_queues. This patch was generated by CodeMender and reviewed by Bill Wendling. Tested by running blktests. Reviewed-by: Daniel Wagner <dwagner@suse.de> Signed-off-by: Bill Wendling <morbo@google.com>
96d69e7 to
e98cb30
Compare
Pull request for series with
subject: blkdev: Annotate struct request_queue with __counted_by_ptr
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1055392