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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20231128-arm64-vdso32-missing-prototypes-error-v1-1-0fdd403cea07@kernel.org>
Date:   Tue, 28 Nov 2023 09:52:48 -0700
From:   Nathan Chancellor <nathan@...nel.org>
To:     arnd@...db.de, catalin.marinas@....com, will@...nel.org
Cc:     vincenzo.frascino@....com, nathan@...nel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Naresh Kamboju <naresh.kamboju@...aro.org>,
        Mark Brown <broonie@...nel.org>
Subject: [PATCH] arm64: vdso32: Define BUILD_VDSO32_64 to correct
 prototypes

After commit 42874e4eb35b ("arch: vdso: consolidate gettime
prototypes"), there are a couple of errors when building the 32-bit
compat vDSO for arm64:

  arch/arm64/kernel/vdso32/vgettimeofday.c:10:5: error: conflicting types for '__vdso_clock_gettime'; have 'int(clockid_t,  struct old_timespec32 *)' {aka 'int(int,  struct old_timespec32 *)'}
     10 | int __vdso_clock_gettime(clockid_t clock,
        |     ^~~~~~~~~~~~~~~~~~~~
  In file included from arch/arm64/kernel/vdso32/vgettimeofday.c:8:
  include/vdso/gettime.h:16:5: note: previous declaration of '__vdso_clock_gettime' with type 'int(clockid_t,  struct __kernel_timespec *)' {aka 'int(int,  struct __kernel_timespec *)'}
     16 | int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts);
        |     ^~~~~~~~~~~~~~~~~~~~
  arch/arm64/kernel/vdso32/vgettimeofday.c:28:5: error: conflicting types for '__vdso_clock_getres'; have 'int(clockid_t,  struct old_timespec32 *)' {aka 'int(int,  struct old_timespec32 *)'}
     28 | int __vdso_clock_getres(clockid_t clock_id,
        |     ^~~~~~~~~~~~~~~~~~~
  include/vdso/gettime.h:15:5: note: previous declaration of '__vdso_clock_getres' with type 'int(clockid_t,  struct __kernel_timespec *)' {aka 'int(int,  struct __kernel_timespec *)'}
     15 | int __vdso_clock_getres(clockid_t clock, struct __kernel_timespec *res);
        |     ^~~~~~~~~~~~~~~~~~~

The type of the second parameter in __vdso_clock_getres() and
__vdso_clock_gettime() changes based on whether compiling for 32-bit vs.
64-bit, which is controlled by CONFIG_64BIT or the preprocessor macro
BUILD_VDSO32_64, which denotes a 32-bit vDSO is being built for a 64-bit
architecture. Since this situation is the latter case, define
BUILD_VDSO32_64 before the inclusion of include/vdso/gettime.h to clear
up the warning

Fixes: 42874e4eb35b ("arch: vdso: consolidate gettime prototypes")
Reported-by: Naresh Kamboju <naresh.kamboju@...aro.org>
Closes: https://lore.kernel.org/CA+G9fYtV6X=c3JVTTAX89_=wc+uqLpzggnsbGSx-98m_5yd5yw@mail.gmail.com/
Reported-by: Mark Brown <broonie@...nel.org>
Closes: https://lore.kernel.org/ZWCRWArzbTYUjvon@finisterre.sirena.org.uk/
Signed-off-by: Nathan Chancellor <nathan@...nel.org>
---
 arch/arm64/kernel/vdso32/vgettimeofday.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/kernel/vdso32/vgettimeofday.c b/arch/arm64/kernel/vdso32/vgettimeofday.c
index e23c7f4ef26b..29b4d8f61e39 100644
--- a/arch/arm64/kernel/vdso32/vgettimeofday.c
+++ b/arch/arm64/kernel/vdso32/vgettimeofday.c
@@ -5,6 +5,7 @@
  * Copyright (C) 2018 ARM Limited
  *
  */
+#define BUILD_VDSO32_64
 #include <vdso/gettime.h>
 
 int __vdso_clock_gettime(clockid_t clock,

---
base-commit: ca8e45c8048a2c9503c74751d25414601f730580
change-id: 20231128-arm64-vdso32-missing-prototypes-error-e0d30a1ce52f

Best regards,
-- 
Nathan Chancellor <nathan@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ