android_kernel_motorola_sm6375/arch/s390
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Vasily Gorbik 16409f7d9c s390/decompressor: specify __decompress() buf len to avoid overflow
[ Upstream commit 7ab41c2c08a32132ba8c14624910e2fe8ce4ba4b ]

Historically calls to __decompress() didn't specify "out_len" parameter
on many architectures including s390, expecting that no writes beyond
uncompressed kernel image are performed. This has changed since commit
2aa14b1ab2c4 ("zstd: import usptream v1.5.2") which includes zstd library
commit 6a7ede3dfccb ("Reduce size of dctx by reutilizing dst buffer
(#2751)"). Now zstd decompression code might store literal buffer in
the unwritten portion of the destination buffer. Since "out_len" is
not set, it is considered to be unlimited and hence free to use for
optimization needs. On s390 this might corrupt initrd or ipl report
which are often placed right after the decompressor buffer. Luckily the
size of uncompressed kernel image is already known to the decompressor,
so to avoid the problem simply specify it in the "out_len" parameter.

Link: 6a7ede3dfc
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Tested-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Link: https://lore.kernel.org/r/patch-1.thread-41c676.git-41c676c2d153.your-ad-here.call-01675030179-ext-9637@work.hours
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-02-22 12:50:34 +01:00
..
appldata
boot s390/decompressor: specify __decompress() buf len to avoid overflow 2023-02-22 12:50:34 +01:00
configs locking/refcount: Consolidate implementations of refcount_t 2022-07-29 17:14:17 +02:00
crypto s390/archrandom: simplify back to earlier design and initialize earlier 2022-07-07 17:36:48 +02:00
hypfs s390/hypfs: avoid error message under KVM 2022-09-05 10:27:47 +02:00
include s390/debug: add _ASM_S390_ prefix to header guard 2023-02-06 07:52:41 +01:00
kernel exit: Add and use make_task_dead. 2023-02-06 07:52:49 +01:00
kvm KVM: s390: interrupt: use READ_ONCE() before cmpxchg() 2023-02-06 07:52:42 +01:00
lib s390: fix strrchr() implementation 2021-10-20 11:40:12 +02:00
mm s390/mm: do not trigger write fault when vma does not allow VM_WRITE 2022-09-05 10:27:44 +02:00
net bpf, s390: Fix potential memory leak about jit_data 2021-10-13 10:08:20 +02:00
numa
oprofile
pci s390/pci: add missing EX_TABLE entries to __pcistg_mio_inuser()/__pcilg_mio_inuser() 2022-11-03 23:56:54 +09:00
purgatory
scripts
tools
Kbuild
Kconfig s390: remove unneeded 'select BUILD_BIN2C' 2022-07-07 17:36:49 +02:00
Kconfig.debug
Makefile s390: disable -Warray-bounds 2022-05-18 09:47:26 +02:00