# git rev-parse -q --verify 1c9df907da83812e4f33b59d3d142c864d9da57f^{commit} 1c9df907da83812e4f33b59d3d142c864d9da57f already have revision, skipping fetch # git checkout -q -f -B kisskb 1c9df907da83812e4f33b59d3d142c864d9da57f # git clean -qxdf # < git log -1 # commit 1c9df907da83812e4f33b59d3d142c864d9da57f # Author: Willy Tarreau # Date: Thu Jul 30 07:59:24 2020 +0200 # # random: fix circular include dependency on arm64 after addition of percpu.h # # 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 remove from the arm64 # that causes the circular dependency. # # But we might as well do the whole belt-and-suspenders thing, and # minimize inclusion in too. Either will fix the # problem, and both are good changes. - Linus ] # # Reported-by: Daniel Díaz # Reported-by: Kees Cook # Tested-by: Marc Zyngier # Fixes: f227e3ec3b5c # Cc: Stephen Rothwell # Signed-off-by: Willy Tarreau # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/korg/gcc-4.9.4-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-gcc --version # < /opt/cross/kisskb/korg/gcc-4.9.4-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-ld --version # < git log --format=%s --max-count=1 1c9df907da83812e4f33b59d3d142c864d9da57f # < make -s -j 80 ARCH=arm O=/kisskb/build/linus_exynos_defconfig_arm-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi- exynos_defconfig # < make -s -j 80 ARCH=arm O=/kisskb/build/linus_exynos_defconfig_arm-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi- help # make -s -j 80 ARCH=arm O=/kisskb/build/linus_exynos_defconfig_arm-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi- olddefconfig # make -s -j 80 ARCH=arm O=/kisskb/build/linus_exynos_defconfig_arm-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi- In file included from /kisskb/src/include/linux/random.h:14:0, from /kisskb/src/arch/arm/kernel/signal.c:8: /kisskb/src/arch/arm/include/asm/percpu.h: In function '__my_cpu_offset': /kisskb/src/arch/arm/include/asm/percpu.h:29:34: error: 'current_stack_pointer' undeclared (first use in this function) : "Q" (*(const unsigned long *)current_stack_pointer)); ^ /kisskb/src/arch/arm/include/asm/percpu.h:29:34: note: each undeclared identifier is reported only once for each function it appears in make[2]: *** [/kisskb/src/scripts/Makefile.build:281: arch/arm/kernel/signal.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [/kisskb/src/Makefile:1756: arch/arm/kernel] Error 2 make[1]: *** Waiting for unfinished jobs.... In file included from /kisskb/src/include/linux/random.h:14:0, from /kisskb/src/include/linux/net.h:18, from /kisskb/src/net/ipv6/ip6_fib.c:20: /kisskb/src/arch/arm/include/asm/percpu.h: In function '__my_cpu_offset': /kisskb/src/arch/arm/include/asm/percpu.h:29:34: error: 'current_stack_pointer' undeclared (first use in this function) : "Q" (*(const unsigned long *)current_stack_pointer)); ^ /kisskb/src/arch/arm/include/asm/percpu.h:29:34: note: each undeclared identifier is reported only once for each function it appears in make[3]: *** [/kisskb/src/scripts/Makefile.build:280: net/ipv6/ip6_fib.o] Error 1 make[3]: *** Waiting for unfinished jobs.... make[2]: *** [/kisskb/src/scripts/Makefile.build:497: net/ipv6] Error 2 make[2]: *** Waiting for unfinished jobs.... In file included from /kisskb/src/include/linux/random.h:14:0, from /kisskb/src/include/crypto/drbg.h:43, from /kisskb/src/crypto/drbg.c:100: /kisskb/src/arch/arm/include/asm/percpu.h: In function '__my_cpu_offset': /kisskb/src/arch/arm/include/asm/percpu.h:29:34: error: 'current_stack_pointer' undeclared (first use in this function) : "Q" (*(const unsigned long *)current_stack_pointer)); ^ /kisskb/src/arch/arm/include/asm/percpu.h:29:34: note: each undeclared identifier is reported only once for each function it appears in make[2]: *** [/kisskb/src/scripts/Makefile.build:281: crypto/drbg.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [/kisskb/src/Makefile:1756: crypto] Error 2 In file included from /kisskb/src/include/linux/random.h:14:0, from /kisskb/src/lib/uuid.c:14: /kisskb/src/arch/arm/include/asm/percpu.h: In function '__my_cpu_offset': /kisskb/src/arch/arm/include/asm/percpu.h:29:34: error: 'current_stack_pointer' undeclared (first use in this function) : "Q" (*(const unsigned long *)current_stack_pointer)); ^ /kisskb/src/arch/arm/include/asm/percpu.h:29:34: note: each undeclared identifier is reported only once for each function it appears in make[2]: *** [/kisskb/src/scripts/Makefile.build:280: lib/uuid.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [/kisskb/src/Makefile:1756: lib] Error 2 make[1]: *** [/kisskb/src/Makefile:1756: net] Error 2 make: *** [Makefile:185: __sub-make] Error 2 Command 'make -s -j 80 ARCH=arm O=/kisskb/build/linus_exynos_defconfig_arm-gcc4.9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-4.9.4-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi- ' returned non-zero exit status 2 # rm -rf /kisskb/build/linus_exynos_defconfig_arm-gcc4.9 # Build took: 0:01:44.994457