kernel_samsung_a53x/arch/parisc/include/asm
Guenter Roeck d2ea1e91ab parisc: Strip upper 32 bit of sum in csum_ipv6_magic for 64-bit builds
[ Upstream commit 0568b6f0d863643db2edcc7be31165740c89fa82 ]

IPv6 checksum tests with unaligned addresses on 64-bit builds result
in unexpected failures.

Expected expected == csum_result, but
    expected == 46591 (0xb5ff)
    csum_result == 46381 (0xb52d)
with alignment offset 1

Oddly enough, the problem disappeared after adding test code into
the beginning of csum_ipv6_magic().

As it turns out, the 'sum' parameter of csum_ipv6_magic() is declared as
__wsum, which is a 32-bit variable. However, it is treated as 64-bit
variable in the 64-bit assembler code. Tests showed that the upper 32 bit
of the register used to pass the variable are _not_ cleared when entering
the function. This can result in checksum calculation errors.

Clearing the upper 32 bit of 'sum' as first operation in the assembler
code fixes the problem.

Acked-by: Helge Deller <deller@gmx.de>
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-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: Strip upper 32 bit of sum in csum_ipv6_magic for 64-bit builds 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