summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2020-07-30 08:59:24 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-08-07 10:34:01 +0300
commit7471f3228e7ad9641a8b2330960d27eb00af0d0f (patch)
tree99a361bde814ea898f878a5eafd95ea09952d153
parent50bf89625bbaf6c29ba66a8b2b6faf80256a2466 (diff)
downloadlinux-7471f3228e7ad9641a8b2330960d27eb00af0d0f.tar.xz
random: fix circular include dependency on arm64 after addition of percpu.h
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>
-rw-r--r--include/linux/random.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/random.h b/include/linux/random.h
index 4d080e5ef6eb..e5d63f875c02 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -9,7 +9,7 @@
#include <linux/list.h>
#include <linux/once.h>
-#include <linux/percpu.h>
+#include <asm/percpu.h>
#include <uapi/linux/random.h>