kernel-hacking-2024-linux-s.../arch/s390
Vasily Gorbik 7ab41c2c08 s390/decompressor: specify __decompress() buf len to avoid overflow
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
2aa14b1ab2 ("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: https://github.com/facebook/zstd/commit/6a7ede3dfccb
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>
2023-01-31 18:54:21 +01:00
..
appldata s390/appldata: remove power management callbacks 2022-12-02 18:25:04 +01:00
boot s390/decompressor: specify __decompress() buf len to avoid overflow 2023-01-31 18:54:21 +01:00
configs s390: update defconfigs 2023-01-11 21:26:40 +01:00
crypto
hypfs s390/hypfs: remove unused info_blk_hdr__pcpus() function 2022-11-23 16:24:07 +01:00
include s390/percpu: add READ_ONCE() to arch_this_cpu_to_op_simple() 2023-01-11 15:28:47 +01:00
kernel s390: workaround invalid gcc-11 out of bounds read warning 2023-01-17 19:00:59 +01:00
kvm KVM: s390: interrupt: use READ_ONCE() before cmpxchg() 2023-01-11 15:28:47 +01:00
lib
mm ARM64: 2022-12-15 11:12:21 -08:00
net
pci IOMMU Updates for Linux v6.2 2022-12-19 08:34:39 -06:00
purgatory
tools
Kbuild
Kconfig s390 updates for 6.2 merge window 2022-12-12 11:04:08 -08:00
Kconfig.debug
Makefile s390: always build relocatable kernel 2022-11-08 19:32:32 +01:00