• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/arch/alpha/kernel/
1/*
2 *  linux/arch/alpha/kernel/signal.c
3 *
4 *  Copyright (C) 1995  Linus Torvalds
5 *
6 *  1997-11-02  Modified for POSIX.1b signals by Richard Henderson
7 */
8
9#include <linux/sched.h>
10#include <linux/kernel.h>
11#include <linux/signal.h>
12#include <linux/errno.h>
13#include <linux/wait.h>
14#include <linux/ptrace.h>
15#include <linux/unistd.h>
16#include <linux/mm.h>
17#include <linux/smp.h>
18#include <linux/stddef.h>
19#include <linux/tty.h>
20#include <linux/binfmts.h>
21#include <linux/bitops.h>
22#include <linux/syscalls.h>
23#include <linux/tracehook.h>
24
25#include <asm/uaccess.h>
26#include <asm/sigcontext.h>
27#include <asm/ucontext.h>
28
29#include "proto.h"
30
31
32#define DEBUG_SIG 0
33
34#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
35
36asmlinkage void ret_from_sys_call(void);
37static void do_signal(struct pt_regs *, struct switch_stack *,
38		      unsigned long, unsigned long);
39
40
41/*
42 * The OSF/1 sigprocmask calling sequence is different from the
43 * C sigprocmask() sequence..
44 */
45SYSCALL_DEFINE2(osf_sigprocmask, int, how, unsigned long, newmask)
46{
47	sigset_t oldmask;
48	sigset_t mask;
49	unsigned long res;
50
51	siginitset(&mask, newmask & _BLOCKABLE);
52	res = sigprocmask(how, &mask, &oldmask);
53	if (!res) {
54		force_successful_syscall_return();
55		res = oldmask.sig[0];
56	}
57	return res;
58}
59
60SYSCALL_DEFINE3(osf_sigaction, int, sig,
61		const struct osf_sigaction __user *, act,
62		struct osf_sigaction __user *, oact)
63{
64	struct k_sigaction new_ka, old_ka;
65	int ret;
66
67	if (act) {
68		old_sigset_t mask;
69		if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
70		    __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
71		    __get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
72		    __get_user(mask, &act->sa_mask))
73			return -EFAULT;
74		siginitset(&new_ka.sa.sa_mask, mask);
75		new_ka.ka_restorer = NULL;
76	}
77
78	ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
79
80	if (!ret && oact) {
81		if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
82		    __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
83		    __put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
84		    __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
85			return -EFAULT;
86	}
87
88	return ret;
89}
90
91SYSCALL_DEFINE5(rt_sigaction, int, sig, const struct sigaction __user *, act,
92		struct sigaction __user *, oact,
93		size_t, sigsetsize, void __user *, restorer)
94{
95	struct k_sigaction new_ka, old_ka;
96	int ret;
97
98	if (sigsetsize != sizeof(sigset_t))
99		return -EINVAL;
100
101	if (act) {
102		new_ka.ka_restorer = restorer;
103		if (copy_from_user(&new_ka.sa, act, sizeof(*act)))
104			return -EFAULT;
105	}
106
107	ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
108
109	if (!ret && oact) {
110		if (copy_to_user(oact, &old_ka.sa, sizeof(*oact)))
111			return -EFAULT;
112	}
113
114	return ret;
115}
116
117/*
118 * Atomically swap in the new signal mask, and wait for a signal.
119 */
120SYSCALL_DEFINE1(sigsuspend, old_sigset_t, mask)
121{
122	mask &= _BLOCKABLE;
123	spin_lock_irq(&current->sighand->siglock);
124	current->saved_sigmask = current->blocked;
125	siginitset(&current->blocked, mask);
126	recalc_sigpending();
127	spin_unlock_irq(&current->sighand->siglock);
128
129	current->state = TASK_INTERRUPTIBLE;
130	schedule();
131	set_thread_flag(TIF_RESTORE_SIGMASK);
132	return -ERESTARTNOHAND;
133}
134
135asmlinkage int
136sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss)
137{
138	return do_sigaltstack(uss, uoss, rdusp());
139}
140
141/*
142 * Do a signal return; undo the signal stack.
143 */
144
145#if _NSIG_WORDS > 1
146# error "Non SA_SIGINFO frame needs rearranging"
147#endif
148
149struct sigframe
150{
151	struct sigcontext sc;
152	unsigned int retcode[3];
153};
154
155struct rt_sigframe
156{
157	struct siginfo info;
158	struct ucontext uc;
159	unsigned int retcode[3];
160};
161
162/* If this changes, userland unwinders that Know Things about our signal
163   frame will break.  Do not undertake lightly.  It also implies an ABI
164   change wrt the size of siginfo_t, which may cause some pain.  */
165extern char compile_time_assert
166        [offsetof(struct rt_sigframe, uc.uc_mcontext) == 176 ? 1 : -1];
167
168#define INSN_MOV_R30_R16	0x47fe0410
169#define INSN_LDI_R0		0x201f0000
170#define INSN_CALLSYS		0x00000083
171
172static long
173restore_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
174		   struct switch_stack *sw)
175{
176	unsigned long usp;
177	long i, err = __get_user(regs->pc, &sc->sc_pc);
178
179	current_thread_info()->restart_block.fn = do_no_restart_syscall;
180
181	sw->r26 = (unsigned long) ret_from_sys_call;
182
183	err |= __get_user(regs->r0, sc->sc_regs+0);
184	err |= __get_user(regs->r1, sc->sc_regs+1);
185	err |= __get_user(regs->r2, sc->sc_regs+2);
186	err |= __get_user(regs->r3, sc->sc_regs+3);
187	err |= __get_user(regs->r4, sc->sc_regs+4);
188	err |= __get_user(regs->r5, sc->sc_regs+5);
189	err |= __get_user(regs->r6, sc->sc_regs+6);
190	err |= __get_user(regs->r7, sc->sc_regs+7);
191	err |= __get_user(regs->r8, sc->sc_regs+8);
192	err |= __get_user(sw->r9, sc->sc_regs+9);
193	err |= __get_user(sw->r10, sc->sc_regs+10);
194	err |= __get_user(sw->r11, sc->sc_regs+11);
195	err |= __get_user(sw->r12, sc->sc_regs+12);
196	err |= __get_user(sw->r13, sc->sc_regs+13);
197	err |= __get_user(sw->r14, sc->sc_regs+14);
198	err |= __get_user(sw->r15, sc->sc_regs+15);
199	err |= __get_user(regs->r16, sc->sc_regs+16);
200	err |= __get_user(regs->r17, sc->sc_regs+17);
201	err |= __get_user(regs->r18, sc->sc_regs+18);
202	err |= __get_user(regs->r19, sc->sc_regs+19);
203	err |= __get_user(regs->r20, sc->sc_regs+20);
204	err |= __get_user(regs->r21, sc->sc_regs+21);
205	err |= __get_user(regs->r22, sc->sc_regs+22);
206	err |= __get_user(regs->r23, sc->sc_regs+23);
207	err |= __get_user(regs->r24, sc->sc_regs+24);
208	err |= __get_user(regs->r25, sc->sc_regs+25);
209	err |= __get_user(regs->r26, sc->sc_regs+26);
210	err |= __get_user(regs->r27, sc->sc_regs+27);
211	err |= __get_user(regs->r28, sc->sc_regs+28);
212	err |= __get_user(regs->gp, sc->sc_regs+29);
213	err |= __get_user(usp, sc->sc_regs+30);
214	wrusp(usp);
215
216	for (i = 0; i < 31; i++)
217		err |= __get_user(sw->fp[i], sc->sc_fpregs+i);
218	err |= __get_user(sw->fp[31], &sc->sc_fpcr);
219
220	return err;
221}
222
223/* Note that this syscall is also used by setcontext(3) to install
224   a given sigcontext.  This because it's impossible to set *all*
225   registers and transfer control from userland.  */
226
227asmlinkage void
228do_sigreturn(struct sigcontext __user *sc, struct pt_regs *regs,
229	     struct switch_stack *sw)
230{
231	sigset_t set;
232
233	/* Verify that it's a good sigcontext before using it */
234	if (!access_ok(VERIFY_READ, sc, sizeof(*sc)))
235		goto give_sigsegv;
236	if (__get_user(set.sig[0], &sc->sc_mask))
237		goto give_sigsegv;
238
239	sigdelsetmask(&set, ~_BLOCKABLE);
240	spin_lock_irq(&current->sighand->siglock);
241	current->blocked = set;
242	recalc_sigpending();
243	spin_unlock_irq(&current->sighand->siglock);
244
245	if (restore_sigcontext(sc, regs, sw))
246		goto give_sigsegv;
247
248	/* Send SIGTRAP if we're single-stepping: */
249	if (ptrace_cancel_bpt (current)) {
250		siginfo_t info;
251
252		info.si_signo = SIGTRAP;
253		info.si_errno = 0;
254		info.si_code = TRAP_BRKPT;
255		info.si_addr = (void __user *) regs->pc;
256		info.si_trapno = 0;
257		send_sig_info(SIGTRAP, &info, current);
258	}
259	return;
260
261give_sigsegv:
262	force_sig(SIGSEGV, current);
263}
264
265asmlinkage void
266do_rt_sigreturn(struct rt_sigframe __user *frame, struct pt_regs *regs,
267		struct switch_stack *sw)
268{
269	sigset_t set;
270
271	/* Verify that it's a good ucontext_t before using it */
272	if (!access_ok(VERIFY_READ, &frame->uc, sizeof(frame->uc)))
273		goto give_sigsegv;
274	if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
275		goto give_sigsegv;
276
277	sigdelsetmask(&set, ~_BLOCKABLE);
278	spin_lock_irq(&current->sighand->siglock);
279	current->blocked = set;
280	recalc_sigpending();
281	spin_unlock_irq(&current->sighand->siglock);
282
283	if (restore_sigcontext(&frame->uc.uc_mcontext, regs, sw))
284		goto give_sigsegv;
285
286	/* Send SIGTRAP if we're single-stepping: */
287	if (ptrace_cancel_bpt (current)) {
288		siginfo_t info;
289
290		info.si_signo = SIGTRAP;
291		info.si_errno = 0;
292		info.si_code = TRAP_BRKPT;
293		info.si_addr = (void __user *) regs->pc;
294		info.si_trapno = 0;
295		send_sig_info(SIGTRAP, &info, current);
296	}
297	return;
298
299give_sigsegv:
300	force_sig(SIGSEGV, current);
301}
302
303
304/*
305 * Set up a signal frame.
306 */
307
308static inline void __user *
309get_sigframe(struct k_sigaction *ka, unsigned long sp, size_t frame_size)
310{
311	if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! sas_ss_flags(sp))
312		sp = current->sas_ss_sp + current->sas_ss_size;
313
314	return (void __user *)((sp - frame_size) & -32ul);
315}
316
317static long
318setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
319		 struct switch_stack *sw, unsigned long mask, unsigned long sp)
320{
321	long i, err = 0;
322
323	err |= __put_user(on_sig_stack((unsigned long)sc), &sc->sc_onstack);
324	err |= __put_user(mask, &sc->sc_mask);
325	err |= __put_user(regs->pc, &sc->sc_pc);
326	err |= __put_user(8, &sc->sc_ps);
327
328	err |= __put_user(regs->r0 , sc->sc_regs+0);
329	err |= __put_user(regs->r1 , sc->sc_regs+1);
330	err |= __put_user(regs->r2 , sc->sc_regs+2);
331	err |= __put_user(regs->r3 , sc->sc_regs+3);
332	err |= __put_user(regs->r4 , sc->sc_regs+4);
333	err |= __put_user(regs->r5 , sc->sc_regs+5);
334	err |= __put_user(regs->r6 , sc->sc_regs+6);
335	err |= __put_user(regs->r7 , sc->sc_regs+7);
336	err |= __put_user(regs->r8 , sc->sc_regs+8);
337	err |= __put_user(sw->r9   , sc->sc_regs+9);
338	err |= __put_user(sw->r10  , sc->sc_regs+10);
339	err |= __put_user(sw->r11  , sc->sc_regs+11);
340	err |= __put_user(sw->r12  , sc->sc_regs+12);
341	err |= __put_user(sw->r13  , sc->sc_regs+13);
342	err |= __put_user(sw->r14  , sc->sc_regs+14);
343	err |= __put_user(sw->r15  , sc->sc_regs+15);
344	err |= __put_user(regs->r16, sc->sc_regs+16);
345	err |= __put_user(regs->r17, sc->sc_regs+17);
346	err |= __put_user(regs->r18, sc->sc_regs+18);
347	err |= __put_user(regs->r19, sc->sc_regs+19);
348	err |= __put_user(regs->r20, sc->sc_regs+20);
349	err |= __put_user(regs->r21, sc->sc_regs+21);
350	err |= __put_user(regs->r22, sc->sc_regs+22);
351	err |= __put_user(regs->r23, sc->sc_regs+23);
352	err |= __put_user(regs->r24, sc->sc_regs+24);
353	err |= __put_user(regs->r25, sc->sc_regs+25);
354	err |= __put_user(regs->r26, sc->sc_regs+26);
355	err |= __put_user(regs->r27, sc->sc_regs+27);
356	err |= __put_user(regs->r28, sc->sc_regs+28);
357	err |= __put_user(regs->gp , sc->sc_regs+29);
358	err |= __put_user(sp, sc->sc_regs+30);
359	err |= __put_user(0, sc->sc_regs+31);
360
361	for (i = 0; i < 31; i++)
362		err |= __put_user(sw->fp[i], sc->sc_fpregs+i);
363	err |= __put_user(0, sc->sc_fpregs+31);
364	err |= __put_user(sw->fp[31], &sc->sc_fpcr);
365
366	err |= __put_user(regs->trap_a0, &sc->sc_traparg_a0);
367	err |= __put_user(regs->trap_a1, &sc->sc_traparg_a1);
368	err |= __put_user(regs->trap_a2, &sc->sc_traparg_a2);
369
370	return err;
371}
372
373static int
374setup_frame(int sig, struct k_sigaction *ka, sigset_t *set,
375	    struct pt_regs *regs, struct switch_stack * sw)
376{
377	unsigned long oldsp, r26, err = 0;
378	struct sigframe __user *frame;
379
380	oldsp = rdusp();
381	frame = get_sigframe(ka, oldsp, sizeof(*frame));
382	if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
383		goto give_sigsegv;
384
385	err |= setup_sigcontext(&frame->sc, regs, sw, set->sig[0], oldsp);
386	if (err)
387		goto give_sigsegv;
388
389	/* Set up to return from userspace.  If provided, use a stub
390	   already in userspace.  */
391	if (ka->ka_restorer) {
392		r26 = (unsigned long) ka->ka_restorer;
393	} else {
394		err |= __put_user(INSN_MOV_R30_R16, frame->retcode+0);
395		err |= __put_user(INSN_LDI_R0+__NR_sigreturn, frame->retcode+1);
396		err |= __put_user(INSN_CALLSYS, frame->retcode+2);
397		imb();
398		r26 = (unsigned long) frame->retcode;
399	}
400
401	/* Check that everything was written properly.  */
402	if (err)
403		goto give_sigsegv;
404
405	/* "Return" to the handler */
406	regs->r26 = r26;
407	regs->r27 = regs->pc = (unsigned long) ka->sa.sa_handler;
408	regs->r16 = sig;			/* a0: signal number */
409	regs->r17 = 0;				/* a1: exception code */
410	regs->r18 = (unsigned long) &frame->sc;	/* a2: sigcontext pointer */
411	wrusp((unsigned long) frame);
412
413#if DEBUG_SIG
414	printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n",
415		current->comm, current->pid, frame, regs->pc, regs->r26);
416#endif
417
418	return 0;
419
420give_sigsegv:
421	force_sigsegv(sig, current);
422	return -EFAULT;
423}
424
425static int
426setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
427	       sigset_t *set, struct pt_regs *regs, struct switch_stack * sw)
428{
429	unsigned long oldsp, r26, err = 0;
430	struct rt_sigframe __user *frame;
431
432	oldsp = rdusp();
433	frame = get_sigframe(ka, oldsp, sizeof(*frame));
434	if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
435		goto give_sigsegv;
436
437	err |= copy_siginfo_to_user(&frame->info, info);
438
439	/* Create the ucontext.  */
440	err |= __put_user(0, &frame->uc.uc_flags);
441	err |= __put_user(0, &frame->uc.uc_link);
442	err |= __put_user(set->sig[0], &frame->uc.uc_osf_sigmask);
443	err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
444	err |= __put_user(sas_ss_flags(oldsp), &frame->uc.uc_stack.ss_flags);
445	err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
446	err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, sw,
447				set->sig[0], oldsp);
448	err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
449	if (err)
450		goto give_sigsegv;
451
452	/* Set up to return from userspace.  If provided, use a stub
453	   already in userspace.  */
454	if (ka->ka_restorer) {
455		r26 = (unsigned long) ka->ka_restorer;
456	} else {
457		err |= __put_user(INSN_MOV_R30_R16, frame->retcode+0);
458		err |= __put_user(INSN_LDI_R0+__NR_rt_sigreturn,
459				  frame->retcode+1);
460		err |= __put_user(INSN_CALLSYS, frame->retcode+2);
461		imb();
462		r26 = (unsigned long) frame->retcode;
463	}
464
465	if (err)
466		goto give_sigsegv;
467
468	/* "Return" to the handler */
469	regs->r26 = r26;
470	regs->r27 = regs->pc = (unsigned long) ka->sa.sa_handler;
471	regs->r16 = sig;			  /* a0: signal number */
472	regs->r17 = (unsigned long) &frame->info; /* a1: siginfo pointer */
473	regs->r18 = (unsigned long) &frame->uc;	  /* a2: ucontext pointer */
474	wrusp((unsigned long) frame);
475
476#if DEBUG_SIG
477	printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n",
478		current->comm, current->pid, frame, regs->pc, regs->r26);
479#endif
480
481	return 0;
482
483give_sigsegv:
484	force_sigsegv(sig, current);
485	return -EFAULT;
486}
487
488
489/*
490 * OK, we're invoking a handler.
491 */
492static inline int
493handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info,
494	      sigset_t *oldset, struct pt_regs * regs, struct switch_stack *sw)
495{
496	int ret;
497
498	if (ka->sa.sa_flags & SA_SIGINFO)
499		ret = setup_rt_frame(sig, ka, info, oldset, regs, sw);
500	else
501		ret = setup_frame(sig, ka, oldset, regs, sw);
502
503	if (ret == 0) {
504		spin_lock_irq(&current->sighand->siglock);
505		sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
506		if (!(ka->sa.sa_flags & SA_NODEFER))
507			sigaddset(&current->blocked,sig);
508		recalc_sigpending();
509		spin_unlock_irq(&current->sighand->siglock);
510	}
511
512	return ret;
513}
514
515static inline void
516syscall_restart(unsigned long r0, unsigned long r19,
517		struct pt_regs *regs, struct k_sigaction *ka)
518{
519	switch (regs->r0) {
520	case ERESTARTSYS:
521		if (!(ka->sa.sa_flags & SA_RESTART)) {
522		case ERESTARTNOHAND:
523			regs->r0 = EINTR;
524			break;
525		}
526		/* fallthrough */
527	case ERESTARTNOINTR:
528		regs->r0 = r0;	/* reset v0 and a3 and replay syscall */
529		regs->r19 = r19;
530		regs->pc -= 4;
531		break;
532	case ERESTART_RESTARTBLOCK:
533		regs->r0 = EINTR;
534		break;
535	}
536}
537
538
539/*
540 * Note that 'init' is a special process: it doesn't get signals it doesn't
541 * want to handle. Thus you cannot kill init even with a SIGKILL even by
542 * mistake.
543 *
544 * Note that we go through the signals twice: once to check the signals that
545 * the kernel can handle, and then we build all the user-level signal handling
546 * stack-frames in one go after that.
547 *
548 * "r0" and "r19" are the registers we need to restore for system call
549 * restart. "r0" is also used as an indicator whether we can restart at
550 * all (if we get here from anything but a syscall return, it will be 0)
551 */
552static void
553do_signal(struct pt_regs * regs, struct switch_stack * sw,
554	  unsigned long r0, unsigned long r19)
555{
556	siginfo_t info;
557	int signr;
558	unsigned long single_stepping = ptrace_cancel_bpt(current);
559	struct k_sigaction ka;
560	sigset_t *oldset;
561
562	if (test_thread_flag(TIF_RESTORE_SIGMASK))
563		oldset = &current->saved_sigmask;
564	else
565		oldset = &current->blocked;
566
567	/* This lets the debugger run, ... */
568	signr = get_signal_to_deliver(&info, &ka, regs, NULL);
569
570	/* ... so re-check the single stepping. */
571	single_stepping |= ptrace_cancel_bpt(current);
572
573	if (signr > 0) {
574		/* Whee!  Actually deliver the signal.  */
575		if (r0)
576			syscall_restart(r0, r19, regs, &ka);
577		if (handle_signal(signr, &ka, &info, oldset, regs, sw) == 0) {
578			/* A signal was successfully delivered, and the
579			   saved sigmask was stored on the signal frame,
580			   and will be restored by sigreturn.  So we can
581			   simply clear the restore sigmask flag.  */
582			if (test_thread_flag(TIF_RESTORE_SIGMASK))
583				clear_thread_flag(TIF_RESTORE_SIGMASK);
584		}
585		if (single_stepping)
586			ptrace_set_bpt(current); /* re-set bpt */
587		return;
588	}
589
590	if (r0) {
591	  	switch (regs->r0) {
592		case ERESTARTNOHAND:
593		case ERESTARTSYS:
594		case ERESTARTNOINTR:
595			/* Reset v0 and a3 and replay syscall.  */
596			regs->r0 = r0;
597			regs->r19 = r19;
598			regs->pc -= 4;
599			break;
600		case ERESTART_RESTARTBLOCK:
601			/* Force v0 to the restart syscall and reply.  */
602			regs->r0 = __NR_restart_syscall;
603			regs->pc -= 4;
604			break;
605		}
606	}
607
608	/* If there's no signal to deliver, we just restore the saved mask.  */
609	if (test_thread_flag(TIF_RESTORE_SIGMASK)) {
610		clear_thread_flag(TIF_RESTORE_SIGMASK);
611		sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
612	}
613
614	if (single_stepping)
615		ptrace_set_bpt(current);	/* re-set breakpoint */
616}
617
618void
619do_notify_resume(struct pt_regs *regs, struct switch_stack *sw,
620		 unsigned long thread_info_flags,
621		 unsigned long r0, unsigned long r19)
622{
623	if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK))
624		do_signal(regs, sw, r0, r19);
625
626	if (thread_info_flags & _TIF_NOTIFY_RESUME) {
627		clear_thread_flag(TIF_NOTIFY_RESUME);
628		tracehook_notify_resume(regs);
629		if (current->replacement_session_keyring)
630			key_replace_session_keyring();
631	}
632}
633