From: Greg Kroah-Hartman Date: Tue, 19 Nov 2024 12:09:55 +0000 (+0100) Subject: 6.1-stable patches X-Git-Tag: v6.12.1~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=137f8225e68ed4dd55b1e920da701ad10921dbc3;p=thirdparty%2Fkernel%2Fstable-queue.git 6.1-stable patches 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 --- 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 index 00000000000..f823b359ba0 --- /dev/null +++ b/queue-6.1/cxl-pci-fix-error-code-in-__cxl_hdm_decode_init.patch @@ -0,0 +1,40 @@ +From dan.carpenter@linaro.org Tue Nov 19 13:01:21 2024 +From: Dan Carpenter +Date: Fri, 15 Nov 2024 17:11:38 +0300 +Subject: cxl/pci: fix error code in __cxl_hdm_decode_init() +To: Robert Richter +Cc: Alison Schofield , Vishal Verma , Ira Weiny , Ben Widawsky , Dan Williams , Sasha Levin , Dave Jiang , Jonathan Cameron , Yanfei Xu , Greg Kroah-Hartman , linux-cxl@vger.kernel.org, stable@vger.kernel.org +Message-ID: <380871e1-e048-459a-adc5-cfbb6e5d5b94@stanley.mountain> +Content-Disposition: inline + +From: Dan Carpenter + +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 +Reviewed-by: Ira Weiny +Reviewed-by: Dave Jiang +Signed-off-by: Greg Kroah-Hartman +--- + 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 index 00000000000..f8ac0eab036 --- /dev/null +++ b/queue-6.1/lib-buildid-fix-build-id-parsing-logic.patch @@ -0,0 +1,37 @@ +From jolsa@kernel.org Tue Nov 19 12:59:42 2024 +From: Jiri Olsa +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 , bpf@vger.kernel.org, Daniel Borkmann +Message-ID: <20241104175256.2327164-3-jolsa@kernel.org> + +From: Jiri Olsa + +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 +Fixes: 84887f4c1c3a ("lib/buildid: harden build ID parsing logic") +Signed-off-by: Jiri Olsa +Signed-off-by: Greg Kroah-Hartman +--- + 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 index 00000000000..b4c27b0ef9b --- /dev/null +++ b/queue-6.1/media-dvbdev-fix-the-logic-when-dvb_dynamic_minors-is-not-set.patch @@ -0,0 +1,57 @@ +From a4aebaf6e6efff548b01a3dc49b4b9074751c15b Mon Sep 17 00:00:00 2001 +From: Mauro Carvalho Chehab +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 + +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 +Reported-by: Dan Carpenter +Closes: https://lore.kernel.org/r/202410201717.ULWWdJv8-lkp@intel.com/ +Signed-off-by: Mauro Carvalho Chehab +Link: https://lore.kernel.org/r/9e067488d8935b8cf00959764a1fa5de85d65725.1730926254.git.mchehab+huawei@kernel.org +Cc: Nathan Chancellor +Signed-off-by: Greg Kroah-Hartman +--- + 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); diff --git a/queue-6.1/series b/queue-6.1/series index 0d3d57eeda8..6474e5f9566 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -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