TencentOS-kernel/drivers/s390
Cornelia Huck e3d68499a6 virtio/s390: implement virtio-ccw revision 2 correctly
commit 182f709c5cff683e6732d04c78e328de0532284f upstream.

CCW_CMD_READ_STATUS was introduced with revision 2 of virtio-ccw,
and drivers should only rely on it being implemented when they
negotiated at least that revision with the device.

However, virtio_ccw_get_status() issued READ_STATUS for any
device operating at least at revision 1. If the device accepts
READ_STATUS regardless of the negotiated revision (which some
implementations like QEMU do, even though the spec currently does
not allow it), everything works as intended. While a device
rejecting the command should also be handled gracefully, we will
not be able to see any changes the device makes to the status,
such as setting NEEDS_RESET or setting the status to zero after
a completed reset.

We negotiated the revision to at most 1, as we never bumped the
maximum revision; let's do that now and properly send READ_STATUS
only if we are operating at least at revision 2.

Cc: stable@vger.kernel.org
Fixes: 7d3ce5ab9430 ("virtio/s390: support READ_STATUS command for virtio-ccw")
Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Link: https://lore.kernel.org/r/20210216110645.1087321-1-cohuck@redhat.com
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-12 12:52:40 +08:00
..
block s390/dasd: fix list corruption of lcu list 2021-03-16 16:43:28 +08:00
char Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
cio s390/cio: fix use-after-free in ccw_device_destroy_console 2021-03-16 16:43:10 +08:00
crypto s390/vfio-ap: No need to disable IRQ after queue reset 2021-04-12 12:51:43 +08:00
net s390/qeth: fix L2 header access in qeth_l3_osa_features_check() 2021-04-12 12:51:16 +08:00
scsi scsi: zfcp: Fix use-after-free in request timeout handlers 2021-03-16 16:34:30 +08:00
virtio virtio/s390: implement virtio-ccw revision 2 correctly 2021-04-12 12:52:40 +08:00
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00