Skip to content

Commit 01f9550

Browse files
committed
Merge tag 'uml-for-linux-6.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux
Pull uml fix from Johannes Berg: "There's just a single fix here for the _nofault changes that were causing issues with clang, and then when we looked at it some other issues seemed to exist" * tag 'uml-for-linux-6.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux: um: fix _nofault accesses
2 parents 7b26feb + 68025ad commit 01f9550

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

arch/um/include/asm/uaccess.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ do { \
5555
goto err_label; \
5656
} \
5757
*((type *)dst) = get_unaligned((type *)(src)); \
58+
barrier(); \
5859
current->thread.segv_continue = NULL; \
5960
} while (0)
6061

@@ -66,6 +67,7 @@ do { \
6667
if (__faulted) \
6768
goto err_label; \
6869
put_unaligned(*((type *)src), (type *)(dst)); \
70+
barrier(); \
6971
current->thread.segv_continue = NULL; \
7072
} while (0)
7173

arch/um/kernel/trap.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -225,20 +225,20 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user,
225225
panic("Failed to sync kernel TLBs: %d", err);
226226
goto out;
227227
}
228-
else if (current->mm == NULL) {
229-
if (current->pagefault_disabled) {
230-
if (!mc) {
231-
show_regs(container_of(regs, struct pt_regs, regs));
232-
panic("Segfault with pagefaults disabled but no mcontext");
233-
}
234-
if (!current->thread.segv_continue) {
235-
show_regs(container_of(regs, struct pt_regs, regs));
236-
panic("Segfault without recovery target");
237-
}
238-
mc_set_rip(mc, current->thread.segv_continue);
239-
current->thread.segv_continue = NULL;
240-
goto out;
228+
else if (current->pagefault_disabled) {
229+
if (!mc) {
230+
show_regs(container_of(regs, struct pt_regs, regs));
231+
panic("Segfault with pagefaults disabled but no mcontext");
241232
}
233+
if (!current->thread.segv_continue) {
234+
show_regs(container_of(regs, struct pt_regs, regs));
235+
panic("Segfault without recovery target");
236+
}
237+
mc_set_rip(mc, current->thread.segv_continue);
238+
current->thread.segv_continue = NULL;
239+
goto out;
240+
}
241+
else if (current->mm == NULL) {
242242
show_regs(container_of(regs, struct pt_regs, regs));
243243
panic("Segfault with no mm");
244244
}

arch/x86/um/shared/sysdep/faultinfo_32.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ struct faultinfo {
3131

3232
#define ___backtrack_faulted(_faulted) \
3333
asm volatile ( \
34-
"mov $0, %0\n" \
3534
"movl $__get_kernel_nofault_faulted_%=,%1\n" \
35+
"mov $0, %0\n" \
3636
"jmp _end_%=\n" \
3737
"__get_kernel_nofault_faulted_%=:\n" \
3838
"mov $1, %0;" \

arch/x86/um/shared/sysdep/faultinfo_64.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ struct faultinfo {
3131

3232
#define ___backtrack_faulted(_faulted) \
3333
asm volatile ( \
34-
"mov $0, %0\n" \
3534
"movq $__get_kernel_nofault_faulted_%=,%1\n" \
35+
"mov $0, %0\n" \
3636
"jmp _end_%=\n" \
3737
"__get_kernel_nofault_faulted_%=:\n" \
3838
"mov $1, %0;" \

0 commit comments

Comments
 (0)