mirror of
https://github.com/torvalds/linux.git
synced 2026-05-15 01:43:11 +02:00
Nathan reported [1] that when built with clang, the um kernel
crashes pretty much immediately. This turned out to be an issue
with the inline assembly I had added, when clang used %rax/%eax
for both operands. Reorder it so current->thread.segv_continue
is written first, and then the lifetime of _faulted won't have
overlap with the lifetime of segv_continue.
In the email thread Benjamin also pointed out that current->mm
is only NULL for true kernel tasks, but we could do this for a
userspace task, so the current->thread.segv_continue logic must
be lifted out of the mm==NULL check.
Finally, while looking at this, put a barrier() so the NULL
assignment to thread.segv_continue cannot be reorder before
the possibly faulting operation.
Reported-by: Nathan Chancellor <nathan@kernel.org>
Closes: https://lore.kernel.org/r/20250402221254.GA384@ax162 [1]
Fixes:
|
||
|---|---|---|
| .. | ||
| skas | ||
| asm-offsets.c | ||
| config.c.in | ||
| dtb.c | ||
| dyn.lds.S | ||
| early_printk.c | ||
| exec.c | ||
| exitcode.c | ||
| gprof_syms.c | ||
| initrd.c | ||
| ioport.c | ||
| irq.c | ||
| kmsg_dump.c | ||
| ksyms.c | ||
| load_file.c | ||
| Makefile | ||
| mem.c | ||
| physmem.c | ||
| process.c | ||
| ptrace.c | ||
| reboot.c | ||
| sigio.c | ||
| signal.c | ||
| stacktrace.c | ||
| sysrq.c | ||
| time.c | ||
| tlb.c | ||
| trap.c | ||
| um_arch.c | ||
| um_arch.h | ||
| umid.c | ||
| uml.lds.S | ||
| vmlinux.lds.S | ||