linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usercopy: ARM NOMMU has no 64-bit get_user
@ 2017-02-21 22:01 Arnd Bergmann
  2017-02-22  5:33 ` Kees Cook
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2017-02-21 22:01 UTC (permalink / raw)
  To: Kees Cook, Hoeun Ryu; +Cc: Arnd Bergmann, linux-kernel

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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 lib/test_user_copy.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/test_user_copy.c b/lib/test_user_copy.c
index 4a79f2c1cd6e..361576b2cb3d 100644
--- a/lib/test_user_copy.c
+++ b/lib/test_user_copy.c
@@ -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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] usercopy: ARM NOMMU has no 64-bit get_user
  2017-02-21 22:01 [PATCH] usercopy: ARM NOMMU has no 64-bit get_user Arnd Bergmann
@ 2017-02-22  5:33 ` Kees Cook
  0 siblings, 0 replies; 2+ messages in thread
From: Kees Cook @ 2017-02-22  5:33 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Hoeun Ryu, LKML

On Tue, Feb 21, 2017 at 2:01 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> 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")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

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

-Kees

> ---
>  lib/test_user_copy.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lib/test_user_copy.c b/lib/test_user_copy.c
> index 4a79f2c1cd6e..361576b2cb3d 100644
> --- a/lib/test_user_copy.c
> +++ b/lib/test_user_copy.c
> @@ -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
>



-- 
Kees Cook
Pixel Security

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-22  5:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-21 22:01 [PATCH] usercopy: ARM NOMMU has no 64-bit get_user Arnd Bergmann
2017-02-22  5:33 ` Kees Cook

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).