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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <3B85F0EB-DEB4-478B-8745-B44C991D82F4@goldelico.com>
Date:   Thu, 28 Nov 2019 16:42:01 +0100
From:   "H. Nikolaus Schaller" <hns@...delico.com>
To:     Vincenzo Frascino <vincenzo.frascino@....com>
Cc:     Maarten ter Huurne <maarten@...ewalker.org>,
        MIPS Creator CI20 Development 
        <mips-creator-ci20-dev@...glegroups.com>,
        Ralf Baechle <ralf@...ux-mips.org>,
        Paul Burton <paul.burton@...s.com>, linux-mips@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Discussions about the Letux Kernel 
        <letux-kernel@...nphoenux.org>
Subject: Re: MIPS: bug: gettimeofday syscall broken on CI20 board


> Am 28.11.2019 um 15:01 schrieb Vincenzo Frascino <vincenzo.frascino@....com>:
> 
>>> 
>> 
>> What still does not fit into the picture is the errno = 1 i.e. EPERM.
>> Maybe I have to study the libc code that tries to read the ELF symbols
>> you have mentioned. It may fail for unknown reasons.
>> 
> 
> This is what I was going to suggest next. It might be that something is not
> working there.
> 
> Let us know your findings.

Well, my findings are that the gettimeofday() function in glibc-2.24 (used by
Debian Stretch) is simple:

> #include <errno.h>
> #include <sys/time.h>
> 
> #undef __gettimeofday
> 
> #ifdef HAVE_GETTIMEOFDAY_VSYSCALL
> # define HAVE_VSYSCALL
> #endif
> #include <sysdep-vdso.h>
> 
> /* Get the current time of day and timezone information,
>    putting it into *tv and *tz.  If tz is null, *tz is not filled.
>    Returns 0 on success, -1 on errors.  */
> int
> __gettimeofday (struct timeval *tv, struct timezone *tz)
> {
>   return INLINE_VSYSCALL (gettimeofday, 2, tv, tz);
> }
> libc_hidden_def (__gettimeofday)
> weak_alias (__gettimeofday, gettimeofday)
> libc_hidden_weak (gettimeofday)
> 

but the macro INLINE_VSYSCALL is not immediately understandable.

So I have no idea how to patch the kernel to check why that
sets errno. And patching libc is beyond my range of experience.

It is only clear that your kernel patch did break it for MIPS
(at least for CI20) but for obvious reasons not for ARM.

BTW: kernel v5.4 works with Debian Jessie, i.e. glibc-2.19.
Maybe it triggers a fallback.

BR and thanks,
Nikolaus


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ