android_kernel_asus_sm8350/arch
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: 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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-02-22 12:50:34 +01:00
..
alpha exit: Add and use make_task_dead. 2023-02-06 07:52:49 +01:00
arc arc: iounmap() arg is volatile 2022-11-03 23:56:54 +09:00
arm exit: Add and use make_task_dead. 2023-02-06 07:52:49 +01:00
arm64 arm64: dts: meson-axg: Make mmc host controller interrupts level-sensitive 2023-02-22 12:50:33 +01:00
c6x mm: consolidate pgtable_cache_init() and pgd_cache_init() 2019-09-24 15:54:09 -07:00
csky csky: Fix function name in csky_alignment() and die() 2023-02-06 07:52:49 +01:00
h8300 h8300: Fix build errors from do_exit() to make_task_dead() transition 2023-02-06 07:52:49 +01:00
hexagon hexagon: Fix function name in die() 2023-02-06 07:52:49 +01:00
ia64 ia64: make IA64_MCA_RECOVERY bool instead of tristate 2023-02-06 07:52:49 +01:00
m68k exit: Add and use make_task_dead. 2023-02-06 07:52:49 +01:00
microblaze exit: Add and use make_task_dead. 2023-02-06 07:52:49 +01:00
mips exit: Add and use make_task_dead. 2023-02-06 07:52:49 +01:00
nds32 exit: Add and use make_task_dead. 2023-02-06 07:52:49 +01:00
nios2 exit: Add and use make_task_dead. 2023-02-06 07:52:49 +01:00
openrisc exit: Add and use make_task_dead. 2023-02-06 07:52:49 +01:00
parisc parisc: Wire up PTRACE_GETREGS/PTRACE_SETREGS for compat case 2023-02-22 12:50:28 +01:00
powerpc powerpc/imc-pmu: Revert nest_init_lock to being a mutex 2023-02-22 12:50:29 +01:00
riscv riscv: Fixup race condition on PG_dcache_clean in flush_icache_pte 2023-02-22 12:50:33 +01:00
s390 s390/decompressor: specify __decompress() buf len to avoid overflow 2023-02-22 12:50:34 +01:00
sh exit: Add and use make_task_dead. 2023-02-06 07:52:49 +01:00
sparc exit: Add and use make_task_dead. 2023-02-06 07:52:49 +01:00
um UM: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK 2022-10-26 13:22:16 +02:00
unicore32 mm: treewide: clarify pgtable_page_{ctor,dtor}() naming 2019-09-26 10:10:44 -07:00
x86 exit: Add and use make_task_dead. 2023-02-06 07:52:49 +01:00
xtensa exit: Add and use make_task_dead. 2023-02-06 07:52:49 +01:00
.gitignore
Kconfig locking/refcount: Consolidate implementations of refcount_t 2022-07-29 17:14:17 +02:00