| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * linux/arch/arm/kernel/signal.c |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 1995-2009 Russell King |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 8 | | - * published by the Free Software Foundation. |
|---|
| 9 | 6 | */ |
|---|
| 10 | 7 | #include <linux/errno.h> |
|---|
| 11 | 8 | #include <linux/random.h> |
|---|
| .. | .. |
|---|
| 241 | 238 | |
|---|
| 242 | 239 | frame = (struct sigframe __user *)regs->ARM_sp; |
|---|
| 243 | 240 | |
|---|
| 244 | | - if (!access_ok(VERIFY_READ, frame, sizeof (*frame))) |
|---|
| 241 | + if (!access_ok(frame, sizeof (*frame))) |
|---|
| 245 | 242 | goto badframe; |
|---|
| 246 | 243 | |
|---|
| 247 | 244 | if (restore_sigframe(regs, frame)) |
|---|
| .. | .. |
|---|
| 250 | 247 | return regs->ARM_r0; |
|---|
| 251 | 248 | |
|---|
| 252 | 249 | badframe: |
|---|
| 253 | | - force_sig(SIGSEGV, current); |
|---|
| 250 | + force_sig(SIGSEGV); |
|---|
| 254 | 251 | return 0; |
|---|
| 255 | 252 | } |
|---|
| 256 | 253 | |
|---|
| .. | .. |
|---|
| 271 | 268 | |
|---|
| 272 | 269 | frame = (struct rt_sigframe __user *)regs->ARM_sp; |
|---|
| 273 | 270 | |
|---|
| 274 | | - if (!access_ok(VERIFY_READ, frame, sizeof (*frame))) |
|---|
| 271 | + if (!access_ok(frame, sizeof (*frame))) |
|---|
| 275 | 272 | goto badframe; |
|---|
| 276 | 273 | |
|---|
| 277 | 274 | if (restore_sigframe(regs, &frame->sig)) |
|---|
| .. | .. |
|---|
| 283 | 280 | return regs->ARM_r0; |
|---|
| 284 | 281 | |
|---|
| 285 | 282 | badframe: |
|---|
| 286 | | - force_sig(SIGSEGV, current); |
|---|
| 283 | + force_sig(SIGSEGV); |
|---|
| 287 | 284 | return 0; |
|---|
| 288 | 285 | } |
|---|
| 289 | 286 | |
|---|
| .. | .. |
|---|
| 355 | 352 | /* |
|---|
| 356 | 353 | * Check that we can actually write to the signal frame. |
|---|
| 357 | 354 | */ |
|---|
| 358 | | - if (!access_ok(VERIFY_WRITE, frame, framesize)) |
|---|
| 355 | + if (!access_ok(frame, framesize)) |
|---|
| 359 | 356 | frame = NULL; |
|---|
| 360 | 357 | |
|---|
| 361 | 358 | return frame; |
|---|
| .. | .. |
|---|
| 549 | 546 | int ret; |
|---|
| 550 | 547 | |
|---|
| 551 | 548 | /* |
|---|
| 552 | | - * Increment event counter and perform fixup for the pre-signal |
|---|
| 553 | | - * frame. |
|---|
| 549 | + * Perform fixup for the pre-signal frame. |
|---|
| 554 | 550 | */ |
|---|
| 555 | 551 | rseq_signal_deliver(ksig, regs); |
|---|
| 556 | 552 | |
|---|
| .. | .. |
|---|
| 600 | 596 | switch (retval) { |
|---|
| 601 | 597 | case -ERESTART_RESTARTBLOCK: |
|---|
| 602 | 598 | restart -= 2; |
|---|
| 599 | + fallthrough; |
|---|
| 603 | 600 | case -ERESTARTNOHAND: |
|---|
| 604 | 601 | case -ERESTARTSYS: |
|---|
| 605 | 602 | case -ERESTARTNOINTR: |
|---|
| .. | .. |
|---|
| 658 | 655 | if (unlikely(!user_mode(regs))) |
|---|
| 659 | 656 | return 0; |
|---|
| 660 | 657 | local_irq_enable(); |
|---|
| 661 | | - if (thread_flags & _TIF_SIGPENDING) { |
|---|
| 658 | + if (thread_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL)) { |
|---|
| 662 | 659 | int restart = do_signal(regs, syscall); |
|---|
| 663 | 660 | if (unlikely(restart)) { |
|---|
| 664 | 661 | /* |
|---|
| .. | .. |
|---|
| 672 | 669 | } else if (thread_flags & _TIF_UPROBE) { |
|---|
| 673 | 670 | uprobe_notify_resume(regs); |
|---|
| 674 | 671 | } else { |
|---|
| 675 | | - clear_thread_flag(TIF_NOTIFY_RESUME); |
|---|
| 676 | 672 | tracehook_notify_resume(regs); |
|---|
| 677 | 673 | rseq_handle_notify_resume(NULL, regs); |
|---|
| 678 | 674 | } |
|---|
| .. | .. |
|---|
| 718 | 714 | /* Defer to generic check */ |
|---|
| 719 | 715 | asmlinkage void addr_limit_check_failed(void) |
|---|
| 720 | 716 | { |
|---|
| 717 | +#ifdef CONFIG_MMU |
|---|
| 721 | 718 | addr_limit_user_check(); |
|---|
| 719 | +#endif |
|---|
| 722 | 720 | } |
|---|
| 723 | 721 | |
|---|
| 724 | 722 | #ifdef CONFIG_DEBUG_RSEQ |
|---|