Fix powerpc IPv6 (rhbz 1628394)

This commit is contained in:
Laura Abbott 2018-09-26 02:02:20 -07:00
parent 71d09c9a1d
commit e7783e7e1c
2 changed files with 50 additions and 0 deletions

View File

@ -631,6 +631,9 @@ Patch507: 0001-random-make-CPU-trust-a-boot-parameter.patch
# CVE-2018-14633 rhbz 1626035 1632185
Patch508: CVE-2018-14633.patch
# rhbz 1628394
Patch509: powerpc-ipv6.patch
# END OF PATCH DEFINITIONS
%endif
@ -1880,6 +1883,9 @@ fi
#
#
%changelog
* Wed Sep 26 2018 Laura Abbott <labbott@redhat.com>
- Fix powerpc IPv6 (rhbz 1628394)
* Mon Sep 24 2018 Justin M. Forbes <jforbes@fedoraproject.org>
- Fix CVE-2018-14633 (rhbz 1626035 1632185)

44
powerpc-ipv6.patch Normal file
View File

@ -0,0 +1,44 @@
From 85682a7e3b9c664995ad477520f917039afdc330 Mon Sep 17 00:00:00 2001
From: Christophe Leroy <christophe.leroy@c-s.fr>
Date: Mon, 10 Sep 2018 06:09:04 +0000
Subject: powerpc: fix csum_ipv6_magic() on little endian platforms
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 <jishi@redhat.com>
Reported-by: Xin Long <lucien.xin@gmail.com>
Cc: <stable@vger.kernel.org> # 4.18+
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Tested-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/lib/checksum_64.S | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/powerpc/lib/checksum_64.S b/arch/powerpc/lib/checksum_64.S
index 886ed94b9c13..d05c8af4ac51 100644
--- 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)
+#ifdef CONFIG_CPU_LITTLE_ENDIAN
+ rotldi r5, r5, 8
+#endif
adde r0, r0, r10
add r5, r5, r7
adde r0, r0, r11
--
cgit 1.2-0.3.lf.el7