]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jun 2020 18:20:34 +0000 (20:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jun 2020 18:20:34 +0000 (20:20 +0200)
added patches:
drm-amdgpu-replace-invalid-device-id-with-a-valid-device-id.patch
drm-dp_mst-reformat-drm_dp_check_act_status-a-bit.patch
drm-qxl-use-correct-notify-port-address-when-creating-cursor-ring.patch
selinux-fix-double-free.patch

queue-5.4/drm-amdgpu-replace-invalid-device-id-with-a-valid-device-id.patch [new file with mode: 0644]
queue-5.4/drm-dp_mst-reformat-drm_dp_check_act_status-a-bit.patch [new file with mode: 0644]
queue-5.4/drm-qxl-use-correct-notify-port-address-when-creating-cursor-ring.patch [new file with mode: 0644]
queue-5.4/selinux-fix-double-free.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/drm-amdgpu-replace-invalid-device-id-with-a-valid-device-id.patch b/queue-5.4/drm-amdgpu-replace-invalid-device-id-with-a-valid-device-id.patch
new file mode 100644 (file)
index 0000000..ea5c05f
--- /dev/null
@@ -0,0 +1,37 @@
+From 790243d3bf78f9830a3b2ffbca1ed0f528295d48 Mon Sep 17 00:00:00 2001
+From: Sandeep Raghuraman <sandy.8925@gmail.com>
+Date: Thu, 11 Jun 2020 01:36:26 +0530
+Subject: drm/amdgpu: Replace invalid device ID with a valid device ID
+
+From: Sandeep Raghuraman <sandy.8925@gmail.com>
+
+commit 790243d3bf78f9830a3b2ffbca1ed0f528295d48 upstream.
+
+Initializes Powertune data for a specific Hawaii card by fixing what
+looks like a typo in the code. The device ID 66B1 is not a supported
+device ID for this driver, and is not mentioned elsewhere. 67B1 is a
+valid device ID, and is a Hawaii Pro GPU.
+
+I have tested on my R9 390 which has device ID 67B1, and it works
+fine without problems.
+
+Signed-off-by: Sandeep Raghuraman <sandy.8925@gmail.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c
++++ b/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c
+@@ -239,7 +239,7 @@ static void ci_initialize_power_tune_def
+       switch (dev_id) {
+       case 0x67BA:
+-      case 0x66B1:
++      case 0x67B1:
+               smu_data->power_tune_defaults = &defaults_hawaii_pro;
+               break;
+       case 0x67B8:
diff --git a/queue-5.4/drm-dp_mst-reformat-drm_dp_check_act_status-a-bit.patch b/queue-5.4/drm-dp_mst-reformat-drm_dp_check_act_status-a-bit.patch
new file mode 100644 (file)
index 0000000..62a1d38
--- /dev/null
@@ -0,0 +1,72 @@
+From a5cb5fa6c3a5c2cf492db667b8670ee7b044b79f Mon Sep 17 00:00:00 2001
+From: Lyude Paul <lyude@redhat.com>
+Date: Fri, 3 Apr 2020 14:08:32 -0400
+Subject: drm/dp_mst: Reformat drm_dp_check_act_status() a bit
+
+From: Lyude Paul <lyude@redhat.com>
+
+commit a5cb5fa6c3a5c2cf492db667b8670ee7b044b79f upstream.
+
+Just add a bit more line wrapping, get rid of some extraneous
+whitespace, remove an unneeded goto label, and move around some variable
+declarations. No functional changes here.
+
+Signed-off-by: Lyude Paul <lyude@redhat.com>
+[this isn't a fix, but it's needed for the fix that comes after this]
+Fixes: ad7f8a1f9ced ("drm/helper: add Displayport multi-stream helper (v0.6)")
+Cc: Sean Paul <sean@poorly.run>
+Cc: <stable@vger.kernel.org> # v3.17+
+Reviewed-by: Sean Paul <sean@poorly.run>
+Link: https://patchwork.freedesktop.org/patch/msgid/20200406221253.1307209-3-lyude@redhat.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/drm_dp_mst_topology.c |   22 ++++++++++------------
+ 1 file changed, 10 insertions(+), 12 deletions(-)
+
+--- a/drivers/gpu/drm/drm_dp_mst_topology.c
++++ b/drivers/gpu/drm/drm_dp_mst_topology.c
+@@ -3507,33 +3507,31 @@ fail:
+  */
+ int drm_dp_check_act_status(struct drm_dp_mst_topology_mgr *mgr)
+ {
++      int count = 0, ret;
+       u8 status;
+-      int ret;
+-      int count = 0;
+       do {
+-              ret = drm_dp_dpcd_readb(mgr->aux, DP_PAYLOAD_TABLE_UPDATE_STATUS, &status);
+-
++              ret = drm_dp_dpcd_readb(mgr->aux,
++                                      DP_PAYLOAD_TABLE_UPDATE_STATUS,
++                                      &status);
+               if (ret < 0) {
+-                      DRM_DEBUG_KMS("failed to read payload table status %d\n", ret);
+-                      goto fail;
++                      DRM_DEBUG_KMS("failed to read payload table status %d\n",
++                                    ret);
++                      return ret;
+               }
+               if (status & DP_PAYLOAD_ACT_HANDLED)
+                       break;
+               count++;
+               udelay(100);
+-
+       } while (count < 30);
+       if (!(status & DP_PAYLOAD_ACT_HANDLED)) {
+-              DRM_DEBUG_KMS("failed to get ACT bit %d after %d retries\n", status, count);
+-              ret = -EINVAL;
+-              goto fail;
++              DRM_DEBUG_KMS("failed to get ACT bit %d after %d retries\n",
++                            status, count);
++              return -EINVAL;
+       }
+       return 0;
+-fail:
+-      return ret;
+ }
+ EXPORT_SYMBOL(drm_dp_check_act_status);
diff --git a/queue-5.4/drm-qxl-use-correct-notify-port-address-when-creating-cursor-ring.patch b/queue-5.4/drm-qxl-use-correct-notify-port-address-when-creating-cursor-ring.patch
new file mode 100644 (file)
index 0000000..f9f80c2
--- /dev/null
@@ -0,0 +1,40 @@
+From 80e5f89da3ab949fbbf1cae01dfaea29f5483a75 Mon Sep 17 00:00:00 2001
+From: Huacai Chen <chenhc@lemote.com>
+Date: Tue, 31 Mar 2020 14:18:08 +0800
+Subject: drm/qxl: Use correct notify port address when creating cursor ring
+
+From: Huacai Chen <chenhc@lemote.com>
+
+commit 80e5f89da3ab949fbbf1cae01dfaea29f5483a75 upstream.
+
+The command ring and cursor ring use different notify port addresses
+definition: QXL_IO_NOTIFY_CMD and QXL_IO_NOTIFY_CURSOR. However, in
+qxl_device_init() we use QXL_IO_NOTIFY_CMD to create both command ring
+and cursor ring. This doesn't cause any problems now, because QEMU's
+behaviors on QXL_IO_NOTIFY_CMD and QXL_IO_NOTIFY_CURSOR are the same.
+However, QEMU's behavior may be change in future, so let's fix it.
+
+P.S.: In the X.org QXL driver, the notify port address of cursor ring
+      is correct.
+
+Signed-off-by: Huacai Chen <chenhc@lemote.com>
+Cc: <stable@vger.kernel.org>
+Link: http://patchwork.freedesktop.org/patch/msgid/1585635488-17507-1-git-send-email-chenhc@lemote.com
+Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/qxl/qxl_kms.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/qxl/qxl_kms.c
++++ b/drivers/gpu/drm/qxl/qxl_kms.c
+@@ -218,7 +218,7 @@ int qxl_device_init(struct qxl_device *q
+                               &(qdev->ram_header->cursor_ring_hdr),
+                               sizeof(struct qxl_command),
+                               QXL_CURSOR_RING_SIZE,
+-                              qdev->io_base + QXL_IO_NOTIFY_CMD,
++                              qdev->io_base + QXL_IO_NOTIFY_CURSOR,
+                               false,
+                               &qdev->cursor_event);
diff --git a/queue-5.4/selinux-fix-double-free.patch b/queue-5.4/selinux-fix-double-free.patch
new file mode 100644 (file)
index 0000000..cbb01ab
--- /dev/null
@@ -0,0 +1,46 @@
+From 65de50969a77509452ae590e9449b70a22b923bb Mon Sep 17 00:00:00 2001
+From: Tom Rix <trix@redhat.com>
+Date: Wed, 10 Jun 2020 14:57:13 -0700
+Subject: selinux: fix double free
+
+From: Tom Rix <trix@redhat.com>
+
+commit 65de50969a77509452ae590e9449b70a22b923bb upstream.
+
+Clang's static analysis tool reports these double free memory errors.
+
+security/selinux/ss/services.c:2987:4: warning: Attempt to free released memory [unix.Malloc]
+                        kfree(bnames[i]);
+                        ^~~~~~~~~~~~~~~~
+security/selinux/ss/services.c:2990:2: warning: Attempt to free released memory [unix.Malloc]
+        kfree(bvalues);
+        ^~~~~~~~~~~~~~
+
+So improve the security_get_bools error handling by freeing these variables
+and setting their return pointers to NULL and the return len to 0
+
+Cc: stable@vger.kernel.org
+Signed-off-by: Tom Rix <trix@redhat.com>
+Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
+Signed-off-by: Paul Moore <paul@paul-moore.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ security/selinux/ss/services.c |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/security/selinux/ss/services.c
++++ b/security/selinux/ss/services.c
+@@ -2844,8 +2844,12 @@ err:
+       if (*names) {
+               for (i = 0; i < *len; i++)
+                       kfree((*names)[i]);
++              kfree(*names);
+       }
+       kfree(*values);
++      *len = 0;
++      *names = NULL;
++      *values = NULL;
+       goto out;
+ }
index 2dfb2256e48215bdcdcd82584bc86d5573cb0e2f..c91b9f74dfdd7aeaaaf8d4ca0035daeb0e738fa2 100644 (file)
@@ -282,3 +282,7 @@ libata-use-per-port-sync-for-detach.patch
 drm-encoder_slave-fix-refcouting-error-for-modules.patch
 ext4-fix-partial-cluster-initialization-when-splitting-extent.patch
 ext4-avoid-utf8_strncasecmp-with-unstable-name.patch
+drm-dp_mst-reformat-drm_dp_check_act_status-a-bit.patch
+drm-qxl-use-correct-notify-port-address-when-creating-cursor-ring.patch
+drm-amdgpu-replace-invalid-device-id-with-a-valid-device-id.patch
+selinux-fix-double-free.patch