android_kernel_motorola_sm6225/block/partitions
Michael Schmitz e9ecde030c block: fix signed int overflow in Amiga partition support
[ Upstream commit fc3d092c6bb48d5865fec15ed5b333c12f36288c ]

The Amiga partition parser module uses signed int for partition sector
address and count, which will overflow for disks larger than 1 TB.

Use sector_t as type for sector address and size to allow using disks
up to 2 TB without LBD support, and disks larger than 2 TB with LBD.

This bug was reported originally in 2012, and the fix was created by
the RDB author, Joanne Dow <jdow@earthlink.net>. A patch had been
discussed and reviewed on linux-m68k at that time but never officially
submitted. This patch differs from Joanne's patch only in its use of
sector_t instead of unsigned int. No checking for overflows is done
(see patch 3 of this series for that).

Reported-by: Martin Steigerwald <Martin@lichtvoll.de>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=43511
Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Message-ID: <201206192146.09327.Martin@lichtvoll.de>
Cc: <stable@vger.kernel.org> # 5.2
Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
Tested-by: Martin Steigerwald <Martin@lichtvoll.de>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20230620201725.7020-2-schmitzmic@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-08-30 16:31:46 +02:00
..
acorn.c move fs/partitions to block/ 2012-01-03 22:54:06 -05:00
acorn.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
aix.c partitions/aix: append null character to print data from disk 2018-07-27 09:17:41 -06:00
aix.h partitions: add aix lvm partition support files 2013-07-09 10:33:28 -07:00
amiga.c block: fix signed int overflow in Amiga partition support 2023-08-30 16:31:46 +02:00
amiga.h move fs/partitions to block/ 2012-01-03 22:54:06 -05:00
atari.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
atari.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
check.c treewide: Use array_size() in vzalloc() 2018-06-12 16:19:22 -07:00
check.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cmdline.c block: add verifier for cmdline partition 2018-06-05 09:20:53 -06:00
cmdline.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
efi.c partitions/efi: Fix integer overflow in GPT size calculation 2017-01-17 09:02:31 -07:00
efi.h block: Use macros from compiler.h instead of __attribute__((...)) 2014-02-18 12:20:01 -08:00
ibm.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ibm.h move fs/partitions to block/ 2012-01-03 22:54:06 -05:00
karma.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
karma.h move fs/partitions to block/ 2012-01-03 22:54:06 -05:00
Kconfig License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ldm.c partitions/ldm: remove redundant pointer dgrp 2018-07-09 09:07:53 -06:00
ldm.h partitions/ldm: switch to use uuid_t 2017-06-05 16:59:14 +02:00
mac.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mac.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
msdos.c partitions/msdos: Unable to mount UFS 44bsd partitions 2018-01-10 09:12:16 -07:00
msdos.h move fs/partitions to block/ 2012-01-03 22:54:06 -05:00
osf.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
osf.h move fs/partitions to block/ 2012-01-03 22:54:06 -05:00
sgi.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sgi.h move fs/partitions to block/ 2012-01-03 22:54:06 -05:00
sun.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sun.h move fs/partitions to block/ 2012-01-03 22:54:06 -05:00
sysv68.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sysv68.h move fs/partitions to block/ 2012-01-03 22:54:06 -05:00
ultrix.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ultrix.h move fs/partitions to block/ 2012-01-03 22:54:06 -05:00