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: <CAK8P3a0eqbczcNJhNf9hXPBhUoscZD51d9PSs=vwH564u=7XSQ@mail.gmail.com>
Date:   Fri, 31 Jan 2020 17:40:19 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     Anatoly Pugachev <matorola@...il.com>
Cc:     Sparc kernel list <sparclinux@...r.kernel.org>,
        Linux Kernel list <linux-kernel@...r.kernel.org>
Subject: Re: [sparc64] stall on CPU with current git master

On Fri, Jan 31, 2020 at 4:07 PM Anatoly Pugachev <matorola@...il.com> wrote:
>
> Hello!
>
> Current git master branch (at the time of writing
> 5.5.0-07763-gccaaaf6fe5a5 ) started to hang on my sparc64 ldom.
> Bisected "stall on CPU" (which occasionally leads to machine hang) to
> this patch:
>
> $ git bisect bad
> 251ec1c159e4874fbede0c3c586e317e177c0c9b is the first bad commit
> commit 251ec1c159e4874fbede0c3c586e317e177c0c9b
> Author: Arnd Bergmann <arnd@...db.de>
> Date:   Wed Dec 11 21:07:23 2019 +0100
>
>     y2038: sparc: remove use of struct timex
>
>     'struct timex' is one of the last users of 'struct timeval' and is
>     only referenced in one place in the kernel any more, to convert the
>     user space timex into the kernel-internal version on sparc64, with a
>     different tv_usec member type.
>
>     As a preparation for hiding the time_t definition and everything
>     using that in the kernel, change the implementation once more
>     to only convert the timeval member, and then enclose the
>     struct definition in an #ifdef.
>
>     Signed-off-by: Arnd Bergmann <arnd@...db.de>
>
>  arch/sparc/kernel/sys_sparc_64.c | 33 +++++++++++++++++----------------
>  include/uapi/linux/timex.h       |  2 ++
>  2 files changed, 19 insertions(+), 16 deletions(-)
>
> $ git desc 251ec1c159e4874fbede0c3c586e317e177c0c9b
> v5.5-rc1-19-g251ec1c159e4
>
> kernel 5.5.0-rc1-00018-g4f9fbd893fe8 - works perfectly (i.e. does not
> hang or produce "stall on CPU" )
>
> current master with the patch reverted -
> 5.5.0-07763-gccaaaf6fe5a5-dirty - works perfectly
>
> current master 5.5.0-07763-gccaaaf6fe5a5 - stalls, hangs
>
>
> Can someone look what is wrong with it and/or probably revert it ?!
> Thanks.

Thanks for the report, I think I found the problem! Can you try this patch?

      Arnd

diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c
index 34917617f258..6b92fadb6ec7 100644
--- a/arch/sparc/kernel/sys_sparc_64.c
+++ b/arch/sparc/kernel/sys_sparc_64.c
@@ -551,7 +551,7 @@ SYSCALL_DEFINE2(getdomainname, char __user *,
name, int, len)
 SYSCALL_DEFINE1(sparc_adjtimex, struct __kernel_timex __user *, txc_p)
 {
        struct __kernel_timex txc;
-       struct __kernel_old_timeval *tv = (void *)&txc_p->time;
+       struct __kernel_old_timeval *tv = (void *)&txc.time;
        int ret;

        /* Copy the user data space into the kernel copy
@@ -576,7 +576,7 @@ SYSCALL_DEFINE2(sparc_clock_adjtime, const
clockid_t, which_clock,
                struct __kernel_timex __user *, txc_p)
 {
        struct __kernel_timex txc;
-       struct __kernel_old_timeval *tv = (void *)&txc_p->time;
+       struct __kernel_old_timeval *tv = (void *)&txc.time;
        int ret;

        if (!IS_ENABLED(CONFIG_POSIX_TIMERS)) {

View attachment "sparc64-timex-fix.patch" of type "text/x-patch" (891 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ