1
0
Fork 0
alistair23-linux/drivers/s390
Halil Pasic 78b1a52e05 virtio/s390: fix race in ccw_io_helper()
While ccw_io_helper() seems like intended to be exclusive in a sense that
it is supposed to facilitate I/O for at most one thread at any given
time, there is actually nothing ensuring that threads won't pile up at
vcdev->wait_q. If they do, all threads get woken up and see the status
that belongs to some other request than their own. This can lead to bugs.
For an example see:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1788432

This race normally does not cause any problems. The operations provided
by struct virtio_config_ops are usually invoked in a well defined
sequence, normally don't fail, and are normally used quite infrequent
too.

Yet, if some of the these operations are directly triggered via sysfs
attributes, like in the case described by the referenced bug, userspace
is given an opportunity to force races by increasing the frequency of the
given operations.

Let us fix the problem by ensuring, that for each device, we finish
processing the previous request before starting with a new one.

Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
Reported-by: Colin Ian King <colin.king@canonical.com>
Cc: stable@vger.kernel.org
Message-Id: <20180925121309.58524-3-pasic@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2018-12-06 14:22:35 -05:00
..
block s390 updates for the 4.20 merge window 2018-10-23 11:14:47 +01:00
char mm: remove include/linux/bootmem.h 2018-10-31 08:54:16 -07:00
cio s390/cio: Fix cleanup when unsupported IDA format is used 2018-11-13 11:45:17 +01:00
crypto s390/zcrypt: reinit ap queue state machine during device probe 2018-11-27 10:43:35 +01:00
net s390/qeth: fix length check in SNMP processing 2018-11-28 11:16:54 -08:00
scsi s390/dasd,zfcp: fix gcc 8 stringop-truncation warnings 2018-07-02 11:24:52 +02:00
virtio virtio/s390: fix race in ccw_io_helper() 2018-12-06 14:22:35 -05:00
Makefile kbuild: rename built-in.o to built-in.a 2018-03-26 02:01:19 +09:00