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-next>] [day] [month] [year] [list]
Date:   Tue, 13 Feb 2018 09:34:39 -0800
From:   Stephen Hemminger <stephen@...workplumber.org>
To:     Michael Kelley <mhkelley@...look.com>
Cc:     "mikelley@...rosoft.com" <mikelley@...rosoft.com>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "devel@...uxdriverproject.org" <devel@...uxdriverproject.org>,
        "olaf@...fle.de" <olaf@...fle.de>,
        "apw@...onical.com" <apw@...onical.com>,
        "vkuznets@...hat.com" <vkuznets@...hat.com>,
        "jasowang@...hat.com" <jasowang@...hat.com>,
        "leann.ogasawara@...onical.com" <leann.ogasawara@...onical.com>,
        "marcelo.cerri@...onical.com" <marcelo.cerri@...onical.com>,
        "sthemmin@...rosoft.com" <sthemmin@...rosoft.com>,
        "kys@...rosoft.com" <kys@...rosoft.com>
Subject: Re: [PATCH char-misc 1/1] Drivers: hv: vmbus: Fix ring buffer
 signaling


>  	if (rbi->ring_buffer->feature_bits.feat_pending_send_sz) {
>  		u32 pending_sz = READ_ONCE(rbi->ring_buffer->pending_send_sz);
>  
>  		/*
> +		 * Ensure the read of write_index in hv_get_bytes_to_write()
> +		 * happens after the read of pending_send_sz.
> +		 */
> +		virt_rmb();
> +		curr_write_sz = hv_get_bytes_to_write(rbi);
> +
> +		/*
>  		 * If there was space before we began iteration,
>  		 * then host was not blocked. Also handles case where
>  		 * pending_sz is zero then host has nothing pending
>  		 * and does not need to be signaled.
>  		 */
> -		if (orig_write_sz > pending_sz)
> +		if (curr_write_sz - delta > pending_sz)
>  			return;
>  
>  		/* If pending write will not fit, don't give false hope. */
> -		if (hv_get_bytes_to_write(rbi) < pending_sz)
> +		if (curr_write_sz <= pending_sz)
>  			return;
> +
> +		vmbus_setevent(channel);
>  	}
>  
> -	vmbus_setevent(channel);
>  }

I think this won't work on older versions of Windows where feat_pending_sz
is never set.  On those versions vmbus_setevent needs to always be called.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ