From: Greg Kroah-Hartman Date: Mon, 24 Jun 2024 16:40:26 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v6.1.96~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71998f75e1aae5fb71723b52f774001087f0b8d4;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: alsa-hda-realtek-limit-mic-boost-on-n14ap7.patch drm-radeon-fix-ubsan-warning-in-kv_dpm.c.patch gcov-add-support-for-gcc-14.patch kcov-don-t-lose-track-of-remote-references-during-softirqs.patch --- diff --git a/queue-5.10/alsa-hda-realtek-limit-mic-boost-on-n14ap7.patch b/queue-5.10/alsa-hda-realtek-limit-mic-boost-on-n14ap7.patch new file mode 100644 index 00000000000..acf9d5fe0a0 --- /dev/null +++ b/queue-5.10/alsa-hda-realtek-limit-mic-boost-on-n14ap7.patch @@ -0,0 +1,31 @@ +From 86a433862912f52597263aa224a9ed82bcd533bf Mon Sep 17 00:00:00 2001 +From: Edson Juliano Drosdeck +Date: Wed, 5 Jun 2024 12:39:23 -0300 +Subject: ALSA: hda/realtek: Limit mic boost on N14AP7 + +From: Edson Juliano Drosdeck + +commit 86a433862912f52597263aa224a9ed82bcd533bf upstream. + +The internal mic boost on the N14AP7 is too high. Fix this by applying the +ALC269_FIXUP_LIMIT_INT_MIC_BOOST fixup to the machine to limit the gain. + +Signed-off-by: Edson Juliano Drosdeck +Cc: +Link: https://lore.kernel.org/r/20240605153923.2837-1-edson.drosdeck@gmail.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -9380,6 +9380,7 @@ static const struct snd_pci_quirk alc269 + SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */ + SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802), + SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X), ++ SND_PCI_QUIRK(0x1c6c, 0x122a, "Positivo N14AP7", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), + SND_PCI_QUIRK(0x1c6c, 0x1251, "Positivo N14KP6-TG", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS), + SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP), diff --git a/queue-5.10/drm-radeon-fix-ubsan-warning-in-kv_dpm.c.patch b/queue-5.10/drm-radeon-fix-ubsan-warning-in-kv_dpm.c.patch new file mode 100644 index 00000000000..47aada28bf8 --- /dev/null +++ b/queue-5.10/drm-radeon-fix-ubsan-warning-in-kv_dpm.c.patch @@ -0,0 +1,30 @@ +From a498df5421fd737d11bfd152428ba6b1c8538321 Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Mon, 20 May 2024 09:11:45 -0400 +Subject: drm/radeon: fix UBSAN warning in kv_dpm.c + +From: Alex Deucher + +commit a498df5421fd737d11bfd152428ba6b1c8538321 upstream. + +Adds bounds check for sumo_vid_mapping_entry. + +Reviewed-by: Mario Limonciello +Signed-off-by: Alex Deucher +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/radeon/sumo_dpm.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/gpu/drm/radeon/sumo_dpm.c ++++ b/drivers/gpu/drm/radeon/sumo_dpm.c +@@ -1621,6 +1621,8 @@ void sumo_construct_vid_mapping_table(st + + for (i = 0; i < SUMO_MAX_HARDWARE_POWERLEVELS; i++) { + if (table[i].ulSupportedSCLK != 0) { ++ if (table[i].usVoltageIndex >= SUMO_MAX_NUMBER_VOLTAGES) ++ continue; + vid_mapping_table->entries[table[i].usVoltageIndex].vid_7bit = + table[i].usVoltageID; + vid_mapping_table->entries[table[i].usVoltageIndex].vid_2bit = diff --git a/queue-5.10/gcov-add-support-for-gcc-14.patch b/queue-5.10/gcov-add-support-for-gcc-14.patch new file mode 100644 index 00000000000..928df685603 --- /dev/null +++ b/queue-5.10/gcov-add-support-for-gcc-14.patch @@ -0,0 +1,40 @@ +From c1558bc57b8e5b4da5d821537cd30e2e660861d8 Mon Sep 17 00:00:00 2001 +From: Peter Oberparleiter +Date: Mon, 10 Jun 2024 11:27:43 +0200 +Subject: gcov: add support for GCC 14 + +From: Peter Oberparleiter + +commit c1558bc57b8e5b4da5d821537cd30e2e660861d8 upstream. + +Using gcov on kernels compiled with GCC 14 results in truncated 16-byte +long .gcda files with no usable data. To fix this, update GCOV_COUNTERS +to match the value defined by GCC 14. + +Tested with GCC versions 14.1.0 and 13.2.0. + +Link: https://lkml.kernel.org/r/20240610092743.1609845-1-oberpar@linux.ibm.com +Signed-off-by: Peter Oberparleiter +Reported-by: Allison Henderson +Reported-by: Chuck Lever III +Tested-by: Chuck Lever +Cc: +Signed-off-by: Andrew Morton +Signed-off-by: Greg Kroah-Hartman +--- + kernel/gcov/gcc_4_7.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/kernel/gcov/gcc_4_7.c ++++ b/kernel/gcov/gcc_4_7.c +@@ -19,7 +19,9 @@ + #include + #include "gcov.h" + +-#if (__GNUC__ >= 10) ++#if (__GNUC__ >= 14) ++#define GCOV_COUNTERS 9 ++#elif (__GNUC__ >= 10) + #define GCOV_COUNTERS 8 + #elif (__GNUC__ >= 7) + #define GCOV_COUNTERS 9 diff --git a/queue-5.10/kcov-don-t-lose-track-of-remote-references-during-softirqs.patch b/queue-5.10/kcov-don-t-lose-track-of-remote-references-during-softirqs.patch new file mode 100644 index 00000000000..d1d5ab50843 --- /dev/null +++ b/queue-5.10/kcov-don-t-lose-track-of-remote-references-during-softirqs.patch @@ -0,0 +1,79 @@ +From 01c8f9806bde438ca1c8cbbc439f0a14a6694f6c Mon Sep 17 00:00:00 2001 +From: Aleksandr Nogikh +Date: Tue, 11 Jun 2024 15:32:29 +0200 +Subject: kcov: don't lose track of remote references during softirqs + +From: Aleksandr Nogikh + +commit 01c8f9806bde438ca1c8cbbc439f0a14a6694f6c upstream. + +In kcov_remote_start()/kcov_remote_stop(), we swap the previous KCOV +metadata of the current task into a per-CPU variable. However, the +kcov_mode_enabled(mode) check is not sufficient in the case of remote KCOV +coverage: current->kcov_mode always remains KCOV_MODE_DISABLED for remote +KCOV objects. + +If the original task that has invoked the KCOV_REMOTE_ENABLE ioctl happens +to get interrupted and kcov_remote_start() is called, it ultimately leads +to kcov_remote_stop() NOT restoring the original KCOV reference. So when +the task exits, all registered remote KCOV handles remain active forever. + +The most uncomfortable effect (at least for syzkaller) is that the bug +prevents the reuse of the same /sys/kernel/debug/kcov descriptor. If +we obtain it in the parent process and then e.g. drop some +capabilities and continuously fork to execute individual programs, at +some point current->kcov of the forked process is lost, +kcov_task_exit() takes no action, and all KCOV_REMOTE_ENABLE ioctls +calls from subsequent forks fail. + +And, yes, the efficiency is also affected if we keep on losing remote +kcov objects. +a) kcov_remote_map keeps on growing forever. +b) (If I'm not mistaken), we're also not freeing the memory referenced +by kcov->area. + +Fix it by introducing a special kcov_mode that is assigned to the task +that owns a KCOV remote object. It makes kcov_mode_enabled() return true +and yet does not trigger coverage collection in __sanitizer_cov_trace_pc() +and write_comp_data(). + +[nogikh@google.com: replace WRITE_ONCE() with an ordinary assignment] + Link: https://lkml.kernel.org/r/20240614171221.2837584-1-nogikh@google.com +Link: https://lkml.kernel.org/r/20240611133229.527822-1-nogikh@google.com +Fixes: 5ff3b30ab57d ("kcov: collect coverage from interrupts") +Signed-off-by: Aleksandr Nogikh +Reviewed-by: Dmitry Vyukov +Reviewed-by: Andrey Konovalov +Tested-by: Andrey Konovalov +Cc: Alexander Potapenko +Cc: Arnd Bergmann +Cc: Marco Elver +Cc: +Signed-off-by: Andrew Morton +Signed-off-by: Greg Kroah-Hartman +--- + include/linux/kcov.h | 2 ++ + kernel/kcov.c | 1 + + 2 files changed, 3 insertions(+) + +--- a/include/linux/kcov.h ++++ b/include/linux/kcov.h +@@ -21,6 +21,8 @@ enum kcov_mode { + KCOV_MODE_TRACE_PC = 2, + /* Collecting comparison operands mode. */ + KCOV_MODE_TRACE_CMP = 3, ++ /* The process owns a KCOV remote reference. */ ++ KCOV_MODE_REMOTE = 4, + }; + + #define KCOV_IN_CTXSW (1 << 30) +--- a/kernel/kcov.c ++++ b/kernel/kcov.c +@@ -635,6 +635,7 @@ static int kcov_ioctl_locked(struct kcov + return -EINVAL; + kcov->mode = mode; + t->kcov = kcov; ++ t->kcov_mode = KCOV_MODE_REMOTE; + kcov->t = t; + kcov->remote = true; + kcov->remote_size = remote_arg->area_size; diff --git a/queue-5.10/series b/queue-5.10/series index 9b2dc19984b..bccaccd7012 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -198,3 +198,7 @@ rdma-move-more-uverbs_cmd_mask-settings-to-the-core.patch rdma-check-srq_type-during-create_srq.patch rdma-mlx5-add-check-for-srq-max_sge-attribute.patch mm-fix-race-between-__split_huge_pmd_locked-and-gup-fast.patch +alsa-hda-realtek-limit-mic-boost-on-n14ap7.patch +drm-radeon-fix-ubsan-warning-in-kv_dpm.c.patch +gcov-add-support-for-gcc-14.patch +kcov-don-t-lose-track-of-remote-references-during-softirqs.patch