From: Greg Kroah-Hartman Date: Thu, 30 Dec 2021 10:45:57 +0000 (+0100) Subject: 5.15-stable patches X-Git-Tag: v4.4.298~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=98866192e73998b874ef120d5ab1047307c8a065;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: efi-move-efifb_setup_from_dmi-prototype-from-arch-headers.patch powerpc-ptdump-fix-debug_wx-since-generic-ptdump-conversion.patch recordmcount.pl-fix-typo-in-s390-mcount-regex.patch selinux-initialize-proto-variable-in-selinux_ip_postroute_compat.patch --- diff --git a/queue-5.15/efi-move-efifb_setup_from_dmi-prototype-from-arch-headers.patch b/queue-5.15/efi-move-efifb_setup_from_dmi-prototype-from-arch-headers.patch new file mode 100644 index 00000000000..88c87742c15 --- /dev/null +++ b/queue-5.15/efi-move-efifb_setup_from_dmi-prototype-from-arch-headers.patch @@ -0,0 +1,93 @@ +From 4bc5e64e6cf37007e436970024e5998ee0935651 Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Fri, 26 Nov 2021 01:13:32 +0100 +Subject: efi: Move efifb_setup_from_dmi() prototype from arch headers + +From: Javier Martinez Canillas + +commit 4bc5e64e6cf37007e436970024e5998ee0935651 upstream. + +Commit 8633ef82f101 ("drivers/firmware: consolidate EFI framebuffer setup +for all arches") made the Generic System Framebuffers (sysfb) driver able +to be built on non-x86 architectures. + +But it left the efifb_setup_from_dmi() function prototype declaration in +the architecture specific headers. This could lead to the following +compiler warning as reported by the kernel test robot: + + drivers/firmware/efi/sysfb_efi.c:70:6: warning: no previous prototype for function 'efifb_setup_from_dmi' [-Wmissing-prototypes] + void efifb_setup_from_dmi(struct screen_info *si, const char *opt) + ^ + drivers/firmware/efi/sysfb_efi.c:70:1: note: declare 'static' if the function is not intended to be used outside of this translation unit + void efifb_setup_from_dmi(struct screen_info *si, const char *opt) + +Fixes: 8633ef82f101 ("drivers/firmware: consolidate EFI framebuffer setup for all arches") +Reported-by: kernel test robot +Cc: # 5.15.x +Signed-off-by: Javier Martinez Canillas +Acked-by: Thomas Zimmermann +Link: https://lore.kernel.org/r/20211126001333.555514-1-javierm@redhat.com +Signed-off-by: Ard Biesheuvel +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm/include/asm/efi.h | 1 - + arch/arm64/include/asm/efi.h | 1 - + arch/riscv/include/asm/efi.h | 1 - + arch/x86/include/asm/efi.h | 2 -- + include/linux/efi.h | 6 ++++++ + 5 files changed, 6 insertions(+), 5 deletions(-) + +--- a/arch/arm/include/asm/efi.h ++++ b/arch/arm/include/asm/efi.h +@@ -17,7 +17,6 @@ + + #ifdef CONFIG_EFI + void efi_init(void); +-extern void efifb_setup_from_dmi(struct screen_info *si, const char *opt); + + int efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md); + int efi_set_mapping_permissions(struct mm_struct *mm, efi_memory_desc_t *md); +--- a/arch/arm64/include/asm/efi.h ++++ b/arch/arm64/include/asm/efi.h +@@ -14,7 +14,6 @@ + + #ifdef CONFIG_EFI + extern void efi_init(void); +-extern void efifb_setup_from_dmi(struct screen_info *si, const char *opt); + #else + #define efi_init() + #endif +--- a/arch/riscv/include/asm/efi.h ++++ b/arch/riscv/include/asm/efi.h +@@ -13,7 +13,6 @@ + + #ifdef CONFIG_EFI + extern void efi_init(void); +-extern void efifb_setup_from_dmi(struct screen_info *si, const char *opt); + #else + #define efi_init() + #endif +--- a/arch/x86/include/asm/efi.h ++++ b/arch/x86/include/asm/efi.h +@@ -197,8 +197,6 @@ static inline bool efi_runtime_supported + + extern void parse_efi_setup(u64 phys_addr, u32 data_len); + +-extern void efifb_setup_from_dmi(struct screen_info *si, const char *opt); +- + extern void efi_thunk_runtime_setup(void); + efi_status_t efi_set_virtual_address_map(unsigned long memory_map_size, + unsigned long descriptor_size, +--- a/include/linux/efi.h ++++ b/include/linux/efi.h +@@ -1282,4 +1282,10 @@ static inline struct efi_mokvar_table_en + } + #endif + ++#ifdef CONFIG_SYSFB ++extern void efifb_setup_from_dmi(struct screen_info *si, const char *opt); ++#else ++static inline void efifb_setup_from_dmi(struct screen_info *si, const char *opt) { } ++#endif ++ + #endif /* _LINUX_EFI_H */ diff --git a/queue-5.15/powerpc-ptdump-fix-debug_wx-since-generic-ptdump-conversion.patch b/queue-5.15/powerpc-ptdump-fix-debug_wx-since-generic-ptdump-conversion.patch new file mode 100644 index 00000000000..13666569454 --- /dev/null +++ b/queue-5.15/powerpc-ptdump-fix-debug_wx-since-generic-ptdump-conversion.patch @@ -0,0 +1,36 @@ +From 8d84fca4375e3c35dadc16b8c7eee6821b2a575c Mon Sep 17 00:00:00 2001 +From: Michael Ellerman +Date: Fri, 3 Dec 2021 23:41:12 +1100 +Subject: powerpc/ptdump: Fix DEBUG_WX since generic ptdump conversion + +From: Michael Ellerman + +commit 8d84fca4375e3c35dadc16b8c7eee6821b2a575c upstream. + +In note_prot_wx() we bail out without reporting anything if +CONFIG_PPC_DEBUG_WX is disabled. + +But CONFIG_PPC_DEBUG_WX was removed in the conversion to generic ptdump, +we now need to use CONFIG_DEBUG_WX instead. + +Fixes: e084728393a5 ("powerpc/ptdump: Convert powerpc to GENERIC_PTDUMP") +Cc: stable@vger.kernel.org # v5.15+ +Signed-off-by: Michael Ellerman +Reviewed-by: Christophe Leroy +Link: https://lore.kernel.org/r/20211203124112.2912562-1-mpe@ellerman.id.au +Signed-off-by: Greg Kroah-Hartman +--- + arch/powerpc/mm/ptdump/ptdump.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/powerpc/mm/ptdump/ptdump.c ++++ b/arch/powerpc/mm/ptdump/ptdump.c +@@ -183,7 +183,7 @@ static void note_prot_wx(struct pg_state + { + pte_t pte = __pte(st->current_flags); + +- if (!IS_ENABLED(CONFIG_PPC_DEBUG_WX) || !st->check_wx) ++ if (!IS_ENABLED(CONFIG_DEBUG_WX) || !st->check_wx) + return; + + if (!pte_write(pte) || !pte_exec(pte)) diff --git a/queue-5.15/recordmcount.pl-fix-typo-in-s390-mcount-regex.patch b/queue-5.15/recordmcount.pl-fix-typo-in-s390-mcount-regex.patch new file mode 100644 index 00000000000..9e7a36cf9e1 --- /dev/null +++ b/queue-5.15/recordmcount.pl-fix-typo-in-s390-mcount-regex.patch @@ -0,0 +1,40 @@ +From 4eb1782eaa9fa1c224ad1fa0d13a9f09c3ab2d80 Mon Sep 17 00:00:00 2001 +From: Heiko Carstens +Date: Thu, 23 Dec 2021 17:43:14 +0100 +Subject: recordmcount.pl: fix typo in s390 mcount regex + +From: Heiko Carstens + +commit 4eb1782eaa9fa1c224ad1fa0d13a9f09c3ab2d80 upstream. + +Commit 85bf17b28f97 ("recordmcount.pl: look for jgnop instruction as well +as bcrl on s390") added a new alternative mnemonic for the existing brcl +instruction. This is required for the combination old gcc version (pre 9.0) +and binutils since version 2.37. +However at the same time this commit introduced a typo, replacing brcl with +bcrl. As a result no mcount locations are detected anymore with old gcc +versions (pre 9.0) and binutils before version 2.37. +Fix this by using the correct mnemonic again. + +Reported-by: Miroslav Benes +Cc: Jerome Marchand +Cc: +Fixes: 85bf17b28f97 ("recordmcount.pl: look for jgnop instruction as well as bcrl on s390") +Link: https://lore.kernel.org/r/alpine.LSU.2.21.2112230949520.19849@pobox.suse.cz +Signed-off-by: Heiko Carstens +Signed-off-by: Greg Kroah-Hartman +--- + scripts/recordmcount.pl | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/scripts/recordmcount.pl ++++ b/scripts/recordmcount.pl +@@ -219,7 +219,7 @@ if ($arch eq "x86_64") { + + } elsif ($arch eq "s390" && $bits == 64) { + if ($cc =~ /-DCC_USING_HOTPATCH/) { +- $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*c0 04 00 00 00 00\\s*(bcrl\\s*0,|jgnop\\s*)[0-9a-f]+ <([^\+]*)>\$"; ++ $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*c0 04 00 00 00 00\\s*(brcl\\s*0,|jgnop\\s*)[0-9a-f]+ <([^\+]*)>\$"; + $mcount_adjust = 0; + } + $alignment = 8; diff --git a/queue-5.15/selinux-initialize-proto-variable-in-selinux_ip_postroute_compat.patch b/queue-5.15/selinux-initialize-proto-variable-in-selinux_ip_postroute_compat.patch new file mode 100644 index 00000000000..f41943c31bf --- /dev/null +++ b/queue-5.15/selinux-initialize-proto-variable-in-selinux_ip_postroute_compat.patch @@ -0,0 +1,41 @@ +From 732bc2ff080c447f8524f40c970c481f5da6eed3 Mon Sep 17 00:00:00 2001 +From: Tom Rix +Date: Fri, 24 Dec 2021 07:07:39 -0800 +Subject: selinux: initialize proto variable in selinux_ip_postroute_compat() + +From: Tom Rix + +commit 732bc2ff080c447f8524f40c970c481f5da6eed3 upstream. + +Clang static analysis reports this warning + +hooks.c:5765:6: warning: 4th function call argument is an uninitialized + value + if (selinux_xfrm_postroute_last(sksec->sid, skb, &ad, proto)) + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +selinux_parse_skb() can return ok without setting proto. The later call +to selinux_xfrm_postroute_last() does an early check of proto and can +return ok if the garbage proto value matches. So initialize proto. + +Cc: stable@vger.kernel.org +Fixes: eef9b41622f2 ("selinux: cleanup selinux_xfrm_sock_rcv_skb() and selinux_xfrm_postroute_last()") +Signed-off-by: Tom Rix +[PM: typo/spelling and checkpatch.pl description fixes] +Signed-off-by: Paul Moore +Signed-off-by: Greg Kroah-Hartman +--- + security/selinux/hooks.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/security/selinux/hooks.c ++++ b/security/selinux/hooks.c +@@ -5812,7 +5812,7 @@ static unsigned int selinux_ip_postroute + struct common_audit_data ad; + struct lsm_network_audit net = {0,}; + char *addrp; +- u8 proto; ++ u8 proto = 0; + + if (sk == NULL) + return NF_ACCEPT; diff --git a/queue-5.15/series b/queue-5.15/series index b86278c5496..28aaa51e725 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -9,3 +9,7 @@ platform-x86-apple-gmux-use-resource_size-with-res.patch memblock-fix-memblock_phys_alloc-section-mismatch-er.patch alsa-hda-intel-sdw-acpi-harden-detection-of-controll.patch alsa-hda-intel-sdw-acpi-go-through-hdas-acpi-at-max-.patch +recordmcount.pl-fix-typo-in-s390-mcount-regex.patch +powerpc-ptdump-fix-debug_wx-since-generic-ptdump-conversion.patch +efi-move-efifb_setup_from_dmi-prototype-from-arch-headers.patch +selinux-initialize-proto-variable-in-selinux_ip_postroute_compat.patch