This is the start of the stable review cycle for the 4.14.271 release.
There are 18 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Fri, 11 Mar 2022 15:58:48 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.14.271-r…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.14.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.14.271-rc1
Emmanuel Gil Peyrot <linkmauve(a)linkmauve.fr>
ARM: fix build error when BPF_SYSCALL is disabled
Russell King (Oracle) <rmk+kernel(a)armlinux.org.uk>
ARM: include unprivileged BPF status in Spectre V2 reporting
Russell King (Oracle) <rmk+kernel(a)armlinux.org.uk>
ARM: Spectre-BHB workaround
Russell King (Oracle) <rmk+kernel(a)armlinux.org.uk>
ARM: use LOADADDR() to get load address of sections
Russell King (Oracle) <rmk+kernel(a)armlinux.org.uk>
ARM: early traps initialisation
Russell King (Oracle) <rmk+kernel(a)armlinux.org.uk>
ARM: report Spectre v2 status through sysfs
Mark Rutland <mark.rutland(a)arm.com>
arm/arm64: smccc/psci: add arm_smccc_1_1_get_conduit()
Steven Price <steven.price(a)arm.com>
arm/arm64: Provide a wrapper for SMCCC 1.1 calls
Josh Poimboeuf <jpoimboe(a)redhat.com>
x86/speculation: Warn about eIBRS + LFENCE + Unprivileged eBPF + SMT
Josh Poimboeuf <jpoimboe(a)redhat.com>
x86/speculation: Warn about Spectre v2 LFENCE mitigation
Kim Phillips <kim.phillips(a)amd.com>
x86/speculation: Update link to AMD speculation whitepaper
Kim Phillips <kim.phillips(a)amd.com>
x86/speculation: Use generic retpoline by default on AMD
Josh Poimboeuf <jpoimboe(a)redhat.com>
x86/speculation: Include unprivileged eBPF status in Spectre v2 mitigation reporting
Peter Zijlstra <peterz(a)infradead.org>
Documentation/hw-vuln: Update spectre doc
Peter Zijlstra <peterz(a)infradead.org>
x86/speculation: Add eIBRS + Retpoline options
Peter Zijlstra (Intel) <peterz(a)infradead.org>
x86/speculation: Rename RETPOLINE_AMD to RETPOLINE_LFENCE
Peter Zijlstra <peterz(a)infradead.org>
x86,bugs: Unconditionally allow spectre_v2=retpoline,amd
Borislav Petkov <bp(a)suse.de>
x86/speculation: Merge one test in spectre_v2_user_select_mitigation()
-------------
Diffstat:
Documentation/admin-guide/hw-vuln/spectre.rst | 48 ++++--
Documentation/admin-guide/kernel-parameters.txt | 8 +-
Makefile | 4 +-
arch/arm/include/asm/assembler.h | 10 ++
arch/arm/include/asm/spectre.h | 32 ++++
arch/arm/kernel/Makefile | 2 +
arch/arm/kernel/entry-armv.S | 79 ++++++++-
arch/arm/kernel/entry-common.S | 24 +++
arch/arm/kernel/spectre.c | 71 ++++++++
arch/arm/kernel/traps.c | 65 ++++++-
arch/arm/kernel/vmlinux-xip.lds.S | 37 ++--
arch/arm/kernel/vmlinux.lds.S | 37 ++--
arch/arm/mm/Kconfig | 11 ++
arch/arm/mm/proc-v7-bugs.c | 198 +++++++++++++++++++---
arch/x86/include/asm/cpufeatures.h | 2 +-
arch/x86/include/asm/nospec-branch.h | 16 +-
arch/x86/kernel/cpu/bugs.c | 214 +++++++++++++++++-------
drivers/firmware/psci.c | 15 ++
include/linux/arm-smccc.h | 74 ++++++++
include/linux/bpf.h | 11 ++
kernel/sysctl.c | 8 +
tools/arch/x86/include/asm/cpufeatures.h | 2 +-
22 files changed, 822 insertions(+), 146 deletions(-)
This is the start of the stable review cycle for the 5.4.184 release.
There are 18 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Fri, 11 Mar 2022 15:58:48 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.184-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 5.4.184-rc1
Emmanuel Gil Peyrot <linkmauve(a)linkmauve.fr>
ARM: fix build error when BPF_SYSCALL is disabled
Russell King (Oracle) <rmk+kernel(a)armlinux.org.uk>
ARM: include unprivileged BPF status in Spectre V2 reporting
Russell King (Oracle) <rmk+kernel(a)armlinux.org.uk>
ARM: Spectre-BHB workaround
Russell King (Oracle) <rmk+kernel(a)armlinux.org.uk>
ARM: use LOADADDR() to get load address of sections
Russell King (Oracle) <rmk+kernel(a)armlinux.org.uk>
ARM: early traps initialisation
Russell King (Oracle) <rmk+kernel(a)armlinux.org.uk>
ARM: report Spectre v2 status through sysfs
Mark Rutland <mark.rutland(a)arm.com>
arm/arm64: smccc/psci: add arm_smccc_1_1_get_conduit()
Steven Price <steven.price(a)arm.com>
arm/arm64: Provide a wrapper for SMCCC 1.1 calls
Josh Poimboeuf <jpoimboe(a)redhat.com>
x86/speculation: Warn about eIBRS + LFENCE + Unprivileged eBPF + SMT
Josh Poimboeuf <jpoimboe(a)redhat.com>
x86/speculation: Warn about Spectre v2 LFENCE mitigation
Kim Phillips <kim.phillips(a)amd.com>
x86/speculation: Update link to AMD speculation whitepaper
Kim Phillips <kim.phillips(a)amd.com>
x86/speculation: Use generic retpoline by default on AMD
Josh Poimboeuf <jpoimboe(a)redhat.com>
x86/speculation: Include unprivileged eBPF status in Spectre v2 mitigation reporting
Peter Zijlstra <peterz(a)infradead.org>
Documentation/hw-vuln: Update spectre doc
Peter Zijlstra <peterz(a)infradead.org>
x86/speculation: Add eIBRS + Retpoline options
Peter Zijlstra (Intel) <peterz(a)infradead.org>
x86/speculation: Rename RETPOLINE_AMD to RETPOLINE_LFENCE
Peter Zijlstra <peterz(a)infradead.org>
x86,bugs: Unconditionally allow spectre_v2=retpoline,amd
Borislav Petkov <bp(a)suse.de>
x86/speculation: Merge one test in spectre_v2_user_select_mitigation()
-------------
Diffstat:
Documentation/admin-guide/hw-vuln/spectre.rst | 48 ++++--
Documentation/admin-guide/kernel-parameters.txt | 8 +-
Makefile | 4 +-
arch/arm/include/asm/assembler.h | 10 ++
arch/arm/include/asm/spectre.h | 32 ++++
arch/arm/kernel/Makefile | 2 +
arch/arm/kernel/entry-armv.S | 79 ++++++++-
arch/arm/kernel/entry-common.S | 24 +++
arch/arm/kernel/spectre.c | 71 ++++++++
arch/arm/kernel/traps.c | 65 ++++++-
arch/arm/kernel/vmlinux.lds.h | 35 +++-
arch/arm/mm/Kconfig | 11 ++
arch/arm/mm/proc-v7-bugs.c | 199 +++++++++++++++++++---
arch/x86/include/asm/cpufeatures.h | 2 +-
arch/x86/include/asm/nospec-branch.h | 16 +-
arch/x86/kernel/cpu/bugs.c | 216 +++++++++++++++++-------
drivers/firmware/psci/psci.c | 15 ++
include/linux/arm-smccc.h | 74 ++++++++
include/linux/bpf.h | 12 ++
kernel/sysctl.c | 8 +
tools/arch/x86/include/asm/cpufeatures.h | 2 +-
21 files changed, 796 insertions(+), 137 deletions(-)
This is a complement of f6795053dac8 ("mm: mmap: Allow for "high"
userspace addresses") for hugetlb.
This patch adds support for "high" userspace addresses that are
optionally supported on the system and have to be requested via a hint
mechanism ("high" addr parameter to mmap).
Architectures such as powerpc and x86 achieve this by making changes to
their architectural versions of hugetlb_get_unmapped_area() function.
However, arm64 uses the generic version of that function.
So take into account arch_get_mmap_base() and arch_get_mmap_end() in
hugetlb_get_unmapped_area(). To allow that, move those two macros
out of mm/mmap.c into include/linux/sched/mm.h
If these macros are not defined in architectural code then they default
to (TASK_SIZE) and (base) so should not introduce any behavioural
changes to architectures that do not define them.
For the time being, only ARM64 is affected by this change.
Signed-off-by: Christophe Leroy <christophe.leroy(a)csgroup.eu>
Cc: Steve Capper <steve.capper(a)arm.com>
Cc: Will Deacon <will.deacon(a)arm.com>
Cc: Catalin Marinas <catalin.marinas(a)arm.com>
Fixes: f6795053dac8 ("mm: mmap: Allow for "high" userspace addresses")
Cc: <stable(a)vger.kernel.org> # 5.0.x
Reviewed-by: Catalin Marinas <catalin.marinas(a)arm.com>
---
fs/hugetlbfs/inode.c | 9 +++++----
include/linux/sched/mm.h | 8 ++++++++
mm/mmap.c | 8 --------
3 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index ba15a85c7dfb..73f0a1f94d78 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -205,7 +205,7 @@ hugetlb_get_unmapped_area_bottomup(struct file *file, unsigned long addr,
info.flags = 0;
info.length = len;
info.low_limit = current->mm->mmap_base;
- info.high_limit = TASK_SIZE;
+ info.high_limit = arch_get_mmap_end(addr, len, flags);
info.align_mask = PAGE_MASK & ~huge_page_mask(h);
info.align_offset = 0;
return vm_unmapped_area(&info);
@@ -221,7 +221,7 @@ hugetlb_get_unmapped_area_topdown(struct file *file, unsigned long addr,
info.flags = VM_UNMAPPED_AREA_TOPDOWN;
info.length = len;
info.low_limit = max(PAGE_SIZE, mmap_min_addr);
- info.high_limit = current->mm->mmap_base;
+ info.high_limit = arch_get_mmap_base(addr, current->mm->mmap_base);
info.align_mask = PAGE_MASK & ~huge_page_mask(h);
info.align_offset = 0;
addr = vm_unmapped_area(&info);
@@ -236,7 +236,7 @@ hugetlb_get_unmapped_area_topdown(struct file *file, unsigned long addr,
VM_BUG_ON(addr != -ENOMEM);
info.flags = 0;
info.low_limit = current->mm->mmap_base;
- info.high_limit = TASK_SIZE;
+ info.high_limit = arch_get_mmap_end(addr, len, flags);
addr = vm_unmapped_area(&info);
}
@@ -251,6 +251,7 @@ generic_hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
struct mm_struct *mm = current->mm;
struct vm_area_struct *vma;
struct hstate *h = hstate_file(file);
+ const unsigned long mmap_end = arch_get_mmap_end(addr, len, flags);
if (len & ~huge_page_mask(h))
return -EINVAL;
@@ -266,7 +267,7 @@ generic_hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
if (addr) {
addr = ALIGN(addr, huge_page_size(h));
vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
+ if (mmap_end - len >= addr &&
(!vma || addr + len <= vm_start_gap(vma)))
return addr;
}
diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h
index 1dcf54360aea..319bbf90cc96 100644
--- a/include/linux/sched/mm.h
+++ b/include/linux/sched/mm.h
@@ -135,6 +135,14 @@ static inline void mm_update_next_owner(struct mm_struct *mm)
#endif /* CONFIG_MEMCG */
#ifdef CONFIG_MMU
+#ifndef arch_get_mmap_end
+#define arch_get_mmap_end(addr, len, flags) (TASK_SIZE)
+#endif
+
+#ifndef arch_get_mmap_base
+#define arch_get_mmap_base(addr, base) (base)
+#endif
+
extern void arch_pick_mmap_layout(struct mm_struct *mm,
struct rlimit *rlim_stack);
extern unsigned long
diff --git a/mm/mmap.c b/mm/mmap.c
index 18cd52620719..b52e6df32ddf 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2119,14 +2119,6 @@ unsigned long vm_unmapped_area(struct vm_unmapped_area_info *info)
return addr;
}
-#ifndef arch_get_mmap_end
-#define arch_get_mmap_end(addr, len, flags) (TASK_SIZE)
-#endif
-
-#ifndef arch_get_mmap_base
-#define arch_get_mmap_base(addr, base) (base)
-#endif
-
/* Get an address range which is currently unmapped.
* For shmat() with addr=0.
*
--
2.34.1