From: Greg Kroah-Hartman Date: Sun, 2 Aug 2020 06:21:52 +0000 (+0200) Subject: 4.19-stable patches X-Git-Tag: v5.7.13~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=26e5251c959c1c177a2d2d62a5b604444ac667fa;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: random-fix-circular-include-dependency-on-arm64-after-addition-of-percpu.h.patch random32-remove-net_rand_state-from-the-latent-entropy-gcc-plugin.patch --- diff --git a/queue-4.19/random-fix-circular-include-dependency-on-arm64-after-addition-of-percpu.h.patch b/queue-4.19/random-fix-circular-include-dependency-on-arm64-after-addition-of-percpu.h.patch new file mode 100644 index 00000000000..efe3af7d26c --- /dev/null +++ b/queue-4.19/random-fix-circular-include-dependency-on-arm64-after-addition-of-percpu.h.patch @@ -0,0 +1,58 @@ +From 1c9df907da83812e4f33b59d3d142c864d9da57f Mon Sep 17 00:00:00 2001 +From: Willy Tarreau +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 + +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 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 +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/random.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/include/linux/random.h ++++ b/include/linux/random.h +@@ -9,7 +9,7 @@ + + #include + #include +-#include ++#include + + #include + diff --git a/queue-4.19/random32-remove-net_rand_state-from-the-latent-entropy-gcc-plugin.patch b/queue-4.19/random32-remove-net_rand_state-from-the-latent-entropy-gcc-plugin.patch new file mode 100644 index 00000000000..277336fee8d --- /dev/null +++ b/queue-4.19/random32-remove-net_rand_state-from-the-latent-entropy-gcc-plugin.patch @@ -0,0 +1,52 @@ +From 83bdc7275e6206f560d247be856bceba3e1ed8f2 Mon Sep 17 00:00:00 2001 +From: Linus Torvalds +Date: Wed, 29 Jul 2020 19:11:00 -0700 +Subject: random32: remove net_rand_state from the latent entropy gcc plugin + +From: Linus Torvalds + +commit 83bdc7275e6206f560d247be856bceba3e1ed8f2 upstream. + +It turns out that the plugin right now ends up being really unhappy +about the change from 'static' to 'extern' storage that happened in +commit f227e3ec3b5c ("random32: update the net random state on interrupt +and activity"). + +This is probably a trivial fix for the latent_entropy plugin, but for +now, just remove net_rand_state from the list of things the plugin +worries about. + +Reported-by: Stephen Rothwell +Cc: Emese Revfy +Cc: Kees Cook +Cc: Willy Tarreau +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/random.h | 2 +- + lib/random32.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/include/linux/random.h ++++ b/include/linux/random.h +@@ -116,7 +116,7 @@ struct rnd_state { + __u32 s1, s2, s3, s4; + }; + +-DECLARE_PER_CPU(struct rnd_state, net_rand_state) __latent_entropy; ++DECLARE_PER_CPU(struct rnd_state, net_rand_state); + + u32 prandom_u32_state(struct rnd_state *state); + void prandom_bytes_state(struct rnd_state *state, void *buf, size_t nbytes); +--- a/lib/random32.c ++++ b/lib/random32.c +@@ -48,7 +48,7 @@ static inline void prandom_state_selftes + } + #endif + +-DEFINE_PER_CPU(struct rnd_state, net_rand_state) __latent_entropy; ++DEFINE_PER_CPU(struct rnd_state, net_rand_state); + + /** + * prandom_u32_state - seeded pseudo-random number generator. diff --git a/queue-4.19/series b/queue-4.19/series index a74bddefb2c..28b4f8ff6e0 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -18,3 +18,5 @@ arm-percpu.h-fix-build-error.patch revert-drm-amdgpu-fix-null-dereference-in-dpm-sysfs-handlers.patch drm-amdgpu-prevent-kernel-infoleak-in-amdgpu_info_ioctl.patch drm-hold-gem-reference-until-object-is-no-longer-accessed.patch +random-fix-circular-include-dependency-on-arm64-after-addition-of-percpu.h.patch +random32-remove-net_rand_state-from-the-latent-entropy-gcc-plugin.patch