[lkml]   [2018]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 4.18 226/228] powerpc: fix csum_ipv6_magic() on little endian platforms
4.18-stable review patch.  If anyone has any objections, please let me know.


From: Christophe Leroy <>

commit 85682a7e3b9c664995ad477520f917039afdc330 upstream.

On little endian platforms, csum_ipv6_magic() keeps len and proto in
CPU byte order. This generates a bad results leading to ICMPv6 packets
from other hosts being dropped by powerpc64le platforms.

In order to fix this, len and proto should be converted to network
byte order ie bigendian byte order. However checksumming 0x12345678
and 0x56341278 provide the exact same result so it is enough to
rotate the sum of len and proto by 1 byte.

PPC32 only support bigendian so the fix is needed for PPC64 only

Fixes: e9c4943a107b ("powerpc: Implement csum_ipv6_magic in assembly")
Reported-by: Jianlin Shi <>
Reported-by: Xin Long <>
Cc: <> # 4.18+
Signed-off-by: Christophe Leroy <>
Tested-by: Xin Long <>
Signed-off-by: Michael Ellerman <>
Signed-off-by: Greg Kroah-Hartman <>

arch/powerpc/lib/checksum_64.S | 3 +++
1 file changed, 3 insertions(+)

--- a/arch/powerpc/lib/checksum_64.S
+++ b/arch/powerpc/lib/checksum_64.S
@@ -443,6 +443,9 @@ _GLOBAL(csum_ipv6_magic)
addc r0, r8, r9
ld r10, 0(r4)
ld r11, 8(r4)
+ rotldi r5, r5, 8
adde r0, r0, r10
add r5, r5, r7
adde r0, r0, r11

 \ /
  Last update: 2018-10-02 15:57    [W:0.514 / U:1.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site