Skip to content

Commit 1c9df90

Browse files
wtarreautorvalds
authored andcommitted
random: fix circular include dependency on arm64 after addition of percpu.h
Daniel Díaz and Kees Cook independently reported that commit f227e3e ("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 <[email protected]> Reported-by: Kees Cook <[email protected]> Tested-by: Marc Zyngier <[email protected]> Fixes: f227e3e Cc: Stephen Rothwell <[email protected]> Signed-off-by: Willy Tarreau <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 83bdc72 commit 1c9df90

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/random.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <linux/kernel.h>
1212
#include <linux/list.h>
1313
#include <linux/once.h>
14-
#include <linux/percpu.h>
14+
#include <asm/percpu.h>
1515

1616
#include <uapi/linux/random.h>
1717

0 commit comments

Comments
 (0)