]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.1-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Nov 2024 12:09:55 +0000 (13:09 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Nov 2024 12:09:55 +0000 (13:09 +0100)
added patches:
cxl-pci-fix-error-code-in-__cxl_hdm_decode_init.patch
lib-buildid-fix-build-id-parsing-logic.patch
media-dvbdev-fix-the-logic-when-dvb_dynamic_minors-is-not-set.patch

queue-6.1/cxl-pci-fix-error-code-in-__cxl_hdm_decode_init.patch [new file with mode: 0644]
queue-6.1/lib-buildid-fix-build-id-parsing-logic.patch [new file with mode: 0644]
queue-6.1/media-dvbdev-fix-the-logic-when-dvb_dynamic_minors-is-not-set.patch [new file with mode: 0644]
queue-6.1/series

diff --git a/queue-6.1/cxl-pci-fix-error-code-in-__cxl_hdm_decode_init.patch b/queue-6.1/cxl-pci-fix-error-code-in-__cxl_hdm_decode_init.patch
new file mode 100644 (file)
index 0000000..f823b35
--- /dev/null
@@ -0,0 +1,40 @@
+From dan.carpenter@linaro.org  Tue Nov 19 13:01:21 2024
+From: Dan Carpenter <dan.carpenter@linaro.org>
+Date: Fri, 15 Nov 2024 17:11:38 +0300
+Subject: cxl/pci: fix error code in __cxl_hdm_decode_init()
+To: Robert Richter <rrichter@amd.com>
+Cc: Alison Schofield <alison.schofield@intel.com>, Vishal Verma <vishal.l.verma@intel.com>, Ira Weiny <ira.weiny@intel.com>, Ben Widawsky <bwidawsk@kernel.org>, Dan Williams <dan.j.williams@intel.com>, Sasha Levin <sashal@kernel.org>, Dave Jiang <dave.jiang@intel.com>, Jonathan Cameron <Jonathan.Cameron@huawei.com>, Yanfei Xu <yanfei.xu@intel.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, linux-cxl@vger.kernel.org, stable@vger.kernel.org
+Message-ID: <380871e1-e048-459a-adc5-cfbb6e5d5b94@stanley.mountain>
+Content-Disposition: inline
+
+From: Dan Carpenter <dan.carpenter@linaro.org>
+
+When commit 0cab68720598 ("cxl/pci: Fix disabling memory if DVSEC CXL
+Range does not match a CFMWS window") was backported, this chunk moved
+from the cxl_hdm_decode_init() function which returns negative error
+codes to the __cxl_hdm_decode_init() function which returns false on
+error.  So the error code needs to be modified from -ENXIO to false.
+
+This issue only exits in the 6.1.y kernels.  In later kernels negative
+error codes are correct and the driver didn't exist in earlier kernels.
+
+Fixes: 031217128990 ("cxl/pci: Fix disabling memory if DVSEC CXL Range does not match a CFMWS window")
+Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
+Reviewed-by: Ira Weiny <ira.weiny@intel.com>
+Reviewed-by: Dave Jiang <dave.jiang@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/cxl/core/pci.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/cxl/core/pci.c
++++ b/drivers/cxl/core/pci.c
+@@ -377,7 +377,7 @@ static bool __cxl_hdm_decode_init(struct
+       if (!allowed && info->mem_enabled) {
+               dev_err(dev, "Range register decodes outside platform defined CXL ranges.\n");
+-              return -ENXIO;
++              return false;
+       }
+       /*
diff --git a/queue-6.1/lib-buildid-fix-build-id-parsing-logic.patch b/queue-6.1/lib-buildid-fix-build-id-parsing-logic.patch
new file mode 100644 (file)
index 0000000..f8ac0ea
--- /dev/null
@@ -0,0 +1,37 @@
+From jolsa@kernel.org  Tue Nov 19 12:59:42 2024
+From: Jiri Olsa <jolsa@kernel.org>
+Date: Mon,  4 Nov 2024 18:52:54 +0100
+Subject: lib/buildid: Fix build ID parsing logic
+To: stable@vger.kernel.org
+Cc: Andrii Nakryiko <andrii@kernel.org>, bpf@vger.kernel.org, Daniel Borkmann <daniel@iogearbox.net>
+Message-ID: <20241104175256.2327164-3-jolsa@kernel.org>
+
+From: Jiri Olsa <jolsa@kernel.org>
+
+The parse_build_id_buf does not account Elf32_Nhdr header size
+when getting the build id data pointer and returns wrong build
+id data as result.
+
+This is problem only for stable trees that merged 84887f4c1c3a
+fix, the upstream build id code was refactored and returns proper
+build id.
+
+Acked-by: Andrii Nakryiko <andrii@kernel.org>
+Fixes: 84887f4c1c3a ("lib/buildid: harden build ID parsing logic")
+Signed-off-by: Jiri Olsa <jolsa@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ lib/buildid.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/lib/buildid.c
++++ b/lib/buildid.c
+@@ -40,7 +40,7 @@ static int parse_build_id_buf(unsigned c
+                   name_sz == note_name_sz &&
+                   memcmp(nhdr + 1, note_name, note_name_sz) == 0 &&
+                   desc_sz > 0 && desc_sz <= BUILD_ID_SIZE_MAX) {
+-                      data = note_start + note_off + ALIGN(note_name_sz, 4);
++                      data = note_start + note_off + sizeof(Elf32_Nhdr) + ALIGN(note_name_sz, 4);
+                       memcpy(build_id, data, desc_sz);
+                       memset(build_id + desc_sz, 0, BUILD_ID_SIZE_MAX - desc_sz);
+                       if (size)
diff --git a/queue-6.1/media-dvbdev-fix-the-logic-when-dvb_dynamic_minors-is-not-set.patch b/queue-6.1/media-dvbdev-fix-the-logic-when-dvb_dynamic_minors-is-not-set.patch
new file mode 100644 (file)
index 0000000..b4c27b0
--- /dev/null
@@ -0,0 +1,57 @@
+From a4aebaf6e6efff548b01a3dc49b4b9074751c15b Mon Sep 17 00:00:00 2001
+From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
+Date: Wed, 6 Nov 2024 21:50:55 +0100
+Subject: media: dvbdev: fix the logic when DVB_DYNAMIC_MINORS is not set
+
+From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
+
+commit a4aebaf6e6efff548b01a3dc49b4b9074751c15b upstream.
+
+When CONFIG_DVB_DYNAMIC_MINORS, ret is not initialized, and a
+semaphore is left at the wrong state, in case of errors.
+
+Make the code simpler and avoid mistakes by having just one error
+check logic used weather DVB_DYNAMIC_MINORS is used or not.
+
+Reported-by: kernel test robot <lkp@intel.com>
+Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
+Closes: https://lore.kernel.org/r/202410201717.ULWWdJv8-lkp@intel.com/
+Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
+Link: https://lore.kernel.org/r/9e067488d8935b8cf00959764a1fa5de85d65725.1730926254.git.mchehab+huawei@kernel.org
+Cc: Nathan Chancellor <nathan@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/media/dvb-core/dvbdev.c |   15 ++++-----------
+ 1 file changed, 4 insertions(+), 11 deletions(-)
+
+--- a/drivers/media/dvb-core/dvbdev.c
++++ b/drivers/media/dvb-core/dvbdev.c
+@@ -534,6 +534,9 @@ int dvb_register_device(struct dvb_adapt
+       for (minor = 0; minor < MAX_DVB_MINORS; minor++)
+               if (dvb_minors[minor] == NULL)
+                       break;
++#else
++      minor = nums2minor(adap->num, type, id);
++#endif
+       if (minor >= MAX_DVB_MINORS) {
+               if (new_node) {
+                       list_del (&new_node->list_head);
+@@ -547,17 +550,7 @@ int dvb_register_device(struct dvb_adapt
+               mutex_unlock(&dvbdev_register_lock);
+               return -EINVAL;
+       }
+-#else
+-      minor = nums2minor(adap->num, type, id);
+-      if (minor >= MAX_DVB_MINORS) {
+-              dvb_media_device_free(dvbdev);
+-              list_del(&dvbdev->list_head);
+-              kfree(dvbdev);
+-              *pdvbdev = NULL;
+-              mutex_unlock(&dvbdev_register_lock);
+-              return ret;
+-      }
+-#endif
++
+       dvbdev->minor = minor;
+       dvb_minors[minor] = dvb_device_get(dvbdev);
+       up_write(&minor_rwsem);
index 0d3d57eeda883f3a4d508562f8da8dcab6bae2ae..6474e5f9566c812d69298150d16fb4b57154b632 100644 (file)
@@ -35,3 +35,6 @@ staging-vchiq_arm-get-the-rid-off-struct-vchiq_2835_.patch
 staging-vchiq_arm-use-devm_kzalloc-for-vchiq_arm_sta.patch
 fs-ntfs3-additional-check-in-ntfs_file_release.patch
 bluetooth-iso-fix-not-validating-setsockopt-user-input.patch
+lib-buildid-fix-build-id-parsing-logic.patch
+cxl-pci-fix-error-code-in-__cxl_hdm_decode_init.patch
+media-dvbdev-fix-the-logic-when-dvb_dynamic_minors-is-not-set.patch