Skip to contentSkip to conversation

usercopy: ARM NOMMU has no 64-bit get_user

PATCH In review Arnd Bergmann 2 participants 2 messages Feb 21, 2017 – Feb 22, 2017 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usercopy: ARM NOMMU has no 64-bit get_user

On a NOMMU ARM kernel, we get this link error:

ERROR: "__get_user_bad" [lib/test_user_copy.ko] undefined!

The problem is that the extended get_user/put_user definitions were only added for the noral (MMU based) case.

We could add it for NOMMU as well, but it seems easier to just not call it, since no other code needs it.

Fixes 075c4ea5363d ("usercopy: Add tests for all get_user() sizes")
---
 lib/test_user_copy.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/test_user_copy.c +2 -1
index 4a79f2c1cd6e..361576b2cb3d 100644
@@ -30,7 +30,8 @@
  * As there doesn't appear to be anything that can safely determine
  * their capability at compile-time, we just have to opt-out certain archs.
  */
-#if BITS_PER_LONG == 64 || (!defined(CONFIG_AVR32)  &&		\
+#if BITS_PER_LONG == 64 || (!(defined(CONFIG_ARM) && !defined(MMU)) && \
+			    !defined(CONFIG_AVR32)  &&		\
 			    !defined(CONFIG_BLACKFIN) &&	\
 			    !defined(CONFIG_M32R) &&		\
 			    !defined(CONFIG_M68K) &&		\
Signature · 1 line
2.9.0
#1 lore raw
Quoted 4 lines · Arnd Bergmann

On a NOMMU ARM kernel, we get this link error:

ERROR: "__get_user_bad" [lib/test_user_copy.ko] undefined!

Quoted 8 lines

The problem is that the extended get_user/put_user definitions were only added for the noral (MMU based) case.

We could add it for NOMMU as well, but it seems easier to just not call it, since no other code needs it.

Fixes 075c4ea5363d ("usercopy: Add tests for all get_user() sizes")

Ah, excellent, thanks! I'll get this in.

-Kees

Quoted 21 lines
---
 lib/test_user_copy.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/test_user_copy.c +2 -2
index 4a79f2c1cd6e..361576b2cb3d 100644
@@ -30,7 +30,8 @@
  * As there doesn't appear to be anything that can safely determine
  * their capability at compile-time, we just have to opt-out certain archs.
  */
-#if BITS_PER_LONG == 64 || (!defined(CONFIG_AVR32)  &&         \
+#if BITS_PER_LONG == 64 || (!(defined(CONFIG_ARM) && !defined(MMU)) && \
+                           !defined(CONFIG_AVR32)  &&          \
                            !defined(CONFIG_BLACKFIN) &&        \
                            !defined(CONFIG_M32R) &&            \
                            !defined(CONFIG_M68K) &&            \
--

2.9.0

Signature · 2 lines
Kees Cook
Pixel Security