Commit a42c6ded827dbd396d2efde7530620be029a72d1

Authored by Al Viro
1 parent 1227dd773d

move key_repace_session_keyring() into tracehook_notify_resume()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Showing 30 changed files with 6 additions and 66 deletions Side-by-side Diff

arch/alpha/kernel/signal.c
... ... @@ -590,8 +590,6 @@
590 590 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
591 591 clear_thread_flag(TIF_NOTIFY_RESUME);
592 592 tracehook_notify_resume(regs);
593   - if (current->replacement_session_keyring)
594   - key_replace_session_keyring();
595 593 }
596 594 }
arch/arm/kernel/signal.c
... ... @@ -728,8 +728,6 @@
728 728 if (thread_flags & _TIF_NOTIFY_RESUME) {
729 729 clear_thread_flag(TIF_NOTIFY_RESUME);
730 730 tracehook_notify_resume(regs);
731   - if (current->replacement_session_keyring)
732   - key_replace_session_keyring();
733 731 }
734 732 }
arch/avr32/kernel/signal.c
... ... @@ -321,8 +321,6 @@
321 321 if (ti->flags & _TIF_NOTIFY_RESUME) {
322 322 clear_thread_flag(TIF_NOTIFY_RESUME);
323 323 tracehook_notify_resume(regs);
324   - if (current->replacement_session_keyring)
325   - key_replace_session_keyring();
326 324 }
327 325 }
arch/blackfin/kernel/signal.c
... ... @@ -336,8 +336,6 @@
336 336 if (test_thread_flag(TIF_NOTIFY_RESUME)) {
337 337 clear_thread_flag(TIF_NOTIFY_RESUME);
338 338 tracehook_notify_resume(regs);
339   - if (current->replacement_session_keyring)
340   - key_replace_session_keyring();
341 339 }
342 340 }
arch/c6x/kernel/signal.c
... ... @@ -364,8 +364,6 @@
364 364 if (thread_info_flags & (1 << TIF_NOTIFY_RESUME)) {
365 365 clear_thread_flag(TIF_NOTIFY_RESUME);
366 366 tracehook_notify_resume(regs);
367   - if (current->replacement_session_keyring)
368   - key_replace_session_keyring();
369 367 }
370 368 }
arch/cris/kernel/ptrace.c
... ... @@ -40,8 +40,6 @@
40 40 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
41 41 clear_thread_flag(TIF_NOTIFY_RESUME);
42 42 tracehook_notify_resume(regs);
43   - if (current->replacement_session_keyring)
44   - key_replace_session_keyring();
45 43 }
46 44 }
arch/frv/kernel/signal.c
... ... @@ -562,8 +562,6 @@
562 562 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
563 563 clear_thread_flag(TIF_NOTIFY_RESUME);
564 564 tracehook_notify_resume(__frame);
565   - if (current->replacement_session_keyring)
566   - key_replace_session_keyring();
567 565 }
568 566  
569 567 } /* end do_notify_resume() */
arch/h8300/kernel/signal.c
... ... @@ -513,8 +513,6 @@
513 513 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
514 514 clear_thread_flag(TIF_NOTIFY_RESUME);
515 515 tracehook_notify_resume(regs);
516   - if (current->replacement_session_keyring)
517   - key_replace_session_keyring();
518 516 }
519 517 }
arch/hexagon/kernel/signal.c
... ... @@ -273,8 +273,6 @@
273 273 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
274 274 clear_thread_flag(TIF_NOTIFY_RESUME);
275 275 tracehook_notify_resume(regs);
276   - if (current->replacement_session_keyring)
277   - key_replace_session_keyring();
278 276 }
279 277 }
280 278  
arch/ia64/kernel/process.c
... ... @@ -199,8 +199,6 @@
199 199 if (test_thread_flag(TIF_NOTIFY_RESUME)) {
200 200 clear_thread_flag(TIF_NOTIFY_RESUME);
201 201 tracehook_notify_resume(&scr->pt);
202   - if (current->replacement_session_keyring)
203   - key_replace_session_keyring();
204 202 }
205 203  
206 204 /* copy user rbs to kernel rbs */
arch/m32r/kernel/signal.c
... ... @@ -383,8 +383,6 @@
383 383 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
384 384 clear_thread_flag(TIF_NOTIFY_RESUME);
385 385 tracehook_notify_resume(regs);
386   - if (current->replacement_session_keyring)
387   - key_replace_session_keyring();
388 386 }
389 387  
390 388 clear_thread_flag(TIF_IRET);
arch/m68k/kernel/signal.c
... ... @@ -1193,10 +1193,7 @@
1193 1193 if (test_thread_flag(TIF_SIGPENDING))
1194 1194 do_signal(regs);
1195 1195  
1196   - if (test_and_clear_thread_flag(TIF_NOTIFY_RESUME)) {
  1196 + if (test_and_clear_thread_flag(TIF_NOTIFY_RESUME))
1197 1197 tracehook_notify_resume(regs);
1198   - if (current->replacement_session_keyring)
1199   - key_replace_session_keyring();
1200   - }
1201 1198 }
arch/microblaze/kernel/signal.c
... ... @@ -401,10 +401,7 @@
401 401 if (test_thread_flag(TIF_SIGPENDING))
402 402 do_signal(regs, in_syscall);
403 403  
404   - if (test_and_clear_thread_flag(TIF_NOTIFY_RESUME)) {
  404 + if (test_and_clear_thread_flag(TIF_NOTIFY_RESUME))
405 405 tracehook_notify_resume(regs);
406   - if (current->replacement_session_keyring)
407   - key_replace_session_keyring();
408   - }
409 406 }
arch/mips/kernel/signal.c
... ... @@ -636,8 +636,6 @@
636 636 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
637 637 clear_thread_flag(TIF_NOTIFY_RESUME);
638 638 tracehook_notify_resume(regs);
639   - if (current->replacement_session_keyring)
640   - key_replace_session_keyring();
641 639 }
642 640 }
643 641  
arch/mn10300/kernel/signal.c
... ... @@ -554,8 +554,6 @@
554 554 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
555 555 clear_thread_flag(TIF_NOTIFY_RESUME);
556 556 tracehook_notify_resume(current_frame());
557   - if (current->replacement_session_keyring)
558   - key_replace_session_keyring();
559 557 }
560 558 }
arch/openrisc/kernel/signal.c
... ... @@ -376,8 +376,6 @@
376 376 if (current_thread_info()->flags & _TIF_NOTIFY_RESUME) {
377 377 clear_thread_flag(TIF_NOTIFY_RESUME);
378 378 tracehook_notify_resume(regs);
379   - if (current->replacement_session_keyring)
380   - key_replace_session_keyring();
381 379 }
382 380 }
arch/parisc/kernel/signal.c
... ... @@ -638,8 +638,6 @@
638 638 if (test_thread_flag(TIF_NOTIFY_RESUME)) {
639 639 clear_thread_flag(TIF_NOTIFY_RESUME);
640 640 tracehook_notify_resume(regs);
641   - if (current->replacement_session_keyring)
642   - key_replace_session_keyring();
643 641 }
644 642 }
arch/powerpc/kernel/signal.c
... ... @@ -193,8 +193,6 @@
193 193 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
194 194 clear_thread_flag(TIF_NOTIFY_RESUME);
195 195 tracehook_notify_resume(regs);
196   - if (current->replacement_session_keyring)
197   - key_replace_session_keyring();
198 196 }
199 197 }
200 198  
arch/s390/kernel/signal.c
... ... @@ -494,7 +494,5 @@
494 494 {
495 495 clear_thread_flag(TIF_NOTIFY_RESUME);
496 496 tracehook_notify_resume(regs);
497   - if (current->replacement_session_keyring)
498   - key_replace_session_keyring();
499 497 }
arch/score/kernel/signal.c
... ... @@ -356,8 +356,6 @@
356 356 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
357 357 clear_thread_flag(TIF_NOTIFY_RESUME);
358 358 tracehook_notify_resume(regs);
359   - if (current->replacement_session_keyring)
360   - key_replace_session_keyring();
361 359 }
362 360 }
arch/sh/kernel/signal_32.c
... ... @@ -626,8 +626,6 @@
626 626 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
627 627 clear_thread_flag(TIF_NOTIFY_RESUME);
628 628 tracehook_notify_resume(regs);
629   - if (current->replacement_session_keyring)
630   - key_replace_session_keyring();
631 629 }
632 630 }
arch/sh/kernel/signal_64.c
... ... @@ -685,8 +685,6 @@
685 685 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
686 686 clear_thread_flag(TIF_NOTIFY_RESUME);
687 687 tracehook_notify_resume(regs);
688   - if (current->replacement_session_keyring)
689   - key_replace_session_keyring();
690 688 }
691 689 }
arch/sparc/kernel/signal_32.c
... ... @@ -590,8 +590,6 @@
590 590 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
591 591 clear_thread_flag(TIF_NOTIFY_RESUME);
592 592 tracehook_notify_resume(regs);
593   - if (current->replacement_session_keyring)
594   - key_replace_session_keyring();
595 593 }
596 594 }
597 595  
arch/sparc/kernel/signal_64.c
... ... @@ -607,8 +607,6 @@
607 607 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
608 608 clear_thread_flag(TIF_NOTIFY_RESUME);
609 609 tracehook_notify_resume(regs);
610   - if (current->replacement_session_keyring)
611   - key_replace_session_keyring();
612 610 }
613 611 }
arch/tile/kernel/process.c
... ... @@ -569,8 +569,6 @@
569 569 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
570 570 clear_thread_flag(TIF_NOTIFY_RESUME);
571 571 tracehook_notify_resume(regs);
572   - if (current->replacement_session_keyring)
573   - key_replace_session_keyring();
574 572 return 1;
575 573 }
576 574 if (thread_info_flags & _TIF_SINGLESTEP) {
arch/um/kernel/process.c
... ... @@ -117,11 +117,8 @@
117 117 schedule();
118 118 if (test_thread_flag(TIF_SIGPENDING))
119 119 do_signal();
120   - if (test_and_clear_thread_flag(TIF_NOTIFY_RESUME)) {
  120 + if (test_and_clear_thread_flag(TIF_NOTIFY_RESUME))
121 121 tracehook_notify_resume(&current->thread.regs);
122   - if (current->replacement_session_keyring)
123   - key_replace_session_keyring();
124   - }
125 122 }
126 123  
127 124 void exit_thread(void)
arch/unicore32/kernel/signal.c
... ... @@ -464,8 +464,6 @@
464 464 if (thread_flags & _TIF_NOTIFY_RESUME) {
465 465 clear_thread_flag(TIF_NOTIFY_RESUME);
466 466 tracehook_notify_resume(regs);
467   - if (current->replacement_session_keyring)
468   - key_replace_session_keyring();
469 467 }
470 468 }
471 469  
arch/x86/kernel/signal.c
... ... @@ -821,8 +821,6 @@
821 821 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
822 822 clear_thread_flag(TIF_NOTIFY_RESUME);
823 823 tracehook_notify_resume(regs);
824   - if (current->replacement_session_keyring)
825   - key_replace_session_keyring();
826 824 }
827 825 if (thread_info_flags & _TIF_USER_RETURN_NOTIFY)
828 826 fire_user_return_notifiers();
arch/xtensa/kernel/signal.c
... ... @@ -548,10 +548,7 @@
548 548 if (test_thread_flag(TIF_SIGPENDING))
549 549 do_signal(regs);
550 550  
551   - if (test_and_clear_thread_flag(TIF_NOTIFY_RESUME)) {
  551 + if (test_and_clear_thread_flag(TIF_NOTIFY_RESUME))
552 552 tracehook_notify_resume(regs);
553   - if (current->replacement_session_keyring)
554   - key_replace_session_keyring();
555   - }
556 553 }
include/linux/tracehook.h
... ... @@ -183,6 +183,8 @@
183 183 */
184 184 static inline void tracehook_notify_resume(struct pt_regs *regs)
185 185 {
  186 + if (current->replacement_session_keyring)
  187 + key_replace_session_keyring();
186 188 }
187 189  
188 190 #endif /* <linux/tracehook.h> */