virtio/s390: avoid race on vcdev->config
authorHalil Pasic <pasic@linux.ibm.com>
Wed, 26 Sep 2018 16:48:29 +0000 (18:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Dec 2018 08:18:51 +0000 (09:18 +0100)
commit73f6d525be2cded3bd3dd3bcfcfffec548a79e94
tree56ab90ce6c4341f623417c55f4bba8a63ffcd77a
parent01a02e66228b69b497136168716cb1ba2b5ebd73
virtio/s390: avoid race on vcdev->config

commit 2448a299ec416a80f699940a86f4a6d9a4f643b1 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/s390/virtio/virtio_ccw.c