Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sparc32: unaligned memory access (MNA) trap handler bug

Since commit f0e98c387e61de00646be31fab4c2fa0224e1efb ("[SPARC]: Fix
link errors with gcc-4.3") the MNA trap handler does not emulate
stores to unaligned addresses correctly. MNA operation from both
kernel and user space are affected.

A typical effect of this bug is nr_frags in skbs are overwritten
during buffer copying/checksum-calculation, or maximally 6 bytes
of data in the network buffer will be overwitten with garbage.

Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Daniel Hellstrom and committed by
David S. Miller
2492218c 5edddaab

+2 -2
+2 -2
arch/sparc/kernel/una_asm_32.S
··· 24 24 .globl __do_int_store 25 25 __do_int_store: 26 26 ld [%o2], %g1 27 - cmp %1, 2 27 + cmp %o1, 2 28 28 be 2f 29 - cmp %1, 4 29 + cmp %o1, 4 30 30 be 1f 31 31 srl %g1, 24, %g2 32 32 srl %g1, 16, %g7