diff options
-rw-r--r-- | arch/x86/ia32/ia32_signal.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/signal_64.c | 11 |
2 files changed, 7 insertions, 8 deletions
diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c index 0866104f684c..bbed3a26ce55 100644 --- a/arch/x86/ia32/ia32_signal.c +++ b/arch/x86/ia32/ia32_signal.c | |||
@@ -499,8 +499,6 @@ int ia32_setup_frame(int sig, struct k_sigaction *ka, | |||
499 | regs->cs = __USER32_CS; | 499 | regs->cs = __USER32_CS; |
500 | regs->ss = __USER32_DS; | 500 | regs->ss = __USER32_DS; |
501 | 501 | ||
502 | set_fs(USER_DS); | ||
503 | |||
504 | #if DEBUG_SIG | 502 | #if DEBUG_SIG |
505 | printk(KERN_DEBUG "SIG deliver (%s:%d): sp=%p pc=%lx ra=%u\n", | 503 | printk(KERN_DEBUG "SIG deliver (%s:%d): sp=%p pc=%lx ra=%u\n", |
506 | current->comm, current->pid, frame, regs->ip, frame->pretcode); | 504 | current->comm, current->pid, frame, regs->ip, frame->pretcode); |
@@ -596,8 +594,6 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
596 | regs->cs = __USER32_CS; | 594 | regs->cs = __USER32_CS; |
597 | regs->ss = __USER32_DS; | 595 | regs->ss = __USER32_DS; |
598 | 596 | ||
599 | set_fs(USER_DS); | ||
600 | |||
601 | #if DEBUG_SIG | 597 | #if DEBUG_SIG |
602 | printk(KERN_DEBUG "SIG deliver (%s:%d): sp=%p pc=%lx ra=%u\n", | 598 | printk(KERN_DEBUG "SIG deliver (%s:%d): sp=%p pc=%lx ra=%u\n", |
603 | current->comm, current->pid, frame, regs->ip, frame->pretcode); | 599 | current->comm, current->pid, frame, regs->ip, frame->pretcode); |
diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c index 3a76702dc3f1..ccb2a4560c2d 100644 --- a/arch/x86/kernel/signal_64.c +++ b/arch/x86/kernel/signal_64.c | |||
@@ -285,10 +285,6 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
285 | even if the handler happens to be interrupting 32-bit code. */ | 285 | even if the handler happens to be interrupting 32-bit code. */ |
286 | regs->cs = __USER_CS; | 286 | regs->cs = __USER_CS; |
287 | 287 | ||
288 | /* This, by contrast, has nothing to do with segment registers - | ||
289 | see include/asm-x86_64/uaccess.h for details. */ | ||
290 | set_fs(USER_DS); | ||
291 | |||
292 | return 0; | 288 | return 0; |
293 | 289 | ||
294 | give_sigsegv: | 290 | give_sigsegv: |
@@ -377,6 +373,13 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, | |||
377 | 373 | ||
378 | if (ret == 0) { | 374 | if (ret == 0) { |
379 | /* | 375 | /* |
376 | * This has nothing to do with segment registers, | ||
377 | * despite the name. This magic affects uaccess.h | ||
378 | * macros' behavior. Reset it to the normal setting. | ||
379 | */ | ||
380 | set_fs(USER_DS); | ||
381 | |||
382 | /* | ||
380 | * Clear the direction flag as per the ABI for function entry. | 383 | * Clear the direction flag as per the ABI for function entry. |
381 | */ | 384 | */ |
382 | regs->flags &= ~X86_EFLAGS_DF; | 385 | regs->flags &= ~X86_EFLAGS_DF; |