mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
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, §))) {
struct lvd *p = (struct lvd *)d;
...
for (i = 0; foundlvs < numlvs && i < state->limit; i++) {
lvip[i].pps_per_lv = be16_to_cpu(p[i].num_lps);
p points at a single 512-byte sector, which holds SECTOR_SIZE /
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.
Commit
|
||
|---|---|---|
| .. | ||
| acorn.c | ||
| aix.c | ||
| amiga.c | ||
| atari.c | ||
| atari.h | ||
| check.h | ||
| cmdline.c | ||
| core.c | ||
| efi.c | ||
| efi.h | ||
| ibm.c | ||
| karma.c | ||
| Kconfig | ||
| ldm.c | ||
| ldm.h | ||
| mac.c | ||
| mac.h | ||
| Makefile | ||
| msdos.c | ||
| of.c | ||
| osf.c | ||
| sgi.c | ||
| sun.c | ||
| sysv68.c | ||
| ultrix.c | ||