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:   Fri, 21 Feb 2020 15:56:09 +0000
From:   Vincenzo Frascino <vincenzo.frascino@....com>
To:     Marc Zyngier <maz@...nel.org>
Cc:     linux-arch@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org, catalin.marinas@....com,
        will.deacon@....com, linux@...linux.org.uk, luto@...nel.org,
        tglx@...utronix.de, m.szyprowski@...sung.com, mark.rutland@....com
Subject: Re: [PATCH] clocksource: Fix arm_arch_timer clockmode when vDSO
 disabled

Hi Marc,

On 21/02/2020 15:28, Marc Zyngier wrote:

[...]

> 
> This isn't what I'm saying. What I'm suggesting here is that there is
> possibly a missing indirection, which defaults to ARCH_TIMER when the
> VDSO is selected, and NONE when it isn't.
> 
> Overloading a known symbol feels like papering over the issue.
> 
> Ideally, this default symbol would be provided by asm/clocksource.h, but
> that may not even be the right thing to do.
> 

I must admit I really like this idea :), how about:

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 03bbfc312fe7..97864aabc2a6 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -3,6 +3,7 @@ config ARM
        bool
        default y
        select ARCH_32BIT_OFF_T
+       select ARCH_CLOCKSOURCE_DATA
        select ARCH_HAS_BINFMT_FLAT
        select ARCH_HAS_DEBUG_VIRTUAL if MMU
        select ARCH_HAS_DEVMEM_IS_ALLOWED
diff --git a/arch/arm/include/asm/clocksource.h b/arch/arm/include/asm/clocksource.h
index 73beb7f131de..e37f6d74ba49 100644
--- a/arch/arm/include/asm/clocksource.h
+++ b/arch/arm/include/asm/clocksource.h
@@ -1,7 +1,18 @@
 #ifndef _ASM_CLOCKSOURCE_H
 #define _ASM_CLOCKSOURCE_H

+/*
+ * Unused required for compilation only
+ */
+struct arch_clocksource_data {
+       bool __reserved;
+};
+
+#ifdef CONFIG_GENERIC_GETTIMEOFDAY
 #define VDSO_ARCH_CLOCKMODES   \
        VDSO_CLOCKMODE_ARCHTIMER
+#else
+#define VDSO_CLOCKMODE_ARCHTIMER       VDSO_CLOCKMODE_NONE
+#endif

 #endif


[...]

> 
> Fair enough. But don't override the symbol locally. Create a new one:
> 

I see what you mean now, you mean to not overload the semantical meaning of the
symbol. The symbol (VDSO_CLOCKMODE_ARCHTIMER) at this point is never defined
when VDSO=n, but I agree with you it can cause confusion.

-- 
Regards,
Vincenzo

Download attachment "pEpkey.asc" of type "application/pgp-keys" (14072 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ