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] [day] [month] [year] [list]
Date:   Sun, 16 Dec 2018 20:50:09 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     David Miller <davem@...emloft.net>
Cc:     Thomas Graf <tgraf@...g.ch>,
        Herbert Xu <herbert@...dor.apana.org.au>,
        NeilBrown <neilb@...e.com>, Tom Herbert <tom@...ntonium.net>,
        Kees Cook <keescook@...omium.org>,
        Paul Blakey <paulb@...lanox.com>,
        Networking <netdev@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] test_rhashtable: remove semaphore usage

On Fri, Dec 14, 2018 at 10:25 PM David Miller <davem@...emloft.net> wrote:
>
> From: Arnd Bergmann <arnd@...db.de>
> Date: Mon, 10 Dec 2018 22:17:20 +0100
>
> > @@ -635,8 +636,9 @@ static int threadfunc(void *data)
> >       int i, step, err = 0, insert_retries = 0;
> >       struct thread_data *tdata = data;
> >
> > -     up(&prestart_sem);
> > -     if (down_interruptible(&startup_sem))
> > +     if (atomic_dec_and_test(&startup_count))
> > +             wake_up(&startup_wait);
> > +     if (wait_event_interruptible(startup_wait, atomic_read(&startup_count) == -1))
> >               pr_err("  thread[%d]: down_interruptible failed\n", tdata->id);
>
> Arnd, please adjust this pr_err() text to match the new code as pointed out by
> Phil Sutter.

Done, and resent as v2. I also noticed that the version I sent did not apply
cleanly on current kernels, so I fixed that, and also added a 'goto out' in
the kthread after printing the error message, so an interrupted thread would
exist straight away.

         Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ