| .. | .. |
|---|
| 28 | 28 | #include <linux/tracehook.h> |
|---|
| 29 | 29 | #include <asm/ucontext.h> |
|---|
| 30 | 30 | #include <linux/uaccess.h> |
|---|
| 31 | | -#include <asm/pgtable.h> |
|---|
| 32 | 31 | #include <asm/cacheflush.h> |
|---|
| 33 | 32 | #include <asm/syscalls.h> |
|---|
| 34 | 33 | #include <asm/fpu.h> |
|---|
| .. | .. |
|---|
| 116 | 115 | restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *r0_p) |
|---|
| 117 | 116 | { |
|---|
| 118 | 117 | unsigned int err = 0; |
|---|
| 118 | + unsigned int sr = regs->sr & ~SR_USER_MASK; |
|---|
| 119 | 119 | |
|---|
| 120 | 120 | #define COPY(x) err |= __get_user(regs->x, &sc->sc_##x) |
|---|
| 121 | 121 | COPY(regs[1]); |
|---|
| .. | .. |
|---|
| 130 | 130 | COPY(macl); COPY(pr); |
|---|
| 131 | 131 | COPY(sr); COPY(pc); |
|---|
| 132 | 132 | #undef COPY |
|---|
| 133 | + |
|---|
| 134 | + regs->sr = (regs->sr & SR_USER_MASK) | sr; |
|---|
| 133 | 135 | |
|---|
| 134 | 136 | #ifdef CONFIG_SH_FPU |
|---|
| 135 | 137 | if (boot_cpu_data.flags & CPU_HAS_FPU) { |
|---|
| .. | .. |
|---|
| 160 | 162 | /* Always make any pending restarted system calls return -EINTR */ |
|---|
| 161 | 163 | current->restart_block.fn = do_no_restart_syscall; |
|---|
| 162 | 164 | |
|---|
| 163 | | - if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) |
|---|
| 165 | + if (!access_ok(frame, sizeof(*frame))) |
|---|
| 164 | 166 | goto badframe; |
|---|
| 165 | 167 | |
|---|
| 166 | 168 | if (__get_user(set.sig[0], &frame->sc.oldmask) |
|---|
| .. | .. |
|---|
| 176 | 178 | return r0; |
|---|
| 177 | 179 | |
|---|
| 178 | 180 | badframe: |
|---|
| 179 | | - force_sig(SIGSEGV, current); |
|---|
| 181 | + force_sig(SIGSEGV); |
|---|
| 180 | 182 | return 0; |
|---|
| 181 | 183 | } |
|---|
| 182 | 184 | |
|---|
| .. | .. |
|---|
| 190 | 192 | /* Always make any pending restarted system calls return -EINTR */ |
|---|
| 191 | 193 | current->restart_block.fn = do_no_restart_syscall; |
|---|
| 192 | 194 | |
|---|
| 193 | | - if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) |
|---|
| 195 | + if (!access_ok(frame, sizeof(*frame))) |
|---|
| 194 | 196 | goto badframe; |
|---|
| 195 | 197 | |
|---|
| 196 | 198 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
|---|
| .. | .. |
|---|
| 207 | 209 | return r0; |
|---|
| 208 | 210 | |
|---|
| 209 | 211 | badframe: |
|---|
| 210 | | - force_sig(SIGSEGV, current); |
|---|
| 212 | + force_sig(SIGSEGV); |
|---|
| 211 | 213 | return 0; |
|---|
| 212 | 214 | } |
|---|
| 213 | 215 | |
|---|
| .. | .. |
|---|
| 272 | 274 | |
|---|
| 273 | 275 | frame = get_sigframe(&ksig->ka, regs->regs[15], sizeof(*frame)); |
|---|
| 274 | 276 | |
|---|
| 275 | | - if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) |
|---|
| 277 | + if (!access_ok(frame, sizeof(*frame))) |
|---|
| 276 | 278 | return -EFAULT; |
|---|
| 277 | 279 | |
|---|
| 278 | 280 | err |= setup_sigcontext(&frame->sc, regs, set->sig[0]); |
|---|
| .. | .. |
|---|
| 338 | 340 | |
|---|
| 339 | 341 | frame = get_sigframe(&ksig->ka, regs->regs[15], sizeof(*frame)); |
|---|
| 340 | 342 | |
|---|
| 341 | | - if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) |
|---|
| 343 | + if (!access_ok(frame, sizeof(*frame))) |
|---|
| 342 | 344 | return -EFAULT; |
|---|
| 343 | 345 | |
|---|
| 344 | 346 | err |= copy_siginfo_to_user(&frame->info, &ksig->info); |
|---|
| .. | .. |
|---|
| 419 | 421 | case -ERESTARTSYS: |
|---|
| 420 | 422 | if (!(sa->sa_flags & SA_RESTART)) |
|---|
| 421 | 423 | goto no_system_call_restart; |
|---|
| 422 | | - /* fallthrough */ |
|---|
| 424 | + fallthrough; |
|---|
| 423 | 425 | case -ERESTARTNOINTR: |
|---|
| 424 | 426 | regs->regs[0] = save_r0; |
|---|
| 425 | 427 | regs->pc -= instruction_size(__raw_readw(regs->pc - 4)); |
|---|
| .. | .. |
|---|
| 500 | 502 | unsigned long thread_info_flags) |
|---|
| 501 | 503 | { |
|---|
| 502 | 504 | /* deal with pending signal delivery */ |
|---|
| 503 | | - if (thread_info_flags & _TIF_SIGPENDING) |
|---|
| 505 | + if (thread_info_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL)) |
|---|
| 504 | 506 | do_signal(regs, save_r0); |
|---|
| 505 | 507 | |
|---|
| 506 | | - if (thread_info_flags & _TIF_NOTIFY_RESUME) { |
|---|
| 507 | | - clear_thread_flag(TIF_NOTIFY_RESUME); |
|---|
| 508 | + if (thread_info_flags & _TIF_NOTIFY_RESUME) |
|---|
| 508 | 509 | tracehook_notify_resume(regs); |
|---|
| 509 | | - } |
|---|
| 510 | 510 | } |
|---|