[PATCH 0/5] block: reject invalid partition and queue attribute values

From: shao.mingyin

Date: Thu Dec 03 2026 - 09:17:15 EST


This series fixes five independent places in the block layer where a
value from a partition table or a queue sysfs attribute is accepted
without validation and then interpreted incorrectly. Each change
rejects or bounds the value before it is used; none of them changes a
valid path.

Patches 1-2 are partition table parsers. A negative Ultrix partition
size is sign-extended into sector_t, and an AIX LVM start sector wraps
in 32-bit arithmetic; both can create a partition at the wrong place or
with an impossible size.

Patches 3-5 are queue sysfs attributes: nomerges, rq_affinity and
write_cache. Out-of-range numbers and prefix-matching strings currently
change the setting or are silently ignored.

The five patches are independent and can be applied in any order.

Testing: each change was exercised on next-20261130 in a QEMU/TCG guest
against an unpatched and a patched kernel, with a valid-input control
for each patched path; the individual patches give the observed values.
The series applies to 253f86660c1f and was built with CONFIG_SMP
enabled; checkpatch.pl --strict reports no errors or warnings.

Shao Mingyin (5):
block: partitions: ultrix: reject negative partition sizes
block: partitions: aix: avoid 32-bit wrap in the LV start sector
block: blk-sysfs: reject out-of-range nomerges values
block: blk-sysfs: reject invalid rq_affinity values
block: blk-sysfs: match the write_cache strings exactly

block/blk-sysfs.c | 11 ++++++++---
block/partitions/aix.c | 8 +++++---
block/partitions/ultrix.c | 5 ++++-
3 files changed, 17 insertions(+), 7 deletions(-)

---
base-commit: 253f86660c1f882fbf554db5eaa34bc5d66dc7e8