lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 14 Nov 2017 17:47:51 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     Deepa Dinamani <deepa.kernel@...il.com>
Cc:     Thomas Gleixner <tglx@...utronix.de>,
        John Stultz <john.stultz@...aro.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        y2038 Mailman List <y2038@...ts.linaro.org>
Subject: Re: [PATCH 2/9] compat: Make compat helpers independent of CONFIG_COMPAT

On Fri, Nov 10, 2017 at 11:42 PM, Deepa Dinamani <deepa.kernel@...il.com> wrote:
> Many of the compat time syscalls are also repurposed as 32 bit
> native syscalls to provide backward compatibility while adding
> new y2038 safe sycalls.
> Enabling the helpers makes this possible.
>
> Signed-off-by: Deepa Dinamani <deepa.kernel@...il.com>

I ran into a build error on ARM64 with CONFIG_COMPAT=n with this patch,
here is a fixup that makes it build cleanly and should also work on other
architectures. Unfortunately, including asm/compat.h has a number of
dependencies on other headers, so I decided to just include them all
for the fixup.

Alternatively, we could change the architecture code to always include
asm/compat.h when using is_compat_thread(), or to replace
is_compat_thread() calls with in_compat_syscall(), but the approach
below should be more likely to work on the 64-bit architectures that I did
not try.

        Arnd

--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -9,8 +9,6 @@
 #include <linux/types.h>
 #include <linux/compat_time.h>

-#ifdef CONFIG_COMPAT
-
 #include <linux/stat.h>
 #include <linux/param.h>       /* for HZ */
 #include <linux/sem.h>
@@ -20,12 +18,12 @@
 #include <linux/aio_abi.h>     /* for aio_context_t */
 #include <linux/unistd.h>

+#ifdef CONFIG_64BIT
 #include <asm/compat.h>
+#endif
 #include <asm/siginfo.h>
 #include <asm/signal.h>

-#endif
-
 #ifndef COMPAT_USE_64BIT_TIME
 #define COMPAT_USE_64BIT_TIME 0
 #endif
@@ -774,7 +772,9 @@ static inline struct compat_timeval
ns_to_compat_timeval(s64 nsec)
 #else /* !CONFIG_COMPAT */

 #define is_compat_task() (0)
+#ifndef in_compat_syscall
 static inline bool in_compat_syscall(void) { return false; }
+#endif

 #endif /* CONFIG_COMPAT */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ