]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.12-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Aug 2025 11:21:43 +0000 (13:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Aug 2025 11:21:43 +0000 (13:21 +0200)
added patches:
scsi-core-fix-command-pass-through-retry-regression.patch
soc-qcom-mdt_loader-fix-error-return-values-in-mdt_header_valid.patch

queue-6.12/scsi-core-fix-command-pass-through-retry-regression.patch [new file with mode: 0644]
queue-6.12/series
queue-6.12/soc-qcom-mdt_loader-fix-error-return-values-in-mdt_header_valid.patch [new file with mode: 0644]

diff --git a/queue-6.12/scsi-core-fix-command-pass-through-retry-regression.patch b/queue-6.12/scsi-core-fix-command-pass-through-retry-regression.patch
new file mode 100644 (file)
index 0000000..c5d362d
--- /dev/null
@@ -0,0 +1,45 @@
+From 8604f633f59375687fa115d6f691de95a42520e3 Mon Sep 17 00:00:00 2001
+From: Mike Christie <michael.christie@oracle.com>
+Date: Mon, 6 Jan 2025 19:02:20 -0600
+Subject: scsi: core: Fix command pass through retry regression
+
+From: Mike Christie <michael.christie@oracle.com>
+
+commit 8604f633f59375687fa115d6f691de95a42520e3 upstream.
+
+scsi_check_passthrough() is always called, but it doesn't check for if a
+command completed successfully. As a result, if a command was successful and
+the caller used SCMD_FAILURE_RESULT_ANY to indicate what failures it wanted
+to retry, we will end up retrying the command. This will cause delays during
+device discovery because of the command being sent multiple times. For some
+USB devices it can also cause the wrong device size to be used.
+
+This patch adds a check for if the command was successful. If it is we
+return immediately instead of trying to match a failure.
+
+Fixes: 994724e6b3f0 ("scsi: core: Allow passthrough to request midlayer retries")
+Reported-by: Kris Karas <bugs-a21@moonlit-rail.com>
+Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219652
+Signed-off-by: Mike Christie <michael.christie@oracle.com>
+Link: https://lore.kernel.org/r/20250107010220.7215-1-michael.christie@oracle.com
+Reviewed-by: Bart Van Assche <bvanassche@acm.org>
+Reviewed-by: John Garry <john.g.garry@oracle.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Cc: Igor Pylypiv <ipylypiv@google.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/scsi/scsi_lib.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/scsi/scsi_lib.c
++++ b/drivers/scsi/scsi_lib.c
+@@ -210,6 +210,9 @@ static int scsi_check_passthrough(struct
+       struct scsi_sense_hdr sshdr;
+       enum sam_status status;
++      if (!scmd->result)
++              return 0;
++
+       if (!failures)
+               return 0;
index beef3abfcd0587d22d0c1121e11f9851e0176e89..166b4c5fe9a3db37e62c54c9e3d920e2795e307f 100644 (file)
@@ -185,3 +185,5 @@ drm-amd-display-fix-xorg-desktop-unresponsive-on-replay-panel.patch
 drm-amd-display-fix-dp-audio-dto1-clock-source-on-dce-6.patch
 drm-amd-display-find-first-crtc-and-its-line-time-in-dce110_fill_display_configs.patch
 drm-amd-display-fill-display-clock-and-vblank-time-in-dce110_fill_display_configs.patch
+scsi-core-fix-command-pass-through-retry-regression.patch
+soc-qcom-mdt_loader-fix-error-return-values-in-mdt_header_valid.patch
diff --git a/queue-6.12/soc-qcom-mdt_loader-fix-error-return-values-in-mdt_header_valid.patch b/queue-6.12/soc-qcom-mdt_loader-fix-error-return-values-in-mdt_header_valid.patch
new file mode 100644 (file)
index 0000000..7d46c83
--- /dev/null
@@ -0,0 +1,42 @@
+From 9f35ab0e53ccbea57bb9cbad8065e0406d516195 Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@linaro.org>
+Date: Wed, 25 Jun 2025 10:22:41 -0500
+Subject: soc: qcom: mdt_loader: Fix error return values in mdt_header_valid()
+
+From: Dan Carpenter <dan.carpenter@linaro.org>
+
+commit 9f35ab0e53ccbea57bb9cbad8065e0406d516195 upstream.
+
+This function is supposed to return true for valid headers and false for
+invalid.  In a couple places it returns -EINVAL instead which means the
+invalid headers are counted as true.  Change it to return false.
+
+Fixes: 9f9967fed9d0 ("soc: qcom: mdt_loader: Ensure we don't read past the ELF header")
+Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
+Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
+Link: https://lore.kernel.org/r/db57c01c-bdcc-4a0f-95db-b0f2784ea91f@sabinyo.mountain
+Signed-off-by: Bjorn Andersson <andersson@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/soc/qcom/mdt_loader.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/soc/qcom/mdt_loader.c
++++ b/drivers/soc/qcom/mdt_loader.c
+@@ -33,14 +33,14 @@ static bool mdt_header_valid(const struc
+               return false;
+       if (ehdr->e_phentsize != sizeof(struct elf32_phdr))
+-              return -EINVAL;
++              return false;
+       phend = size_add(size_mul(sizeof(struct elf32_phdr), ehdr->e_phnum), ehdr->e_phoff);
+       if (phend > fw->size)
+               return false;
+       if (ehdr->e_shentsize != sizeof(struct elf32_shdr))
+-              return -EINVAL;
++              return false;
+       shend = size_add(size_mul(sizeof(struct elf32_shdr), ehdr->e_shnum), ehdr->e_shoff);
+       if (shend > fw->size)