kernel_samsung_a53x/arch/parisc/include/asm
Guenter Roeck 2b71b3b15f parisc: Fix csum_ipv6_magic on 64-bit systems
[ Upstream commit 4b75b12d70506e31fc02356bbca60f8d5ca012d0 ]

hppa 64-bit systems calculates the IPv6 checksum using 64-bit add
operations. The last add folds protocol and length fields into the 64-bit
result. While unlikely, this operation can overflow. The overflow can be
triggered with a code sequence such as the following.

	/* try to trigger massive overflows */
	memset(tmp_buf, 0xff, sizeof(struct in6_addr));
	csum_result = csum_ipv6_magic((struct in6_addr *)tmp_buf,
				      (struct in6_addr *)tmp_buf,
				      0xffff, 0xff, 0xffffffff);

Fix the problem by adding any overflows from the final add operation into
the calculated checksum. Fortunately, we can do this without additional
cost by replacing the add operation used to fold the checksum into 32 bit
with "add,dc" to add in the missing carry.

Cc: Palmer Dabbelt <palmer@rivosinc.com>
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 09:22:16 +01:00
..
agp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
alternative.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
asm-offsets.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
asmregs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
assembly.h parisc: Avoid clobbering the C/B bits in the PSW with tophys and tovirt macros 2024-11-19 09:22:16 +01:00
atomic.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
barrier.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bitops.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bug.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cache.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cacheflush.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
checksum.h parisc: Fix csum_ipv6_magic on 64-bit systems 2024-11-19 09:22:16 +01:00
cmpxchg.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
compat.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
compat_ucontext.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
delay.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dma-mapping.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dma.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dwarf.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
eisa_bus.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
eisa_eeprom.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
elf.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fixmap.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
floppy.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ftrace.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
futex.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
grfioctl.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hardirq.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hardware.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hash.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hugetlb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ide.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
io.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
irq.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
irqflags.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jump_label.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kbdleds.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kbuild Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kexec.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kgdb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kmap_types.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kprobes.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ldcw.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
led.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
linkage.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
machdep.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mckinley.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmu.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmu_context.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmzone.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
module.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
page.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
parisc-device.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
parport.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
patch.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pci.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pdc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pdc_chassis.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pdcpat.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
perf.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
perf_event.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pgalloc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pgtable.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
prefetch.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
processor.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
psw.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ptrace.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ropes.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rt_sigframe.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
runway.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seccomp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sections.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
serial.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
shmparam.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
signal.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
socket.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sparsemem.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
special_insns.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
spinlock.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
spinlock_types.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
string.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
superio.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
switch_to.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
syscall.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
termios.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
thread_info.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
timex.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tlb.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tlbflush.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
topology.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
traps.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uaccess.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ucontext.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
unaligned.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
unistd.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
unwind.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vmalloc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00