1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/block/partitions
Jann Horn 80e648042e partitions: mac: fix handling of bogus partition table
Fix several issues in partition probing:

 - The bailout for a bad partoffset must use put_dev_sector(), since the
   preceding read_part_sector() succeeded.
 - If the partition table claims a silly sector size like 0xfff bytes
   (which results in partition table entries straddling sector boundaries),
   bail out instead of accessing out-of-bounds memory.
 - We must not assume that the partition table contains proper NUL
   termination - use strnlen() and strncmp() instead of strlen() and
   strcmp().

Cc: stable@vger.kernel.org
Signed-off-by: Jann Horn <jannh@google.com>
Link: https://lore.kernel.org/r/20250214-partition-mac-v1-1-c1c626dffbd5@google.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2025-02-14 08:38:28 -07:00
..
acorn.c block/partitions/acorn: Remove redundant assignments 2022-04-23 07:15:26 -06:00
aix.c block: store a gendisk in struct parsed_partitions 2021-08-12 10:31:35 -06:00
amiga.c block/partition: fix signedness issue for Amiga partitions 2023-07-05 16:34:56 -06:00
atari.c block/partitions/atari: Remove redundant assignment 2022-04-23 07:15:26 -06:00
atari.h block: declare all partition detection routines in check.h 2020-03-24 07:57:08 -06:00
check.h block: add support for partition table defined in OF 2024-10-22 08:14:56 -06:00
cmdline.c block: add support for defining read-only partitions 2024-10-22 08:14:56 -06:00
core.c block: add partition uuid into uevent as "PARTUUID" 2024-10-22 08:15:17 -06:00
efi.c partitions/efi: use bdev_nr_bytes instead of open coding it 2021-10-19 06:16:50 -06:00
efi.h block: remove genhd.h 2022-02-02 07:49:59 -07:00
ibm.c partitions/ibm: Introduce defines for magic string length values 2023-10-04 08:04:08 -06:00
karma.c block: remove block/partitions/karma.h 2020-03-24 07:57:08 -06:00
Kconfig block: add support for partition table defined in OF 2024-10-22 08:14:56 -06:00
ldm.c block/partitions/ldm: convert strncpy() to strscpy() 2024-04-25 21:07:07 -07:00
ldm.h partitions: ldm: remove the initial kernel-doc notation 2025-01-13 07:47:19 -07:00
mac.c partitions: mac: fix handling of bogus partition table 2025-02-14 08:38:28 -07:00
mac.h block: declare all partition detection routines in check.h 2020-03-24 07:57:08 -06:00
Makefile block: add support for partition table defined in OF 2024-10-22 08:14:56 -06:00
msdos.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
of.c block: add support for partition table defined in OF 2024-10-22 08:14:56 -06:00
osf.c block: remove block/partitions/osf.h 2020-03-24 07:57:08 -06:00
sgi.c block: store a gendisk in struct parsed_partitions 2021-08-12 10:31:35 -06:00
sun.c block: store a gendisk in struct parsed_partitions 2021-08-12 10:31:35 -06:00
sysv68.c block: declare all partition detection routines in check.h 2020-03-24 07:57:08 -06:00
ultrix.c block: declare all partition detection routines in check.h 2020-03-24 07:57:08 -06:00