stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Marc Zyngier <maz@kernel.org>
Subject: [PATCH 5.7 6/6] [PATCH] arm64: Workaround circular dependency in pointer_auth.h
Date: Wed,  5 Aug 2020 17:52:33 +0200	[thread overview]
Message-ID: <20200805153507.271067111@linuxfoundation.org> (raw)
In-Reply-To: <20200805153506.978105994@linuxfoundation.org>

From: Marc Zyngier <maz@kernel.org>

With the backport of f227e3ec3b5c ("random32: update the net random
state on interrupt and activity") and its associated fixes, the
arm64 build explodes early:

In file included from ../include/linux/smp.h:67,
                  from ../include/linux/percpu.h:7,
                  from ../include/linux/prandom.h:12,
                  from ../include/linux/random.h:118,
                  from ../arch/arm64/include/asm/pointer_auth.h:6,
                  from ../arch/arm64/include/asm/processor.h:39,
                  from ../include/linux/mutex.h:19,
                  from ../include/linux/kernfs.h:12,
                  from ../include/linux/sysfs.h:16,
                  from ../include/linux/kobject.h:20,
                  from ../include/linux/of.h:17,
                  from ../include/linux/irqdomain.h:35,
                  from ../include/linux/acpi.h:13,
                  from ../include/acpi/apei.h:9,
                  from ../include/acpi/ghes.h:5,
                  from ../include/linux/arm_sdei.h:8,
                  from ../arch/arm64/kernel/asm-offsets.c:10:
../arch/arm64/include/asm/smp.h:100:29: error: field ‘ptrauth_key’ has
incomplete type

This is due to struct ptrauth_keys_kernel not being defined before
we transitively include asm/smp.h from linux/random.h.

Paper over it by moving the inclusion of linux/random.h *after* the
type has been defined.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/arm64/include/asm/pointer_auth.h |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

--- a/arch/arm64/include/asm/pointer_auth.h
+++ b/arch/arm64/include/asm/pointer_auth.h
@@ -3,7 +3,6 @@
 #define __ASM_POINTER_AUTH_H
 
 #include <linux/bitops.h>
-#include <linux/random.h>
 
 #include <asm/cpufeature.h>
 #include <asm/memory.h>
@@ -34,6 +33,13 @@ struct ptrauth_keys_kernel {
 	struct ptrauth_key apia;
 };
 
+/*
+ * Only include random.h once ptrauth_keys_* structures are defined
+ * to avoid yet another circular include hell (random.h * ends up
+ * including asm/smp.h, which requires ptrauth_keys_kernel).
+ */
+#include <linux/random.h>
+
 static inline void ptrauth_keys_init_user(struct ptrauth_keys_user *keys)
 {
 	if (system_supports_address_auth()) {



  parent reply	other threads:[~2020-08-05 20:09 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-05 15:52 [PATCH 5.7 0/6] 5.7.14-rc1 review Greg Kroah-Hartman
2020-08-05 15:52 ` [PATCH 5.7 1/6] random32: update the net random state on interrupt and activity Greg Kroah-Hartman
2020-08-05 15:52 ` [PATCH 5.7 2/6] ARM: percpu.h: fix build error Greg Kroah-Hartman
2020-08-05 15:52 ` [PATCH 5.7 3/6] random: fix circular include dependency on arm64 after addition of percpu.h Greg Kroah-Hartman
2020-08-05 15:52 ` [PATCH 5.7 4/6] random32: remove net_rand_state from the latent entropy gcc plugin Greg Kroah-Hartman
2020-08-05 15:52 ` [PATCH 5.7 5/6] random32: move the pseudo-random 32-bit definitions to prandom.h Greg Kroah-Hartman
2020-08-05 15:52 ` Greg Kroah-Hartman [this message]
2020-08-05 17:39 ` [PATCH 5.7 0/6] 5.7.14-rc1 review Naresh Kamboju
2020-08-05 18:01   ` Linus Torvalds
2020-08-05 18:27     ` Guenter Roeck
2020-08-05 18:24   ` Guenter Roeck
2020-08-05 18:37     ` Linus Torvalds
2020-08-05 19:24       ` Guenter Roeck
2020-08-05 19:45         ` Linus Torvalds
2020-08-05 19:58           ` Greg Kroah-Hartman
2020-08-06  0:09           ` Guenter Roeck
2020-08-05 19:26       ` Daniel Díaz
2020-08-05 19:52 ` Jon Hunter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200805153507.271067111@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).