Skip to content

brd: normalize non-positive max_part before rounding it up#945

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

brd: normalize non-positive max_part before rounding it up#945
blktests-ci[bot] wants to merge 1 commit into
linus-master_basefrom
series/1108157=>linus-master

Conversation

@blktests-ci

@blktests-ci blktests-ci Bot commented Jun 9, 2026

Copy link
Copy Markdown

Pull request for series with
subject: brd: normalize non-positive max_part before rounding it up
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1108157

@blktests-ci

blktests-ci Bot commented Jun 9, 2026

Copy link
Copy Markdown
Author

Upstream branch: 979c294
series: https://patchwork.kernel.org/project/linux-block/list/?series=1108157
version: 1

@blktests-ci

blktests-ci Bot commented Jun 10, 2026

Copy link
Copy Markdown
Author

Upstream branch: acb7500
series: https://patchwork.kernel.org/project/linux-block/list/?series=1108157
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1108157=>linus-master branch from e294502 to cf302b5 Compare June 10, 2026 13:44
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 5e41a3b to c3a084b Compare June 10, 2026 20:26
@blktests-ci

blktests-ci Bot commented Jun 11, 2026

Copy link
Copy Markdown
Author

Upstream branch: 9716c08
series: https://patchwork.kernel.org/project/linux-block/list/?series=1108157
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1108157=>linus-master branch from cf302b5 to 414dc80 Compare June 11, 2026 09:17
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from c3a084b to 5f78e5d Compare June 12, 2026 22:27
@blktests-ci

blktests-ci Bot commented Jun 12, 2026

Copy link
Copy Markdown
Author

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

@blktests-ci blktests-ci Bot force-pushed the series/1108157=>linus-master branch from 414dc80 to 9ecf8c6 Compare June 12, 2026 22:38
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 5f78e5d to e48f9db Compare June 13, 2026 01:19
@blktests-ci

blktests-ci Bot commented Jun 13, 2026

Copy link
Copy Markdown
Author

Upstream branch: 062871f
series: https://patchwork.kernel.org/project/linux-block/list/?series=1108157
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1108157=>linus-master branch from 9ecf8c6 to 407a53b Compare June 13, 2026 01:36
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch 2 times, most recently from 199644a to e6d9eb8 Compare June 17, 2026 12:02
@blktests-ci

blktests-ci Bot commented Jun 17, 2026

Copy link
Copy Markdown
Author

Upstream branch: 66affa3
series: https://patchwork.kernel.org/project/linux-block/list/?series=1108157
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1108157=>linus-master branch from 407a53b to 0234d6a Compare June 17, 2026 13:40
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from e6d9eb8 to 7d8604f Compare June 24, 2026 01:11
@blktests-ci

blktests-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown
Author

Upstream branch: bade58e
series: https://patchwork.kernel.org/project/linux-block/list/?series=1108157
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1108157=>linus-master branch from 0234d6a to 0c0eb85 Compare June 24, 2026 01:38
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 7d8604f to 4cc45a3 Compare June 26, 2026 08:14
@blktests-ci

blktests-ci Bot commented Jun 26, 2026

Copy link
Copy Markdown
Author

Upstream branch: 4edcdef
series: https://patchwork.kernel.org/project/linux-block/list/?series=1108157
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1108157=>linus-master branch from 0c0eb85 to e8bd33b Compare June 26, 2026 08:58
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 4cc45a3 to 90ffd56 Compare June 29, 2026 17:14
`max_part` is an `int` module parameter, but brd only resets zero before
rounding non-divisor values with `1UL << fls(max_part)`.

A negative value such as -1 passes the initial zero check.  The modulo
test then reaches the roundup, where `fls(-1)` yields 32.  On 64-bit
builds that produces 4294967296, which is then assigned back to `int
max_part` as zero.  `brd_alloc()` passes that zero value to
`disk->minors`, and block core warns and rejects the disk.

Normalize non-positive values to the existing one-partition fallback
before the modulo/roundup, and apply the existing `DISK_MAX_PARTS` clamp
before the roundup so it only operates on representable, in-range
values.

Assisted-by: Codex:gpt-5.5-cyber-preview
Signed-off-by: Samuel Moelius <sam.moelius@trailofbits.com>
@blktests-ci

blktests-ci Bot commented Jun 29, 2026

Copy link
Copy Markdown
Author

Upstream branch: dc59e4f
series: https://patchwork.kernel.org/project/linux-block/list/?series=1108157
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1108157=>linus-master branch from e8bd33b to 7f3e325 Compare June 29, 2026 18:01
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.

2 participants