summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-04-20 16:36:46 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2026-04-20 16:36:46 -0700
commit065c4e67cc2c40e6dd94649e8e720096fbabd4ee (patch)
tree66ace466db18ea9f680810697e86765c946f29c8 /arch
parentb66cb4f156fe47f52065e70eb1b2f12ccd0c2884 (diff)
parent6522fe5c1b007c376fc5f2de1016c99a18b0af8e (diff)
Merge tag 'uml-for-7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux
Pull uml updates from Johannes Berg: "Mostly cleanups and small things, notably: - musl libc compatibility - vDSO installation fix - TLB sync race fix for recent SMP support - build fix for 32-bit with Clang 20/21" * tag 'uml-for-7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux: um: Disable GCOV_PROFILE_ALL on 32-bit UML with Clang 20/21 um: drivers: call kernel_strrchr() explicitly in cow_user.c um: Replace strncpy() with strnlen()+memcpy_and_pad() in strncpy_chunk_from_user() x86/um: fix vDSO installation um: Remove CONFIG_FRAME_WARN from x86_64_defconfig um: Fix pte_read() and pte_exec() for kernel mappings um: Fix potential race condition in TLB sync um: time-travel: clean up kernel-doc warnings um: avoid struct sigcontext redefinition with musl um: fix address-of CMSG_DATA() rvalue in stub
Diffstat (limited to 'arch')
-rw-r--r--arch/um/Kconfig4
-rw-r--r--arch/um/configs/x86_64_defconfig1
-rw-r--r--arch/um/drivers/cow_user.c8
-rw-r--r--arch/um/include/asm/pgtable.h9
-rw-r--r--arch/um/kernel/skas/stub.c2
-rw-r--r--arch/um/kernel/skas/uaccess.c4
-rw-r--r--arch/um/kernel/tlb.c4
-rw-r--r--arch/x86/Makefile.um2
-rw-r--r--arch/x86/um/os-Linux/mcontext.c6
-rw-r--r--arch/x86/um/vdso/Makefile2
10 files changed, 27 insertions, 15 deletions
diff --git a/arch/um/Kconfig b/arch/um/Kconfig
index 098cda44db22..d9541d13d9eb 100644
--- a/arch/um/Kconfig
+++ b/arch/um/Kconfig
@@ -11,7 +11,9 @@ config UML
select ARCH_HAS_CACHE_LINE_SIZE
select ARCH_HAS_CPU_FINALIZE_INIT
select ARCH_HAS_FORTIFY_SOURCE
- select ARCH_HAS_GCOV_PROFILE_ALL
+ # Clang 20 & 21 miscompute __builtin_object_size() under -fprofile-arcs
+ # on 32-bit, causing spurious compile-time errors in check_copy_size().
+ select ARCH_HAS_GCOV_PROFILE_ALL if !(!64BIT && CLANG_VERSION >= 200000 && CLANG_VERSION < 220100)
select ARCH_HAS_KCOV
select ARCH_HAS_STRNCPY_FROM_USER
select ARCH_HAS_STRNLEN_USER
diff --git a/arch/um/configs/x86_64_defconfig b/arch/um/configs/x86_64_defconfig
index cf309c5406a2..af6ff784e2d3 100644
--- a/arch/um/configs/x86_64_defconfig
+++ b/arch/um/configs/x86_64_defconfig
@@ -60,5 +60,4 @@ CONFIG_PROC_KCORE=y
CONFIG_TMPFS=y
CONFIG_NLS=y
CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
-CONFIG_FRAME_WARN=1024
CONFIG_DEBUG_KERNEL=y
diff --git a/arch/um/drivers/cow_user.c b/arch/um/drivers/cow_user.c
index 29b46581ddd1..dc1d1bcd85ec 100644
--- a/arch/um/drivers/cow_user.c
+++ b/arch/um/drivers/cow_user.c
@@ -15,6 +15,12 @@
#include "cow.h"
#include "cow_sys.h"
+/*
+ * arch/um/Makefile remaps strrchr to kernel_strrchr; call the kernel
+ * name directly to avoid glibc >= 2.43's C23 strrchr macro.
+ */
+char *kernel_strrchr(const char *, int);
+
#define PATH_LEN_V1 256
/* unsigned time_t works until year 2106 */
@@ -153,7 +159,7 @@ static int absolutize(char *to, int size, char *from)
errno);
return -1;
}
- slash = strrchr(from, '/');
+ slash = kernel_strrchr(from, '/');
if (slash != NULL) {
*slash = '\0';
if (chdir(from)) {
diff --git a/arch/um/include/asm/pgtable.h b/arch/um/include/asm/pgtable.h
index 19e0608fb649..88ea8434364d 100644
--- a/arch/um/include/asm/pgtable.h
+++ b/arch/um/include/asm/pgtable.h
@@ -112,13 +112,12 @@ static inline int pte_none(pte_t pte)
*/
static inline int pte_read(pte_t pte)
{
- return((pte_get_bits(pte, _PAGE_USER)) &&
- !(pte_get_bits(pte, _PAGE_PROTNONE)));
+ return !pte_get_bits(pte, _PAGE_PROTNONE);
}
-static inline int pte_exec(pte_t pte){
- return((pte_get_bits(pte, _PAGE_USER)) &&
- !(pte_get_bits(pte, _PAGE_PROTNONE)));
+static inline int pte_exec(pte_t pte)
+{
+ return !pte_get_bits(pte, _PAGE_PROTNONE);
}
static inline int pte_write(pte_t pte)
diff --git a/arch/um/kernel/skas/stub.c b/arch/um/kernel/skas/stub.c
index 67cab46a602c..e09216a20cb5 100644
--- a/arch/um/kernel/skas/stub.c
+++ b/arch/um/kernel/skas/stub.c
@@ -146,7 +146,7 @@ restart_wait:
/* Receive the FDs */
num_fds = 0;
fd_msg = msghdr.msg_control;
- fd_map = (void *)&CMSG_DATA(fd_msg);
+ fd_map = (void *)CMSG_DATA(fd_msg);
if (res == iov.iov_len && msghdr.msg_controllen > sizeof(struct cmsghdr))
num_fds = (fd_msg->cmsg_len - CMSG_LEN(0)) / sizeof(int);
diff --git a/arch/um/kernel/skas/uaccess.c b/arch/um/kernel/skas/uaccess.c
index 198269e384c4..caef1deef795 100644
--- a/arch/um/kernel/skas/uaccess.c
+++ b/arch/um/kernel/skas/uaccess.c
@@ -170,8 +170,8 @@ static int strncpy_chunk_from_user(unsigned long from, int len, void *arg)
char **to_ptr = arg, *to = *to_ptr;
int n;
- strncpy(to, (void *) from, len);
- n = strnlen(to, len);
+ n = strnlen((void *) from, len);
+ memcpy_and_pad(to, len, (void *) from, n, 0);
*to_ptr += n;
if (n < len)
diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c
index 39608cccf2c6..1f175716b474 100644
--- a/arch/um/kernel/tlb.c
+++ b/arch/um/kernel/tlb.c
@@ -29,10 +29,9 @@ static int kern_map(struct mm_id *mm_idp,
unsigned long virt, unsigned long len, int prot,
int phys_fd, unsigned long long offset)
{
- /* TODO: Why is executable needed to be always set in the kernel? */
return os_map_memory((void *)virt, phys_fd, offset, len,
prot & UM_PROT_READ, prot & UM_PROT_WRITE,
- 1);
+ prot & UM_PROT_EXEC);
}
static int kern_unmap(struct mm_id *mm_idp,
@@ -165,6 +164,7 @@ int um_tlb_sync(struct mm_struct *mm)
unsigned long addr, next;
int ret = 0;
+ guard(spinlock_irqsave)(&mm->page_table_lock);
guard(spinlock_irqsave)(&mm->context.sync_tlb_lock);
if (mm->context.sync_tlb_range_to == 0)
diff --git a/arch/x86/Makefile.um b/arch/x86/Makefile.um
index c86cbd9cbba3..19c13afa474e 100644
--- a/arch/x86/Makefile.um
+++ b/arch/x86/Makefile.um
@@ -60,4 +60,6 @@ ELF_FORMAT := elf64-x86-64
LINK-$(CONFIG_LD_SCRIPT_DYN_RPATH) += -Wl,-rpath,/lib64
LINK-y += -m64
+vdso-install-y += arch/x86/um/vdso/vdso.so.dbg
+
endif
diff --git a/arch/x86/um/os-Linux/mcontext.c b/arch/x86/um/os-Linux/mcontext.c
index a21403df6663..b1580df80b3f 100644
--- a/arch/x86/um/os-Linux/mcontext.c
+++ b/arch/x86/um/os-Linux/mcontext.c
@@ -4,7 +4,13 @@
#include <linux/string.h>
#include <sys/ucontext.h>
#include <asm/ptrace.h>
+/*
+ * musl defines struct sigcontext in <bits/signal.h>. Rename the kernel's
+ * copy to avoid redefinition while keeping the FP-state types available.
+ */
+#define sigcontext __kernel_sigcontext
#include <asm/sigcontext.h>
+#undef sigcontext
#include <sysdep/ptrace.h>
#include <sysdep/mcontext.h>
#include <arch.h>
diff --git a/arch/x86/um/vdso/Makefile b/arch/x86/um/vdso/Makefile
index 8a7c8b37cb6e..7664cbedbe30 100644
--- a/arch/x86/um/vdso/Makefile
+++ b/arch/x86/um/vdso/Makefile
@@ -3,8 +3,6 @@
# Building vDSO images for x86.
#
-vdso-install-y += vdso.so
-
# files to link into the vdso
vobjs-y := vdso-note.o um_vdso.o