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]
Date:   Fri, 28 Jul 2017 11:14:59 -0400
From:   Boris Ostrovsky <boris.ostrovsky@...cle.com>
To:     Juergen Gross <jgross@...e.com>, linux-kernel@...r.kernel.org,
        xen-devel@...ts.xenproject.org
Subject: Re: [PATCH] xen: avoid deadlock in xenbus

On 07/28/2017 10:53 AM, Juergen Gross wrote:
> When starting the xenwatch thread a theoretical deadlock situation is
> possible:
>
> xs_init() contains:
>
>     task = kthread_run(xenwatch_thread, NULL, "xenwatch");
>     if (IS_ERR(task))
>         return PTR_ERR(task);
>     xenwatch_pid = task->pid;
>
> And xenwatch_thread() does:
>
>     mutex_lock(&xenwatch_mutex);
>     ...
>     event->handle->callback();
>     ...
>     mutex_unlock(&xenwatch_mutex);
>
> The callback could call unregister_xenbus_watch() which does:
>
>     ...
>     if (current->pid != xenwatch_pid)
>         mutex_lock(&xenwatch_mutex);
>     ...
>
> In case a watch is firing before xenwatch_pid could be set and the
> callback of that watch unregisters a watch, then a self-deadlock would
> occur.
>
> Avoid this by setting xenwatch_pid in xenwatch_thread().
>
> Signed-off-by: Juergen Gross <jgross@...e.com>

Reviewed-by: Boris Ostrovsky <boris.ostrovsky@...cle.com>

+stable?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ