hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/arm/kernel/signal.c
....@@ -1,11 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/arch/arm/kernel/signal.c
34 *
45 * 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.
96 */
107 #include <linux/errno.h>
118 #include <linux/random.h>
....@@ -241,7 +238,7 @@
241238
242239 frame = (struct sigframe __user *)regs->ARM_sp;
243240
244
- if (!access_ok(VERIFY_READ, frame, sizeof (*frame)))
241
+ if (!access_ok(frame, sizeof (*frame)))
245242 goto badframe;
246243
247244 if (restore_sigframe(regs, frame))
....@@ -250,7 +247,7 @@
250247 return regs->ARM_r0;
251248
252249 badframe:
253
- force_sig(SIGSEGV, current);
250
+ force_sig(SIGSEGV);
254251 return 0;
255252 }
256253
....@@ -271,7 +268,7 @@
271268
272269 frame = (struct rt_sigframe __user *)regs->ARM_sp;
273270
274
- if (!access_ok(VERIFY_READ, frame, sizeof (*frame)))
271
+ if (!access_ok(frame, sizeof (*frame)))
275272 goto badframe;
276273
277274 if (restore_sigframe(regs, &frame->sig))
....@@ -283,7 +280,7 @@
283280 return regs->ARM_r0;
284281
285282 badframe:
286
- force_sig(SIGSEGV, current);
283
+ force_sig(SIGSEGV);
287284 return 0;
288285 }
289286
....@@ -355,7 +352,7 @@
355352 /*
356353 * Check that we can actually write to the signal frame.
357354 */
358
- if (!access_ok(VERIFY_WRITE, frame, framesize))
355
+ if (!access_ok(frame, framesize))
359356 frame = NULL;
360357
361358 return frame;
....@@ -549,8 +546,7 @@
549546 int ret;
550547
551548 /*
552
- * Increment event counter and perform fixup for the pre-signal
553
- * frame.
549
+ * Perform fixup for the pre-signal frame.
554550 */
555551 rseq_signal_deliver(ksig, regs);
556552
....@@ -600,6 +596,7 @@
600596 switch (retval) {
601597 case -ERESTART_RESTARTBLOCK:
602598 restart -= 2;
599
+ fallthrough;
603600 case -ERESTARTNOHAND:
604601 case -ERESTARTSYS:
605602 case -ERESTARTNOINTR:
....@@ -658,7 +655,7 @@
658655 if (unlikely(!user_mode(regs)))
659656 return 0;
660657 local_irq_enable();
661
- if (thread_flags & _TIF_SIGPENDING) {
658
+ if (thread_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL)) {
662659 int restart = do_signal(regs, syscall);
663660 if (unlikely(restart)) {
664661 /*
....@@ -672,7 +669,6 @@
672669 } else if (thread_flags & _TIF_UPROBE) {
673670 uprobe_notify_resume(regs);
674671 } else {
675
- clear_thread_flag(TIF_NOTIFY_RESUME);
676672 tracehook_notify_resume(regs);
677673 rseq_handle_notify_resume(NULL, regs);
678674 }
....@@ -718,7 +714,9 @@
718714 /* Defer to generic check */
719715 asmlinkage void addr_limit_check_failed(void)
720716 {
717
+#ifdef CONFIG_MMU
721718 addr_limit_user_check();
719
+#endif
722720 }
723721
724722 #ifdef CONFIG_DEBUG_RSEQ