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:   Wed, 13 Sep 2017 17:59:59 +0200
From:   Andrey Konovalov <andreyknvl@...gle.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Johan Hovold <johan@...nel.org>,
        "Gustavo A . R . Silva" <garsilva@...eddedor.com>,
        Arvind Yadav <arvind.yadav.cs@...il.com>,
        USB list <linux-usb@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>
Cc:     Dmitry Vyukov <dvyukov@...gle.com>,
        Kostya Serebryany <kcc@...gle.com>,
        Andrey Konovalov <andreyknvl@...gle.com>
Subject: Re: [PATCH] uwb: properly check kthread_run return value

On Wed, Sep 13, 2017 at 5:06 PM, Andrey Konovalov <andreyknvl@...gle.com> wrote:
> uwbd_start() calls kthread_run() and checks that the return value is
> not NULL. But the return value is not NULL in case kthread_run() fails,
> it takes the form of ERR_PTR(-EINTR).
>
> Use IS_ERR() instead.

This uncovers another issue, there's no check of rc->uwbd.task in
uwbd_stop(). Will mail v2.

>
> Signed-off-by: Andrey Konovalov <andreyknvl@...gle.com>
> ---
>  drivers/uwb/uwbd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/uwb/uwbd.c b/drivers/uwb/uwbd.c
> index 01c20a260a8b..9f615b303576 100644
> --- a/drivers/uwb/uwbd.c
> +++ b/drivers/uwb/uwbd.c
> @@ -303,7 +303,7 @@ static int uwbd(void *param)
>  void uwbd_start(struct uwb_rc *rc)
>  {
>         rc->uwbd.task = kthread_run(uwbd, rc, "uwbd");
> -       if (rc->uwbd.task == NULL)
> +       if (IS_ERR(rc->uwbd.task))
>                 printk(KERN_ERR "UWB: Cannot start management daemon; "
>                        "UWB won't work\n");
>         else
> --
> 2.14.1.581.gf28d330327-goog
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ