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: <8a0fd059-7acf-3279-10f9-649c19522e2a@oracle.com>
Date:   Sat, 10 Feb 2018 11:57:35 -0500
From:   Boris Ostrovsky <boris.ostrovsky@...cle.com>
To:     Simon Gaiser <simon@...isiblethingslab.com>,
        xen-devel@...ts.xenproject.org
Cc:     Juergen Gross <jgross@...e.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] xen: xenbus: WARN_ON XS_TRANSACTION_{START,END}
 misuse



On 02/07/2018 05:22 PM, Simon Gaiser wrote:
> As the previous commit shows it's quite easy to confuse the transaction
> reference counting by ending a transaction twice. So at least try to
> detect and report it.
> 
> Signed-off-by: Simon Gaiser <simon@...isiblethingslab.com>
> ---
>   drivers/xen/xenbus/xenbus_xs.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c
> index 3e59590c7254..aed954b09b9b 100644
> --- a/drivers/xen/xenbus/xenbus_xs.c
> +++ b/drivers/xen/xenbus/xenbus_xs.c
> @@ -137,11 +137,20 @@ static uint32_t xs_request_enter(struct xb_req_data *req)
>   
>   void xs_request_exit(struct xb_req_data *req)
>   {
> +	unsigned int users_old;
> +
>   	spin_lock(&xs_state_lock);
> +	users_old = xs_state_users;
>   	xs_state_users--;
>   	if ((req->type == XS_TRANSACTION_START && req->msg.type == XS_ERROR) ||
>   	    req->type == XS_TRANSACTION_END)
>   		xs_state_users--;
> +	if (WARN_ON(xs_state_users > users_old))


WARN_ON_ONCE()?

-boris


> +		/*
> +		 * Someone misused XS_TRANSACTION_{START,END}. Reset the
> +		 * reference counter so we might survive.
> +		 */
> +		xs_state_users = 0;
>   	spin_unlock(&xs_state_lock);
>   
>   	if (xs_suspend_active && !xs_state_users)
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ