linux-stable/block/partitions
Michael Schmitz bb2f7e4bfe block/partition: fix signedness issue for Amiga partitions
commit 7eb1e47696 upstream.

Making 'blk' sector_t (i.e. 64 bit if LBD support is active) fails the
'blk>0' test in the partition block loop if a value of (signed int) -1 is
used to mark the end of the partition block list.

Explicitly cast 'blk' to signed int to allow use of -1 to terminate the
partition block linked list.

Fixes: b6f3f28f60 ("block: add overflow checks for Amiga partition support")
Reported-by: Christian Zigotzky <chzigotzky@xenosoft.de>
Link: https://lore.kernel.org/r/024ce4fa-cc6d-50a2-9aae-3701d0ebf668@xenosoft.de
Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
Reviewed-by: Martin Steigerwald <martin@lichtvoll.de>
Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-07-27 08:44:18 +02:00
..
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile block: merge partition-generic.c and check.c 2020-03-24 07:57:08 -06:00
acorn.c block: declare all partition detection routines in check.h 2020-03-24 07:57:08 -06:00
aix.c block: declare all partition detection routines in check.h 2020-03-24 07:57:08 -06:00
amiga.c block/partition: fix signedness issue for Amiga partitions 2023-07-27 08:44:18 +02: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 block: declare all partition detection routines in check.h 2020-03-24 07:57:08 -06:00
check.h block: move block layer internals out of include/linux/genhd.h 2020-03-25 09:50:08 -06:00
cmdline.c block: declare all partition detection routines in check.h 2020-03-24 07:57:08 -06:00
core.c block: unhash blkdev part inode when the part is deleted 2022-12-08 11:23:59 +01:00
efi.c partitions/efi: Fix partition name parsing in GUID partition entry 2020-03-08 10:00:09 +01:00
efi.h Merge branch 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2020-03-30 16:13:08 -07:00
ibm.c partitions/ibm: fix non-DASD devices 2020-10-07 07:55:35 -06:00
karma.c block: remove block/partitions/karma.h 2020-03-24 07:57:08 -06:00
ldm.c partitions: msdos: fix one-byte get_unaligned() 2021-07-20 16:05:39 +02:00
ldm.h partitions: msdos: fix one-byte get_unaligned() 2021-07-20 16:05:39 +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 block: declare all partition detection routines in check.h 2020-03-24 07:57:08 -06:00
msdos.c partitions: msdos: fix one-byte get_unaligned() 2021-07-20 16:05:39 +02:00
osf.c block: remove block/partitions/osf.h 2020-03-24 07:57:08 -06:00
sgi.c block: move the *_PARTITION enum out of genhd.h 2020-03-24 07:57:08 -06:00
sun.c block: move the *_PARTITION enum out of genhd.h 2020-03-24 07:57:08 -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