virtio/s390: avoid race on vcdev->config
authorHalil Pasic <pasic@linux.ibm.com>
Wed, 26 Sep 2018 16:48:29 +0000 (18:48 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 6 Dec 2018 19:22:34 +0000 (14:22 -0500)
commit2448a299ec416a80f699940a86f4a6d9a4f643b1
treeb679315127c7e5b490082e9162f58c408f4f06b4
parentc38f57da428b033f2721b611d84b1f40bde674a8
virtio/s390: avoid race on vcdev->config

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. However, for some devices writing to/reading from the config
space can be triggered through sysfs attributes. For these, userspace can
force the race by increasing the frequency.

Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
Cc: stable@vger.kernel.org
Message-Id: <20180925121309.58524-2-pasic@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/s390/virtio/virtio_ccw.c