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]
Message-ID: <e35a7f71-2477-fa52-01e4-301199e99c2e@arm.com>
Date:   Wed, 4 Dec 2019 17:15:26 +0000
From:   Vincenzo Frascino <vincenzo.frascino@....com>
To:     Guenter Roeck <linux@...ck-us.net>
Cc:     linux-arch@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org, linux-mips@...r.kernel.org,
        linux-kselftest@...r.kernel.org,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will.deacon@....com>,
        Arnd Bergmann <arnd@...db.de>,
        Russell King <linux@...linux.org.uk>,
        Ralf Baechle <ralf@...ux-mips.org>,
        Paul Burton <paul.burton@...s.com>,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Mark Salyzyn <salyzyn@...roid.com>,
        Peter Collingbourne <pcc@...gle.com>,
        Shuah Khan <shuah@...nel.org>,
        Dmitry Safonov <0x7f454c46@...il.com>,
        Rasmus Villemoes <linux@...musvillemoes.dk>,
        Huw Davies <huw@...eweavers.com>,
        Shijith Thotton <sthotton@...vell.com>,
        Andre Przywara <andre.przywara@....com>
Subject: Re: [PATCH v7 16/25] arm: Add support for generic vDSO (causing
 crash)

Hi Guenter,

On 12/4/19 4:16 PM, Guenter Roeck wrote:
> On Wed, Dec 04, 2019 at 01:58:25PM +0000, Vincenzo Frascino wrote:
>> Hi Guenter,
>>
>> On 12/4/19 1:51 PM, Guenter Roeck wrote:
>>> On Fri, Jun 21, 2019 at 10:52:43AM +0100, Vincenzo Frascino wrote:
>>>> The arm vDSO library requires some adaptations to use to take advantage
>>>> of the newly introduced generic vDSO library.
>>>>
>>>> Introduce the following changes:
>>>>  - Modification vdso.c to be compliant with the common vdso datapage
>>>>  - Use of lib/vdso for gettimeofday
>>>>  - Implementation of elf note
>>>>
>>>> Cc: Russell King <linux@...linux.org.uk>
>>>> Signed-off-by: Vincenzo Frascino <vincenzo.frascino@....com>
>>>
>>> This patch causes a crash with qemu's mcimx6ul-evk emulation while running
>>> imx_v6_v7_defconfig.
>>>
>>
>> Thank you for reporting this. Could you please provide some details on how I can
>> reproduce the scenario you are describing?
>>
> - Build imx_v6_v7_defconfig
> - Get root file system or initrd, for example from
>   https://github.com/groeck/linux-build-test/tree/master/rootfs/arm
> - Run image. Example, with initrd:
> 	qemu-system-arm -M mcimx6ul-evk -kernel arch/arm/boot/zImage \
> 		-no-reboot -initrd rootfs-armv7a.cpio \
> 		-m 256 -display none -serial null \
> 		--append 'rdinit=/sbin/init earlycon=ec_imx6q,mmio,0x21e8000,115200n8 console=ttymxc1,115200'
> 		-dtb arch/arm/boot/dts/imx6ul-14x14-evk.dtb \
> 		-nographic -monitor null -serial stdio
> 
> qemu has to be v3.1 or later to support the machine.
> 

Thanks for this. Could you please try the patch below the scissors? Seems fixing
the issue for me.

> Hope this helps,
> Guenter
> 

-- 
Regards,
Vincenzo

--->8---

Author: Vincenzo Frascino <vincenzo.frascino@....com>
Date:   Wed Dec 4 16:58:55 2019 +0000

    arm: Fix __arch_get_hw_counter() access to CNTVCT

    __arch_get_hw_counter() should check clock_mode to see if it can access
    CNTVCT. With the conversion to unified vDSO this check has been left out.

    This causes on imx v6 and v7 (imx_v6_v7_defconfig) and other platforms to
    hang at boot during the execution of the init process as per below:

    [   19.976852] Run /sbin/init as init process
    [   20.044931] Kernel panic - not syncing: Attempted to kill init!
    exitcode=0x00000004

    Fix the problem verifying that clock_mode is set coherently before
    accessing CNTVCT.

    Cc: Russell King <linux@...linux.org.uk>
    Reported-by: Guenter Roeck <linux@...ck-us.net>
    Investigated-by: Arnd Bergmann <arnd@...db.de>
    Signed-off-by: Vincenzo Frascino <vincenzo.frascino@....com>

diff --git a/arch/arm/include/asm/vdso/gettimeofday.h
b/arch/arm/include/asm/vdso/gettimeofday.h
index 5b879ae7afc1..0ad2429c324f 100644
--- a/arch/arm/include/asm/vdso/gettimeofday.h
+++ b/arch/arm/include/asm/vdso/gettimeofday.h
@@ -75,6 +75,9 @@ static __always_inline u64 __arch_get_hw_counter(int clock_mode)
 #ifdef CONFIG_ARM_ARCH_TIMER
        u64 cycle_now;

+       if (!clock_mode)
+               return -EINVAL;
+
        isb();
        cycle_now = read_sysreg(CNTVCT);


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ