From: Greg Kroah-Hartman Date: Sun, 26 Oct 2025 14:59:36 +0000 (+0100) Subject: 6.12-stable patches X-Git-Tag: v5.4.301~31 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e71486ab5a6c57be7d0bac7894f73d06707e9a88;p=thirdparty%2Fkernel%2Fstable-queue.git 6.12-stable patches added patches: bluetooth-btintel-add-dsbr-support-for-blazariw-blazaru-and-gap.patch --- diff --git a/queue-6.12/binfmt_elf-preserve-original-elf-e_flags-for-core-du.patch b/queue-6.12/binfmt_elf-preserve-original-elf-e_flags-for-core-du.patch deleted file mode 100644 index 915a2d75c6..0000000000 --- a/queue-6.12/binfmt_elf-preserve-original-elf-e_flags-for-core-du.patch +++ /dev/null @@ -1,162 +0,0 @@ -From eba4f3edaa473a20133488c4893cc6c81e546655 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Mon, 1 Sep 2025 20:53:50 +0700 -Subject: binfmt_elf: preserve original ELF e_flags for core dumps - -From: Svetlana Parfenova - -[ Upstream commit 8c94db0ae97c72c253a615f990bd466b456e94f6 ] - -Some architectures, such as RISC-V, use the ELF e_flags field to encode -ABI-specific information (e.g., ISA extensions, fpu support). Debuggers -like GDB rely on these flags in core dumps to correctly interpret -optional register sets. If the flags are missing or incorrect, GDB may -warn and ignore valid data, for example: - - warning: Unexpected size of section '.reg2/213' in core file. - -This can prevent access to fpu or other architecture-specific registers -even when they were dumped. - -Save the e_flags field during ELF binary loading (in load_elf_binary()) -into the mm_struct, and later retrieve it during core dump generation -(in fill_note_info()). Kconfig option CONFIG_ARCH_HAS_ELF_CORE_EFLAGS -is introduced for architectures that require this behaviour. - -Signed-off-by: Svetlana Parfenova -Link: https://lore.kernel.org/r/20250901135350.619485-1-svetlana.parfenova@syntacore.com -Signed-off-by: Kees Cook -Signed-off-by: Sasha Levin ---- - arch/riscv/Kconfig | 1 + - fs/Kconfig.binfmt | 9 +++++++++ - fs/binfmt_elf.c | 40 ++++++++++++++++++++++++++++++++++------ - include/linux/mm_types.h | 5 +++++ - 4 files changed, 49 insertions(+), 6 deletions(-) - -diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig -index d160c3b830266..ab6d0321d8e61 100644 ---- a/arch/riscv/Kconfig -+++ b/arch/riscv/Kconfig -@@ -28,6 +28,7 @@ config RISCV - select ARCH_HAS_DEBUG_VIRTUAL if MMU - select ARCH_HAS_DEBUG_VM_PGTABLE - select ARCH_HAS_DEBUG_WX -+ select ARCH_HAS_ELF_CORE_EFLAGS - select ARCH_HAS_FAST_MULTIPLIER - select ARCH_HAS_FORTIFY_SOURCE - select ARCH_HAS_GCOV_PROFILE_ALL -diff --git a/fs/Kconfig.binfmt b/fs/Kconfig.binfmt -index bd2f530e57408..1949e25c7741b 100644 ---- a/fs/Kconfig.binfmt -+++ b/fs/Kconfig.binfmt -@@ -184,4 +184,13 @@ config EXEC_KUNIT_TEST - This builds the exec KUnit tests, which tests boundary conditions - of various aspects of the exec internals. - -+config ARCH_HAS_ELF_CORE_EFLAGS -+ bool -+ depends on BINFMT_ELF && ELF_CORE -+ default n -+ help -+ Select this option if the architecture makes use of the e_flags -+ field in the ELF header to store ABI or other architecture-specific -+ information that should be preserved in core dumps. -+ - endmenu -diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c -index 47335a0f4a618..b37f2a3d58de2 100644 ---- a/fs/binfmt_elf.c -+++ b/fs/binfmt_elf.c -@@ -110,6 +110,21 @@ static struct linux_binfmt elf_format = { - - #define BAD_ADDR(x) (unlikely((unsigned long)(x) >= TASK_SIZE)) - -+static inline void elf_coredump_set_mm_eflags(struct mm_struct *mm, u32 flags) -+{ -+#ifdef CONFIG_ARCH_HAS_ELF_CORE_EFLAGS -+ mm->saved_e_flags = flags; -+#endif -+} -+ -+static inline u32 elf_coredump_get_mm_eflags(struct mm_struct *mm, u32 flags) -+{ -+#ifdef CONFIG_ARCH_HAS_ELF_CORE_EFLAGS -+ flags = mm->saved_e_flags; -+#endif -+ return flags; -+} -+ - /* - * We need to explicitly zero any trailing portion of the page that follows - * p_filesz when it ends before the page ends (e.g. bss), otherwise this -@@ -1292,6 +1307,8 @@ static int load_elf_binary(struct linux_binprm *bprm) - mm->end_data = end_data; - mm->start_stack = bprm->p; - -+ elf_coredump_set_mm_eflags(mm, elf_ex->e_flags); -+ - /** - * DOC: "brk" handling - * -@@ -1865,6 +1882,8 @@ static int fill_note_info(struct elfhdr *elf, int phdrs, - struct elf_thread_core_info *t; - struct elf_prpsinfo *psinfo; - struct core_thread *ct; -+ u16 machine; -+ u32 flags; - - psinfo = kmalloc(sizeof(*psinfo), GFP_KERNEL); - if (!psinfo) -@@ -1892,17 +1911,26 @@ static int fill_note_info(struct elfhdr *elf, int phdrs, - return 0; - } - -- /* -- * Initialize the ELF file header. -- */ -- fill_elf_header(elf, phdrs, -- view->e_machine, view->e_flags); -+ machine = view->e_machine; -+ flags = view->e_flags; - #else - view = NULL; - info->thread_notes = 2; -- fill_elf_header(elf, phdrs, ELF_ARCH, ELF_CORE_EFLAGS); -+ machine = ELF_ARCH; -+ flags = ELF_CORE_EFLAGS; - #endif - -+ /* -+ * Override ELF e_flags with value taken from process, -+ * if arch needs that. -+ */ -+ flags = elf_coredump_get_mm_eflags(dump_task->mm, flags); -+ -+ /* -+ * Initialize the ELF file header. -+ */ -+ fill_elf_header(elf, phdrs, machine, flags); -+ - /* - * Allocate a structure for each thread. - */ -diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h -index 6894de506b364..d0a075f3fc2d4 100644 ---- a/include/linux/mm_types.h -+++ b/include/linux/mm_types.h -@@ -955,6 +955,11 @@ struct mm_struct { - - unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ - -+#ifdef CONFIG_ARCH_HAS_ELF_CORE_EFLAGS -+ /* the ABI-related flags from the ELF header. Used for core dump */ -+ unsigned long saved_e_flags; -+#endif -+ - struct percpu_counter rss_stat[NR_MM_COUNTERS]; - - struct linux_binfmt *binfmt; --- -2.51.0 - diff --git a/queue-6.12/bluetooth-btintel-add-dsbr-support-for-blazariw-blazaru-and-gap.patch b/queue-6.12/bluetooth-btintel-add-dsbr-support-for-blazariw-blazaru-and-gap.patch new file mode 100644 index 0000000000..df91a73593 --- /dev/null +++ b/queue-6.12/bluetooth-btintel-add-dsbr-support-for-blazariw-blazaru-and-gap.patch @@ -0,0 +1,79 @@ +From d88a8bb8bbbec9d57b84232a2d6f8dab84221959 Mon Sep 17 00:00:00 2001 +From: Kiran K +Date: Tue, 15 Oct 2024 17:57:07 +0530 +Subject: Bluetooth: btintel: Add DSBR support for BlazarIW, BlazarU and GaP + +From: Kiran K + +commit d88a8bb8bbbec9d57b84232a2d6f8dab84221959 upstream. + +Add DSBR support for BlazarIW, BlazarU and Gale Peak2 cores. + +Refer commit eb9e749c0182 ("Bluetooth: btintel: Allow configuring drive +strength of BRI") for details about DSBR. + +Signed-off-by: Kiran K +Signed-off-by: Luiz Augusto von Dentz +Cc: Salvatore Bonaccorso +Cc: Guido Berhoerster +Signed-off-by: Greg Kroah-Hartman +--- + drivers/bluetooth/btintel.c | 28 ++++++++++++++++++++-------- + drivers/bluetooth/btintel.h | 3 +++ + 2 files changed, 23 insertions(+), 8 deletions(-) + +--- a/drivers/bluetooth/btintel.c ++++ b/drivers/bluetooth/btintel.c +@@ -2734,20 +2734,32 @@ static int btintel_set_dsbr(struct hci_d + + struct btintel_dsbr_cmd cmd; + struct sk_buff *skb; ++ u32 dsbr, cnvi; + u8 status; +- u32 dsbr; +- bool apply_dsbr; + int err; + +- /* DSBR command needs to be sent for BlazarI + B0 step product after +- * downloading IML image. ++ cnvi = ver->cnvi_top & 0xfff; ++ /* DSBR command needs to be sent for, ++ * 1. BlazarI or BlazarIW + B0 step product in IML image. ++ * 2. Gale Peak2 or BlazarU in OP image. + */ +- apply_dsbr = (ver->img_type == BTINTEL_IMG_IML && +- ((ver->cnvi_top & 0xfff) == BTINTEL_CNVI_BLAZARI) && +- INTEL_CNVX_TOP_STEP(ver->cnvi_top) == 0x01); + +- if (!apply_dsbr) ++ switch (cnvi) { ++ case BTINTEL_CNVI_BLAZARI: ++ case BTINTEL_CNVI_BLAZARIW: ++ if (ver->img_type == BTINTEL_IMG_IML && ++ INTEL_CNVX_TOP_STEP(ver->cnvi_top) == 0x01) ++ break; + return 0; ++ case BTINTEL_CNVI_GAP: ++ case BTINTEL_CNVI_BLAZARU: ++ if (ver->img_type == BTINTEL_IMG_OP && ++ hdev->bus == HCI_USB) ++ break; ++ return 0; ++ default: ++ return 0; ++ } + + dsbr = 0; + err = btintel_uefi_get_dsbr(&dsbr); +--- a/drivers/bluetooth/btintel.h ++++ b/drivers/bluetooth/btintel.h +@@ -53,6 +53,9 @@ struct intel_tlv { + } __packed; + + #define BTINTEL_CNVI_BLAZARI 0x900 ++#define BTINTEL_CNVI_BLAZARIW 0x901 ++#define BTINTEL_CNVI_GAP 0x910 ++#define BTINTEL_CNVI_BLAZARU 0x930 + + #define BTINTEL_IMG_BOOTLOADER 0x01 /* Bootloader image */ + #define BTINTEL_IMG_IML 0x02 /* Intermediate image */ diff --git a/queue-6.12/series b/queue-6.12/series index 2f7e4eaa26..5ce5b52d2e 100644 --- a/queue-6.12/series +++ b/queue-6.12/series @@ -8,7 +8,6 @@ hfsplus-fix-kmsan-uninit-value-issue-in-hfsplus_dele.patch dlm-check-for-defined-force-value-in-dlm_lockspace_r.patch hfs-fix-kmsan-uninit-value-issue-in-hfs_find_set_zer.patch hfsplus-return-eio-when-type-of-hidden-directory-mis.patch -binfmt_elf-preserve-original-elf-e_flags-for-core-du.patch pci-test-for-bit-underflow-in-pcie_set_readrq.patch lkdtm-fortify-fix-potential-null-dereference-on-kmal.patch arm64-sysreg-correct-sign-definitions-for-eiesb-and-.patch @@ -90,3 +89,4 @@ io_uring-correct-__must_hold-annotation-in-io_instal.patch sched-remove-never-used-code-in-mm_cid_get.patch io_uring-sqpoll-switch-away-from-getrusage-for-cpu-accounting.patch io_uring-sqpoll-be-smarter-on-when-to-update-the-stime-usage.patch +bluetooth-btintel-add-dsbr-support-for-blazariw-blazaru-and-gap.patch