OSDN Git Service

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:21:36 +0000 (09:21 +0100)
commite2ae7fd4c18b7fe0640cbf721afd3ca937f5ce09
treeee689fd289f1e1c30ac74676e57cdda3c7971937
parent92c01d8f4ae879b9e5dac1a3e490f2e2bebf3b00
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