From: Greg Kroah-Hartman Date: Tue, 19 Nov 2024 12:09:27 +0000 (+0100) Subject: 5.15-stable patches X-Git-Tag: v6.12.1~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=32fcc2639e3aa132a8e0f4d530e182ba071b7c9e;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: 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-5.15/lib-buildid-fix-build-id-parsing-logic.patch b/queue-5.15/lib-buildid-fix-build-id-parsing-logic.patch new file mode 100644 index 00000000000..05583566bd2 --- /dev/null +++ b/queue-5.15/lib-buildid-fix-build-id-parsing-logic.patch @@ -0,0 +1,37 @@ +From jolsa@kernel.org Tue Nov 19 13:00:07 2024 +From: Jiri Olsa +Date: Mon, 4 Nov 2024 18:52:53 +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-2-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 stable trees that merged 8fa2b6817a95 fix, +the upstream build id code was refactored and returns proper +build id. + +Acked-by: Andrii Nakryiko +Fixes: 8fa2b6817a95 ("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-5.15/media-dvbdev-fix-the-logic-when-dvb_dynamic_minors-is-not-set.patch b/queue-5.15/media-dvbdev-fix-the-logic-when-dvb_dynamic_minors-is-not-set.patch new file mode 100644 index 00000000000..79f25d946f9 --- /dev/null +++ b/queue-5.15/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 +@@ -544,6 +544,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); +@@ -557,17 +560,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-5.15/series b/queue-5.15/series index c8c19808aa0..ca5049bbe1b 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -18,3 +18,5 @@ revert-mmc-dw_mmc-fix-idmac-operation-with-pages-bigger-than-4k.patch drm-bridge-tc358768-fix-dsi-command-tx.patch mmc-sunxi-mmc-add-d1-mmc-variant.patch mmc-sunxi-mmc-fix-a100-compatible-description.patch +lib-buildid-fix-build-id-parsing-logic.patch +media-dvbdev-fix-the-logic-when-dvb_dynamic_minors-is-not-set.patch