android_kernel_motorola_sm6375/arch
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Mikulas Patocka 5335370366 x86: __memcpy_flushcache: fix wrong alignment if size > 2^32
[ Upstream commit a6823e4e360fe975bd3da4ab156df7c74c8b07f3 ]

The first "if" condition in __memcpy_flushcache is supposed to align the
"dest" variable to 8 bytes and copy data up to this alignment.  However,
this condition may misbehave if "size" is greater than 4GiB.

The statement min_t(unsigned, size, ALIGN(dest, 8) - dest); casts both
arguments to unsigned int and selects the smaller one.  However, the
cast truncates high bits in "size" and it results in misbehavior.

For example:

	suppose that size == 0x100000001, dest == 0x200000002
	min_t(unsigned, size, ALIGN(dest, 8) - dest) == min_t(0x1, 0xe) == 0x1;
	...
	dest += 0x1;

so we copy just one byte "and" dest remains unaligned.

This patch fixes the bug by replacing unsigned with size_t.

Signed-off-by: Mikulas Patocka <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2022-05-09 09:03:26 +02:00
..
alpha
arc ARC: entry: fix syscall_trace_exit argument 2022-04-27 13:50:49 +02:00
arm ARM: dts: imx6ull-colibri: fix vqmmc regulator 2022-05-09 09:03:25 +02:00
arm64 arm64: dts: imx8mn-ddr4-evk: Describe the 32.768 kHz PMIC clock 2022-05-09 09:03:25 +02:00
c6x
csky perf: Protect perf_guest_cbs with RCU 2022-01-20 09:19:18 +01:00
h8300
hexagon hexagon: export raw I/O routines for modules 2021-11-26 10:47:21 +01:00
ia64 ia64: ensure proper NUMA distance and possible map initialization 2022-03-08 19:07:48 +01:00
m68k
microblaze uaccess: fix nios2 and microblaze get_user_8() 2022-04-15 14:18:08 +02:00
mips MIPS: fix fortify panic when copying asm exception handlers 2022-04-15 14:18:34 +02:00
nds32 nds32: fix access_ok() checks in get/put_user 2022-03-28 08:46:48 +02:00
nios2 uaccess: fix nios2 and microblaze get_user_8() 2022-04-15 14:18:08 +02:00
openrisc
parisc parisc: Fix patch code locking and flushing 2022-04-15 14:18:36 +02:00
powerpc powerpc/perf: Fix power9 event alternatives 2022-04-27 13:50:49 +02:00
riscv riscv module: remove (NOLOAD) 2022-04-15 14:18:31 +02:00
s390 s390/hypfs: include z/VM guests with access control group set 2022-02-01 17:24:33 +01:00
sh
sparc
um um: Fix uml_mconsole stop/go 2022-04-15 14:18:31 +02:00
unicore32
x86 x86: __memcpy_flushcache: fix wrong alignment if size > 2^32 2022-05-09 09:03:26 +02:00
xtensa xtensa: fix a7 clobbering in coprocessor context load/store 2022-04-27 13:50:49 +02:00
.gitignore
Kconfig