Re: [PATCH 1/1] hv: drivers: vmbus: Prevent load re-ordering when reading ring buffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 29, 2022 at 01:12:33AM +0200, Andrea Parri wrote:
> On Sun, Mar 27, 2022 at 08:25:10AM -0700, Michael Kelley wrote:
> > When reading a packet from a host-to-guest ring buffer, there is no
> > memory barrier between reading the write index (to see if there is
> > a packet to read) and reading the contents of the packet. The Hyper-V
> > host uses store-release when updating the write index to ensure that
> > writes of the packet data are completed first. On the guest side,
> > the processor can reorder and read the packet data before the write
> > index, and sometimes get stale packet data. Getting such stale packet
> > data has been observed in a reproducible case in a VM on ARM64.
> > 
> > Fix this by using virt_load_acquire() to read the write index,
> > ensuring that reads of the packet data cannot be reordered
> > before it. Preventing such reordering is logically correct, and
> > with this change, getting stale data can no longer be reproduced.
> > 
> > Signed-off-by: Michael Kelley <mikelley@xxxxxxxxxxxxx>
> 
> Reviewed-by: Andrea Parri (Microsoft) <parri.andrea@xxxxxxxxx>
> 
> Nit: subject prefix -> "Drivers: hv: vmbus:".

Applied to hyperv-fixes. Thanks.

> 
> Thanks,
>   Andrea



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux