From: Greg Kroah-Hartman Date: Sun, 17 Jan 2021 14:32:36 +0000 (+0100) Subject: 4.4-stable patches X-Git-Tag: v4.19.169~28 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b89e1df957f3b42676b27a2609499a23b771872d;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: mips-fix-malformed-nt_file-and-nt_siginfo-in-32bit-coredumps.patch mm-hugetlb-fix-potential-missing-huge-page-size-info.patch --- diff --git a/queue-4.4/mips-fix-malformed-nt_file-and-nt_siginfo-in-32bit-coredumps.patch b/queue-4.4/mips-fix-malformed-nt_file-and-nt_siginfo-in-32bit-coredumps.patch new file mode 100644 index 00000000000..f6a0eba8bba --- /dev/null +++ b/queue-4.4/mips-fix-malformed-nt_file-and-nt_siginfo-in-32bit-coredumps.patch @@ -0,0 +1,61 @@ +From 698222457465ce343443be81c5512edda86e5914 Mon Sep 17 00:00:00 2001 +From: Al Viro +Date: Thu, 24 Dec 2020 19:44:38 +0000 +Subject: MIPS: Fix malformed NT_FILE and NT_SIGINFO in 32bit coredumps + +From: Al Viro + +commit 698222457465ce343443be81c5512edda86e5914 upstream. + +Patches that introduced NT_FILE and NT_SIGINFO notes back in 2012 +had taken care of native (fs/binfmt_elf.c) and compat (fs/compat_binfmt_elf.c) +coredumps; unfortunately, compat on mips (which does not go through the +usual compat_binfmt_elf.c) had not been noticed. + +As the result, both N32 and O32 coredumps on 64bit mips kernels +have those sections malformed enough to confuse the living hell out of +all gdb and readelf versions (up to and including the tip of binutils-gdb.git). + +Longer term solution is to make both O32 and N32 compat use the +regular compat_binfmt_elf.c, but that's too much for backports. The minimal +solution is to do in arch/mips/kernel/binfmt_elf[on]32.c the same thing +those patches have done in fs/compat_binfmt_elf.c + +Cc: stable@kernel.org # v3.7+ +Signed-off-by: Al Viro +Signed-off-by: Thomas Bogendoerfer +Signed-off-by: Greg Kroah-Hartman + +--- + arch/mips/kernel/binfmt_elfn32.c | 7 +++++++ + arch/mips/kernel/binfmt_elfo32.c | 7 +++++++ + 2 files changed, 14 insertions(+) + +--- a/arch/mips/kernel/binfmt_elfn32.c ++++ b/arch/mips/kernel/binfmt_elfn32.c +@@ -130,4 +130,11 @@ cputime_to_compat_timeval(const cputime_ + value->tv_sec = jiffies / HZ; + } + ++/* ++ * Some data types as stored in coredump. ++ */ ++#define user_long_t compat_long_t ++#define user_siginfo_t compat_siginfo_t ++#define copy_siginfo_to_external copy_siginfo_to_external32 ++ + #include "../../../fs/binfmt_elf.c" +--- a/arch/mips/kernel/binfmt_elfo32.c ++++ b/arch/mips/kernel/binfmt_elfo32.c +@@ -149,4 +149,11 @@ cputime_to_compat_timeval(const cputime_ + value->tv_sec = jiffies / HZ; + } + ++/* ++ * Some data types as stored in coredump. ++ */ ++#define user_long_t compat_long_t ++#define user_siginfo_t compat_siginfo_t ++#define copy_siginfo_to_external copy_siginfo_to_external32 ++ + #include "../../../fs/binfmt_elf.c" diff --git a/queue-4.4/mm-hugetlb-fix-potential-missing-huge-page-size-info.patch b/queue-4.4/mm-hugetlb-fix-potential-missing-huge-page-size-info.patch new file mode 100644 index 00000000000..eb0e919b37d --- /dev/null +++ b/queue-4.4/mm-hugetlb-fix-potential-missing-huge-page-size-info.patch @@ -0,0 +1,36 @@ +From 0eb98f1588c2cc7a79816d84ab18a55d254f481c Mon Sep 17 00:00:00 2001 +From: Miaohe Lin +Date: Tue, 12 Jan 2021 15:49:24 -0800 +Subject: mm/hugetlb: fix potential missing huge page size info + +From: Miaohe Lin + +commit 0eb98f1588c2cc7a79816d84ab18a55d254f481c upstream. + +The huge page size is encoded for VM_FAULT_HWPOISON errors only. So if +we return VM_FAULT_HWPOISON, huge page size would just be ignored. + +Link: https://lkml.kernel.org/r/20210107123449.38481-1-linmiaohe@huawei.com +Fixes: aa50d3a7aa81 ("Encode huge page size for VM_FAULT_HWPOISON errors") +Signed-off-by: Miaohe Lin +Reviewed-by: Mike Kravetz +Cc: +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + mm/hugetlb.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/mm/hugetlb.c ++++ b/mm/hugetlb.c +@@ -3659,7 +3659,7 @@ retry: + * So we need to block hugepage fault by PG_hwpoison bit check. + */ + if (unlikely(PageHWPoison(page))) { +- ret = VM_FAULT_HWPOISON | ++ ret = VM_FAULT_HWPOISON_LARGE | + VM_FAULT_SET_HINDEX(hstate_index(h)); + goto backout_unlocked; + } diff --git a/queue-4.4/series b/queue-4.4/series index f309d636bdb..69729bc35fa 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -1 +1,3 @@ asoc-dapm-remove-widget-from-dirty-list-on-free.patch +mips-fix-malformed-nt_file-and-nt_siginfo-in-32bit-coredumps.patch +mm-hugetlb-fix-potential-missing-huge-page-size-info.patch