Re: [PATCH 1/2] virtio/s390: avoid race on vcdev->config

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

 



On Fri, 21 Sep 2018 14:46:20 +0200
Halil Pasic <pasic@xxxxxxxxxxxxx> wrote:

> Currently we have a race on vcdev->config in virtio_ccw_get_config() and
> in virtio_ccw_set_config().
> 
> This normally does not cause problems, as these are usually infrequent
> operations. But occasionally sysfs attributes are directly dependent on
> pieces of virio config and trigger a get on each read. This gives us at
> least one trigger.

I find this paragraph to be a bit confusing. What about the following:

"This normally does not cause problems, as these are usually infrequent
operations. However, writing to the config space may be preceded by a
read, and different threads may perform read/write operations
concurrently, triggered through sysfs attributes."

> 
> Let us protect the shared state using vcdev->lock.
> 
> Signed-off-by: Halil Pasic <pasic@xxxxxxxxxxxxx>
> ---
>  drivers/s390/virtio/virtio_ccw.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux