Skip to content

Commit 47003b9

Browse files
committed
Merge tag 'powerpc-5.10-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fix from Michael Ellerman: "One commit to implement copy_from_kernel_nofault_allowed(), otherwise copy_from_kernel_nofault() can trigger warnings when accessing bad addresses in some configurations. Thanks to Christophe Leroy and Qian Cai" * tag 'powerpc-5.10-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/mm: Fix KUAP warning by providing copy_from_kernel_nofault_allowed()
2 parents 197c61c + 5eedf9f commit 47003b9

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

arch/powerpc/mm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC)
77

8-
obj-y := fault.o mem.o pgtable.o mmap.o \
8+
obj-y := fault.o mem.o pgtable.o mmap.o maccess.o \
99
init_$(BITS).o pgtable_$(BITS).o \
1010
pgtable-frag.o ioremap.o ioremap_$(BITS).o \
1111
init-common.o mmu_context.o drmem.o

arch/powerpc/mm/maccess.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
3+
#include <linux/uaccess.h>
4+
#include <linux/kernel.h>
5+
6+
bool copy_from_kernel_nofault_allowed(const void *unsafe_src, size_t size)
7+
{
8+
return is_kernel_addr((unsigned long)unsafe_src);
9+
}

0 commit comments

Comments
 (0)