Skip to content

blkdev: Annotate struct request_queue with __counted_by_ptr#577

Open
blktests-ci[bot] wants to merge 1 commit intolinus-master_basefrom
series/1055392=>linus-master
Open

blkdev: Annotate struct request_queue with __counted_by_ptr#577
blktests-ci[bot] wants to merge 1 commit intolinus-master_basefrom
series/1055392=>linus-master

Conversation

@blktests-ci
Copy link

@blktests-ci blktests-ci bot commented Feb 19, 2026

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

@blktests-ci
Copy link
Author

blktests-ci bot commented Feb 19, 2026

Upstream branch: 2961f84
series: https://patchwork.kernel.org/project/linux-block/list/?series=1055392
version: 1

@blktests-ci
Copy link
Author

blktests-ci bot commented Feb 19, 2026

Upstream branch: 2b7a25d
series: https://patchwork.kernel.org/project/linux-block/list/?series=1055392
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1055392=>linus-master branch from bba8116 to 261f66e Compare February 19, 2026 12:51
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from df85678 to 50e7070 Compare February 22, 2026 05:34
@blktests-ci
Copy link
Author

blktests-ci bot commented Feb 22, 2026

Upstream branch: 32a92f8
series: https://patchwork.kernel.org/project/linux-block/list/?series=1055392
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1055392=>linus-master branch from 261f66e to 4e8abc8 Compare February 22, 2026 05:35
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 50e7070 to c90f83b Compare February 23, 2026 10:11
@blktests-ci
Copy link
Author

blktests-ci bot commented Feb 23, 2026

Upstream branch: 6de23f8
series: https://patchwork.kernel.org/project/linux-block/list/?series=1055392
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1055392=>linus-master branch from 4e8abc8 to ab303d0 Compare February 23, 2026 10:13
@blktests-ci
Copy link
Author

blktests-ci bot commented Feb 24, 2026

Upstream branch: 6de23f8
series: https://patchwork.kernel.org/project/linux-block/list/?series=1055392
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1055392=>linus-master branch from ab303d0 to d10c27e Compare February 24, 2026 09:06
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from c90f83b to c475e20 Compare February 25, 2026 11:14
@blktests-ci
Copy link
Author

blktests-ci bot commented Feb 25, 2026

Upstream branch: 7dff99b
series: https://patchwork.kernel.org/project/linux-block/list/?series=1055392
version: 1

@blktests-ci blktests-ci bot force-pushed the series/1055392=>linus-master branch from d10c27e to c2a3f52 Compare February 25, 2026 11:17
@blktests-ci
Copy link
Author

blktests-ci bot commented Feb 25, 2026

Upstream branch: 7dff99b
series: https://patchwork.kernel.org/project/linux-block/list/?series=1058006
version: 2

@blktests-ci blktests-ci bot added V2 and removed V1 V1-ci-pass labels Feb 25, 2026
@blktests-ci blktests-ci bot force-pushed the series/1055392=>linus-master branch from c2a3f52 to 0f121be Compare February 25, 2026 20:53
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from c475e20 to 14f6b99 Compare February 27, 2026 16:24
@blktests-ci
Copy link
Author

blktests-ci bot commented Mar 2, 2026

Upstream branch: 11439c4
series: https://patchwork.kernel.org/project/linux-block/list/?series=1058006
version: 2

@blktests-ci blktests-ci bot force-pushed the series/1055392=>linus-master branch from 2b041af to 07c97f0 Compare March 2, 2026 09:30
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 40967f0 to d4e9bad Compare March 2, 2026 23:54
@blktests-ci
Copy link
Author

blktests-ci bot commented Mar 3, 2026

Upstream branch: af4e9ef
series: https://patchwork.kernel.org/project/linux-block/list/?series=1058006
version: 2

@blktests-ci blktests-ci bot force-pushed the series/1055392=>linus-master branch from 07c97f0 to 960e8ac Compare March 3, 2026 00:02
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch 2 times, most recently from ecd10e2 to d0e1bed Compare March 4, 2026 07:45
@blktests-ci
Copy link
Author

blktests-ci bot commented Mar 4, 2026

Upstream branch: af4e9ef
series: https://patchwork.kernel.org/project/linux-block/list/?series=1058006
version: 2

@blktests-ci blktests-ci bot force-pushed the series/1055392=>linus-master branch from 960e8ac to f900112 Compare March 4, 2026 07:58
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from d0e1bed to 6b51c57 Compare March 4, 2026 09:34
@blktests-ci
Copy link
Author

blktests-ci bot commented Mar 4, 2026

Upstream branch: 0031c06
series: https://patchwork.kernel.org/project/linux-block/list/?series=1058006
version: 2

@blktests-ci blktests-ci bot force-pushed the series/1055392=>linus-master branch from f900112 to 1996126 Compare March 4, 2026 09:42
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 6b51c57 to 78036b2 Compare March 4, 2026 19:57
@blktests-ci
Copy link
Author

blktests-ci bot commented Mar 4, 2026

Upstream branch: ecc64d2
series: https://patchwork.kernel.org/project/linux-block/list/?series=1058006
version: 2

@blktests-ci blktests-ci bot force-pushed the series/1055392=>linus-master branch from 1996126 to 98a5436 Compare March 4, 2026 20:04
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 78036b2 to bbb3394 Compare March 5, 2026 12:20
@blktests-ci
Copy link
Author

blktests-ci bot commented Mar 5, 2026

Upstream branch: c107785
series: https://patchwork.kernel.org/project/linux-block/list/?series=1058006
version: 2

@blktests-ci blktests-ci bot force-pushed the series/1055392=>linus-master branch from 98a5436 to b9ff0f6 Compare March 5, 2026 12:32
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from bbb3394 to 901a429 Compare March 5, 2026 21:37
@blktests-ci
Copy link
Author

blktests-ci bot commented Mar 5, 2026

Upstream branch: 5ee8dbf
series: https://patchwork.kernel.org/project/linux-block/list/?series=1058006
version: 2

@blktests-ci blktests-ci bot force-pushed the series/1055392=>linus-master branch from b9ff0f6 to a30fc60 Compare March 5, 2026 21:48
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 901a429 to 1f19ba6 Compare March 10, 2026 06:29
@blktests-ci
Copy link
Author

blktests-ci bot commented Mar 10, 2026

Upstream branch: 1f318b9
series: https://patchwork.kernel.org/project/linux-block/list/?series=1058006
version: 2

@blktests-ci blktests-ci bot force-pushed the series/1055392=>linus-master branch from a30fc60 to 96d69e7 Compare March 10, 2026 06:42
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 1f19ba6 to e79276a Compare March 11, 2026 08:02
@blktests-ci
Copy link
Author

blktests-ci bot commented Mar 11, 2026

Upstream branch: None
series: https://patchwork.kernel.org/project/linux-block/list/?series=1058006
version: 2

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>
@blktests-ci blktests-ci bot force-pushed the series/1055392=>linus-master branch from 96d69e7 to e98cb30 Compare March 11, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant