Skip to content

partitions: aix: bound the lvd scan to one sector#935

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

partitions: aix: bound the lvd scan to one sector#935
blktests-ci[bot] wants to merge 1 commit into
linus-master_basefrom
series/1107036=>linus-master

Conversation

@blktests-ci

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

Copy link
Copy Markdown

Pull request for series with
subject: partitions: aix: bound the lvd scan to one sector
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1107036

@blktests-ci

blktests-ci Bot commented Jun 6, 2026

Copy link
Copy Markdown
Author

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

@blktests-ci

blktests-ci Bot commented Jun 7, 2026

Copy link
Copy Markdown
Author

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

@blktests-ci blktests-ci Bot force-pushed the series/1107036=>linus-master branch from cab902d to ad07641 Compare June 7, 2026 15:15
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from a7bb5c5 to 5e41a3b Compare June 10, 2026 13:31
@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=1107036
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1107036=>linus-master branch from ad07641 to 2044088 Compare June 10, 2026 13:51
@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=1107036
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1107036=>linus-master branch from 2044088 to 17a2d2e Compare June 11, 2026 09:24
@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=1107036
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1107036=>linus-master branch from 17a2d2e to 5b14dce Compare June 12, 2026 22:46
@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=1107036
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1107036=>linus-master branch from 5b14dce to 25e182b Compare June 13, 2026 01:43
@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=1107036
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1107036=>linus-master branch from 25e182b to 9a680f3 Compare June 17, 2026 13:45
@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=1107036
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1107036=>linus-master branch from 9a680f3 to 52e4e85 Compare June 24, 2026 01:42
@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=1107036
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1107036=>linus-master branch from 52e4e85 to 665a519 Compare June 26, 2026 09:02
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 4cc45a3 to 90ffd56 Compare June 29, 2026 17:14
@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=1107036
version: 1

aix_partition() reads the logical-volume descriptor array as a single
sector and then scans it:

	if (numlvs && (d = read_part_sector(state, vgda_sector + 1, &sect))) {
		struct lvd *p = (struct lvd *)d;
		...
		for (i = 0; foundlvs < numlvs && i < state->limit; i += 1) {
			lvip[i].pps_per_lv = be16_to_cpu(p[i].num_lps);

p points at a single 512-byte sector, which holds 512 / sizeof(struct
lvd) = 16 entries, but the loop runs until foundlvs reaches the on-disk
numlvs or i reaches state->limit (DISK_MAX_PARTS, 256). numlvs is an
on-disk __be16 read straight from the volume group descriptor and is not
validated, so a crafted AIX image with numlvs larger than 16 and lvd
entries whose num_lps fields are zero (so foundlvs never advances) drives
the loop to read p[i] well past the end of the read sector buffer.

The 2014 off-by-one fix d97a86c hardened the matching write of
lvip[lv_ix] but left this read loop unbounded.

Bound the scan to the number of struct lvd entries that fit in the
sector that was actually read.

Fixes: 6ceea22 ("partitions: add aix lvm partition support files")
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
@blktests-ci blktests-ci Bot force-pushed the series/1107036=>linus-master branch from 665a519 to 6ad93db Compare June 29, 2026 18:04
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