]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.18-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Jun 2022 10:17:58 +0000 (12:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Jun 2022 10:17:58 +0000 (12:17 +0200)
added patches:
virtio-pci-remove-wrong-address-verification-in-vp_del_vqs.patch

queue-5.18/series
queue-5.18/virtio-pci-remove-wrong-address-verification-in-vp_del_vqs.patch [new file with mode: 0644]

index 94cdcea1548a3687603b4cf4af79a1727f5c12d6..68e09def36919687cca2c6fdf9f69016a3eaffa1 100644 (file)
@@ -130,3 +130,4 @@ ext4-make-variable-count-signed.patch
 ext4-add-reserved-gdt-blocks-check.patch
 kvm-arm64-always-start-with-clearing-sve-flag-on-load.patch
 kvm-arm64-don-t-read-a-hw-interrupt-pending-state-in-user-context.patch
+virtio-pci-remove-wrong-address-verification-in-vp_del_vqs.patch
diff --git a/queue-5.18/virtio-pci-remove-wrong-address-verification-in-vp_del_vqs.patch b/queue-5.18/virtio-pci-remove-wrong-address-verification-in-vp_del_vqs.patch
new file mode 100644 (file)
index 0000000..fe4b621
--- /dev/null
@@ -0,0 +1,52 @@
+From 7e415282b41bf0d15c6e0fe268f822d9b083f2f7 Mon Sep 17 00:00:00 2001
+From: Murilo Opsfelder Araujo <muriloo@linux.ibm.com>
+Date: Thu, 14 Apr 2022 23:30:02 -0300
+Subject: virtio-pci: Remove wrong address verification in vp_del_vqs()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Murilo Opsfelder Araujo <muriloo@linux.ibm.com>
+
+commit 7e415282b41bf0d15c6e0fe268f822d9b083f2f7 upstream.
+
+GCC 12 enhanced -Waddress when comparing array address to null [0],
+which warns:
+
+    drivers/virtio/virtio_pci_common.c: In function ‘vp_del_vqs’:
+    drivers/virtio/virtio_pci_common.c:257:29: warning: the comparison will always evaluate as ‘true’ for the pointer operand in ‘vp_dev->msix_affinity_masks + (sizetype)((long unsigned int)i * 256)’ must not be NULL [-Waddress]
+      257 |                         if (vp_dev->msix_affinity_masks[i])
+          |                             ^~~~~~
+
+In fact, the verification is comparing the result of a pointer
+arithmetic, the address "msix_affinity_masks + i", which will always
+evaluate to true.
+
+Under the hood, free_cpumask_var() calls kfree(), which is safe to pass
+NULL, not requiring non-null verification.  So remove the verification
+to make compiler happy (happy compiler, happy life).
+
+[0] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102103
+
+Signed-off-by: Murilo Opsfelder Araujo <muriloo@linux.ibm.com>
+Message-Id: <20220415023002.49805-1-muriloo@linux.ibm.com>
+Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
+Acked-by: Christophe de Dinechin <dinechin@redhat.com>
+Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/virtio/virtio_pci_common.c |    3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/drivers/virtio/virtio_pci_common.c
++++ b/drivers/virtio/virtio_pci_common.c
+@@ -254,8 +254,7 @@ void vp_del_vqs(struct virtio_device *vd
+       if (vp_dev->msix_affinity_masks) {
+               for (i = 0; i < vp_dev->msix_vectors; i++)
+-                      if (vp_dev->msix_affinity_masks[i])
+-                              free_cpumask_var(vp_dev->msix_affinity_masks[i]);
++                      free_cpumask_var(vp_dev->msix_affinity_masks[i]);
+       }
+       if (vp_dev->msix_enabled) {