]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 2 Aug 2020 06:21:07 +0000 (08:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 2 Aug 2020 06:21:07 +0000 (08:21 +0200)
added patches:
random-fix-circular-include-dependency-on-arm64-after-addition-of-percpu.h.patch

queue-4.4/random-fix-circular-include-dependency-on-arm64-after-addition-of-percpu.h.patch [new file with mode: 0644]
queue-4.4/series

diff --git a/queue-4.4/random-fix-circular-include-dependency-on-arm64-after-addition-of-percpu.h.patch b/queue-4.4/random-fix-circular-include-dependency-on-arm64-after-addition-of-percpu.h.patch
new file mode 100644 (file)
index 0000000..e0f91c8
--- /dev/null
@@ -0,0 +1,58 @@
+From 1c9df907da83812e4f33b59d3d142c864d9da57f Mon Sep 17 00:00:00 2001
+From: Willy Tarreau <w@1wt.eu>
+Date: Thu, 30 Jul 2020 07:59:24 +0200
+Subject: random: fix circular include dependency on arm64 after addition of percpu.h
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Willy Tarreau <w@1wt.eu>
+
+commit 1c9df907da83812e4f33b59d3d142c864d9da57f upstream.
+
+Daniel Díaz and Kees Cook independently reported that commit
+f227e3ec3b5c ("random32: update the net random state on interrupt and
+activity") broke arm64 due to a circular dependency on include files
+since the addition of percpu.h in random.h.
+
+The correct fix would definitely be to move all the prandom32 stuff out
+of random.h but for backporting, a smaller solution is preferred.
+
+This one replaces linux/percpu.h with asm/percpu.h, and this fixes the
+problem on x86_64, arm64, arm, and mips.  Note that moving percpu.h
+around didn't change anything and that removing it entirely broke
+differently.  When backporting, such options might still be considered
+if this patch fails to help.
+
+[ It turns out that an alternate fix seems to be to just remove the
+  troublesome <asm/pointer_auth.h> remove from the arm64 <asm/smp.h>
+  that causes the circular dependency.
+
+  But we might as well do the whole belt-and-suspenders thing, and
+  minimize inclusion in <linux/random.h> too. Either will fix the
+  problem, and both are good changes.   - Linus ]
+
+Reported-by: Daniel Díaz <daniel.diaz@linaro.org>
+Reported-by: Kees Cook <keescook@chromium.org>
+Tested-by: Marc Zyngier <maz@kernel.org>
+Fixes: f227e3ec3b5c
+Cc: Stephen Rothwell <sfr@canb.auug.org.au>
+Signed-off-by: Willy Tarreau <w@1wt.eu>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/linux/random.h |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/include/linux/random.h
++++ b/include/linux/random.h
+@@ -8,7 +8,7 @@
+ #include <linux/list.h>
+ #include <linux/once.h>
+-#include <linux/percpu.h>
++#include <asm/percpu.h>
+ #include <uapi/linux/random.h>
index e2240b7f1951bca4c0fe11547b7ce4019e80e57a..5b6b7a227d36e431335f7f504249c0dfb4082fca 100644 (file)
@@ -12,3 +12,4 @@ drm-hold-gem-reference-until-object-is-no-longer-accessed.patch
 arm-percpu.h-fix-build-error.patch
 f2fs-check-memory-boundary-by-insane-namelen.patch
 f2fs-check-if-file-namelen-exceeds-max-value.patch
+random-fix-circular-include-dependency-on-arm64-after-addition-of-percpu.h.patch