Skip to contentSkip to conversation

kfence: fix implicit function declaration

PATCH In review Anders Roxell 4 participants 4 messages Dec 4, 2020 – Jan 25, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kfence: fix implicit function declaration

When building kfence the following error shows up:

In file included from mm/kfence/report.c:13:
arch/arm64/include/asm/kfence.h: In function ‘kfence_protect_page’:
arch/arm64/include/asm/kfence.h:12:2: error: implicit declaration of function ‘set_memory_valid’ [-Werror=implicit-function-declaration]

   12 |  set_memory_valid(addr, 1, !protect);
      |  ^~~~~~~~~~~~~~~~

Use the correct include both
f2b7c491916d ("set_memory: allow querying whether set_direct_map_*() is actually enabled") and 4c4c75881536 ("arm64, kfence: enable KFENCE for ARM64") went in the same day via different trees.

---

I got this build error in todays next-20201204.
Andrew, since both patches are in your -mm tree, I think this can be folded into 4c4c75881536 ("arm64, kfence: enable KFENCE for ARM64")

 arch/arm64/include/asm/kfence.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/include/asm/kfence.h +1 -1
index 6c0afeeab635..c44bb368a810 100644
@@ -3,7 +3,7 @@
 #ifndef __ASM_KFENCE_H
 #define __ASM_KFENCE_H
 
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 
 static inline bool arch_kfence_init_pool(void) { return true; }
 
Signature · 1 line
2.29.2
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Anders Roxell

When building kfence the following error shows up:

In file included from mm/kfence/report.c:13:
arch/arm64/include/asm/kfence.h: In function ‘kfence_protect_page’:
arch/arm64/include/asm/kfence.h:12:2: error: implicit declaration of function ‘set_memory_valid’ [-Werror=implicit-function-declaration]

   12 |  set_memory_valid(addr, 1, !protect);
      |  ^~~~~~~~~~~~~~~~
Quoted 6 lines

Use the correct include both
f2b7c491916d ("set_memory: allow querying whether set_direct_map_*() is actually enabled") and 4c4c75881536 ("arm64, kfence: enable KFENCE for ARM64") went in the same day via different trees.

Thanks!

Quoted 25 lines

---

I got this build error in todays next-20201204.
Andrew, since both patches are in your -mm tree, I think this can be folded into 4c4c75881536 ("arm64, kfence: enable KFENCE for ARM64")

 arch/arm64/include/asm/kfence.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/include/asm/kfence.h +1 -2
index 6c0afeeab635..c44bb368a810 100644
@@ -3,7 +3,7 @@
 #ifndef __ASM_KFENCE_H
 #define __ASM_KFENCE_H
 
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 
 static inline bool arch_kfence_init_pool(void) { return true; }
 
--

2.29.2

Signature · 10 lines
Alexander Potapenko
Software Engineer

Google Germany GmbH
Erika-Mann-Straße, 33
80636 München

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
maintainer
#2 lore raw
In reply to Anders Roxell
Quoted 11 lines · Anders Roxell

When building kfence the following error shows up:

In file included from mm/kfence/report.c:13:
arch/arm64/include/asm/kfence.h: In function ‘kfence_protect_page’:
arch/arm64/include/asm/kfence.h:12:2: error: implicit declaration of function ‘set_memory_valid’ [-Werror=implicit-function-declaration]

   12 |  set_memory_valid(addr, 1, !protect);
      |  ^~~~~~~~~~~~~~~~

Use the correct include both
f2b7c491916d ("set_memory: allow querying whether set_direct_map_*() is actually enabled") and 4c4c75881536 ("arm64, kfence: enable KFENCE for ARM64") went in the

Note that -mm does not have stable commit hashes.

Quoted 4 lines

same day via different trees.

---

Ack, we need this patch somewhere but we should probably fix the patch that does the move, otherwise we'll have a build-broken kernel still.

Quoted 3 lines

I got this build error in todays next-20201204.
Andrew, since both patches are in your -mm tree, I think this can be folded into 4c4c75881536 ("arm64, kfence: enable KFENCE for ARM64")

I don't think that's the right way around. This would result in a build-broken commit point as well.

Looking at current -next, I see that "set_memory: allow querying whether set_direct_map_*() is actually enabled" is after "arm64, kfence: enable KFENCE for ARM64".

I think the patch that introduces set_memory.h for arm64 simply needs to squash in this patch (assuming the order is retained as-is in -mm).

Thanks,
-- Marco

Quoted 16 lines
 arch/arm64/include/asm/kfence.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/include/asm/kfence.h +1 -1
index 6c0afeeab635..c44bb368a810 100644
@@ -3,7 +3,7 @@
 #ifndef __ASM_KFENCE_H
 #define __ASM_KFENCE_H
 
-#include <asm/cacheflush.h>
+#include <asm/set_memory.h>
 
 static inline bool arch_kfence_init_pool(void) { return true; }
 
#3 lore raw
Quoted 30 lines · On Fri, 4 Dec 2020 13:38:25 +0100 Marco Elver <[email protected]> wrote:
Quoted 11 lines · Anders Roxell

When building kfence the following error shows up:

In file included from mm/kfence/report.c:13:
arch/arm64/include/asm/kfence.h: In function ‘kfence_protect_page’:
arch/arm64/include/asm/kfence.h:12:2: error: implicit declaration of function ‘set_memory_valid’ [-Werror=implicit-function-declaration]

   12 |  set_memory_valid(addr, 1, !protect);
      |  ^~~~~~~~~~~~~~~~

Use the correct include both
f2b7c491916d ("set_memory: allow querying whether set_direct_map_*() is actually enabled") and 4c4c75881536 ("arm64, kfence: enable KFENCE for ARM64") went in the

Note that -mm does not have stable commit hashes.

Quoted 4 lines

same day via different trees.

---

Ack, we need this patch somewhere but we should probably fix the patch that does the move, otherwise we'll have a build-broken kernel still.

Quoted 3 lines

I got this build error in todays next-20201204.
Andrew, since both patches are in your -mm tree, I think this can be folded into 4c4c75881536 ("arm64, kfence: enable KFENCE for ARM64")

I don't think that's the right way around. This would result in a build-broken commit point as well.

Quoted 7 lines

Looking at current -next, I see that "set_memory: allow querying whether set_direct_map_*() is actually enabled" is after "arm64, kfence: enable KFENCE for ARM64".

I think the patch that introduces set_memory.h for arm64 simply needs to squash in this patch (assuming the order is retained as-is in -mm).

OK, I requeued this patch as set_memory-allow-querying-whether-set_direct_map_-is-actually-enabled-fix.patch, part of Mike's secretmem patch series.

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel