Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

all arches, signal: move restart_block to struct task_struct

If an attacker can cause a controlled kernel stack overflow, overwriting
the restart block is a very juicy exploit target. This is because the
restart_block is held in the same memory allocation as the kernel stack.

Moving the restart block to struct task_struct prevents this exploit by
making the restart_block harder to locate.

Note that there are other fields in thread_info that are also easy
targets, at least on some architectures.

It's also a decent simplification, since the restart code is more or less
identical on all architectures.

[james.hogan@imgtec.com: metag: align thread_info::supervisor_stack]
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: David Miller <davem@davemloft.net>
Acked-by: Richard Weinberger <richard@nod.at>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Cc: Steven Miao <realmz6@gmail.com>
Cc: Mark Salter <msalter@redhat.com>
Cc: Aurelien Jacquiot <a-jacquiot@ti.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Richard Kuo <rkuo@codeaurora.org>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: Helge Deller <deller@gmx.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Tested-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Chen Liqin <liqin.linux@gmail.com>
Cc: Lennox Wu <lennox.wu@gmail.com>
Cc: Chris Metcalf <cmetcalf@ezchip.com>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Andy Lutomirski and committed by
Linus Torvalds
f56141e3 edc924e0

+62 -194
-5
arch/alpha/include/asm/thread_info.h
··· 27 27 int bpt_nsaved; 28 28 unsigned long bpt_addr[2]; /* breakpoint handling */ 29 29 unsigned int bpt_insn[2]; 30 - 31 - struct restart_block restart_block; 32 30 }; 33 31 34 32 /* ··· 38 40 .exec_domain = &default_exec_domain, \ 39 41 .addr_limit = KERNEL_DS, \ 40 42 .preempt_count = INIT_PREEMPT_COUNT, \ 41 - .restart_block = { \ 42 - .fn = do_no_restart_syscall, \ 43 - }, \ 44 43 } 45 44 46 45 #define init_thread_info (init_thread_union.thread_info)
+1 -1
arch/alpha/kernel/signal.c
··· 150 150 struct switch_stack *sw = (struct switch_stack *)regs - 1; 151 151 long i, err = __get_user(regs->pc, &sc->sc_pc); 152 152 153 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 153 + current->restart_block.fn = do_no_restart_syscall; 154 154 155 155 sw->r26 = (unsigned long) ret_from_sys_call; 156 156
-4
arch/arc/include/asm/thread_info.h
··· 46 46 struct exec_domain *exec_domain;/* execution domain */ 47 47 __u32 cpu; /* current CPU */ 48 48 unsigned long thr_ptr; /* TLS ptr */ 49 - struct restart_block restart_block; 50 49 }; 51 50 52 51 /* ··· 61 62 .cpu = 0, \ 62 63 .preempt_count = INIT_PREEMPT_COUNT, \ 63 64 .addr_limit = KERNEL_DS, \ 64 - .restart_block = { \ 65 - .fn = do_no_restart_syscall, \ 66 - }, \ 67 65 } 68 66 69 67 #define init_thread_info (init_thread_union.thread_info)
+1 -1
arch/arc/kernel/signal.c
··· 104 104 struct pt_regs *regs = current_pt_regs(); 105 105 106 106 /* Always make any pending restarted system calls return -EINTR */ 107 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 107 + current->restart_block.fn = do_no_restart_syscall; 108 108 109 109 /* Since we stacked the signal on a word boundary, 110 110 * then 'sp' should be word aligned here. If it's
-4
arch/arm/include/asm/thread_info.h
··· 68 68 #ifdef CONFIG_ARM_THUMBEE 69 69 unsigned long thumbee_state; /* ThumbEE Handler Base register */ 70 70 #endif 71 - struct restart_block restart_block; 72 71 }; 73 72 74 73 #define INIT_THREAD_INFO(tsk) \ ··· 80 81 .cpu_domain = domain_val(DOMAIN_USER, DOMAIN_MANAGER) | \ 81 82 domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \ 82 83 domain_val(DOMAIN_IO, DOMAIN_CLIENT), \ 83 - .restart_block = { \ 84 - .fn = do_no_restart_syscall, \ 85 - }, \ 86 84 } 87 85 88 86 #define init_thread_info (init_thread_union.thread_info)
+2 -2
arch/arm/kernel/signal.c
··· 191 191 struct sigframe __user *frame; 192 192 193 193 /* Always make any pending restarted system calls return -EINTR */ 194 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 194 + current->restart_block.fn = do_no_restart_syscall; 195 195 196 196 /* 197 197 * Since we stacked the signal on a 64-bit boundary, ··· 221 221 struct rt_sigframe __user *frame; 222 222 223 223 /* Always make any pending restarted system calls return -EINTR */ 224 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 224 + current->restart_block.fn = do_no_restart_syscall; 225 225 226 226 /* 227 227 * Since we stacked the signal on a 64-bit boundary,
-4
arch/arm64/include/asm/thread_info.h
··· 48 48 mm_segment_t addr_limit; /* address limit */ 49 49 struct task_struct *task; /* main task structure */ 50 50 struct exec_domain *exec_domain; /* execution domain */ 51 - struct restart_block restart_block; 52 51 int preempt_count; /* 0 => preemptable, <0 => bug */ 53 52 int cpu; /* cpu */ 54 53 }; ··· 59 60 .flags = 0, \ 60 61 .preempt_count = INIT_PREEMPT_COUNT, \ 61 62 .addr_limit = KERNEL_DS, \ 62 - .restart_block = { \ 63 - .fn = do_no_restart_syscall, \ 64 - }, \ 65 63 } 66 64 67 65 #define init_thread_info (init_thread_union.thread_info)
+1 -1
arch/arm64/kernel/signal.c
··· 131 131 struct rt_sigframe __user *frame; 132 132 133 133 /* Always make any pending restarted system calls return -EINTR */ 134 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 134 + current->restart_block.fn = do_no_restart_syscall; 135 135 136 136 /* 137 137 * Since we stacked the signal on a 128-bit boundary, then 'sp' should
+2 -2
arch/arm64/kernel/signal32.c
··· 347 347 struct compat_sigframe __user *frame; 348 348 349 349 /* Always make any pending restarted system calls return -EINTR */ 350 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 350 + current->restart_block.fn = do_no_restart_syscall; 351 351 352 352 /* 353 353 * Since we stacked the signal on a 64-bit boundary, ··· 381 381 struct compat_rt_sigframe __user *frame; 382 382 383 383 /* Always make any pending restarted system calls return -EINTR */ 384 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 384 + current->restart_block.fn = do_no_restart_syscall; 385 385 386 386 /* 387 387 * Since we stacked the signal on a 64-bit boundary,
-4
arch/avr32/include/asm/thread_info.h
··· 30 30 saved by debug handler 31 31 when setting up 32 32 trampoline */ 33 - struct restart_block restart_block; 34 33 __u8 supervisor_stack[0]; 35 34 }; 36 35 ··· 40 41 .flags = 0, \ 41 42 .cpu = 0, \ 42 43 .preempt_count = INIT_PREEMPT_COUNT, \ 43 - .restart_block = { \ 44 - .fn = do_no_restart_syscall \ 45 - } \ 46 44 } 47 45 48 46 #define init_thread_info (init_thread_union.thread_info)
-1
arch/avr32/kernel/asm-offsets.c
··· 18 18 OFFSET(TI_preempt_count, thread_info, preempt_count); 19 19 OFFSET(TI_rar_saved, thread_info, rar_saved); 20 20 OFFSET(TI_rsr_saved, thread_info, rsr_saved); 21 - OFFSET(TI_restart_block, thread_info, restart_block); 22 21 BLANK(); 23 22 OFFSET(TSK_active_mm, task_struct, active_mm); 24 23 BLANK();
+1 -1
arch/avr32/kernel/signal.c
··· 69 69 sigset_t set; 70 70 71 71 /* Always make any pending restarted system calls return -EINTR */ 72 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 72 + current->restart_block.fn = do_no_restart_syscall; 73 73 74 74 frame = (struct rt_sigframe __user *)regs->sp; 75 75 pr_debug("SIG return: frame = %p\n", frame);
-4
arch/blackfin/include/asm/thread_info.h
··· 42 42 int cpu; /* cpu we're on */ 43 43 int preempt_count; /* 0 => preemptable, <0 => BUG */ 44 44 mm_segment_t addr_limit; /* address limit */ 45 - struct restart_block restart_block; 46 45 #ifndef CONFIG_SMP 47 46 struct l1_scratch_task_info l1_task_info; 48 47 #endif ··· 57 58 .flags = 0, \ 58 59 .cpu = 0, \ 59 60 .preempt_count = INIT_PREEMPT_COUNT, \ 60 - .restart_block = { \ 61 - .fn = do_no_restart_syscall, \ 62 - }, \ 63 61 } 64 62 #define init_thread_info (init_thread_union.thread_info) 65 63 #define init_stack (init_thread_union.stack)
+1 -1
arch/blackfin/kernel/signal.c
··· 44 44 int err = 0; 45 45 46 46 /* Always make any pending restarted system calls return -EINTR */ 47 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 47 + current->restart_block.fn = do_no_restart_syscall; 48 48 49 49 #define RESTORE(x) err |= __get_user(regs->x, &sc->sc_##x) 50 50
-4
arch/c6x/include/asm/thread_info.h
··· 45 45 int cpu; /* cpu we're on */ 46 46 int preempt_count; /* 0 = preemptable, <0 = BUG */ 47 47 mm_segment_t addr_limit; /* thread address space */ 48 - struct restart_block restart_block; 49 48 }; 50 49 51 50 /* ··· 60 61 .cpu = 0, \ 61 62 .preempt_count = INIT_PREEMPT_COUNT, \ 62 63 .addr_limit = KERNEL_DS, \ 63 - .restart_block = { \ 64 - .fn = do_no_restart_syscall, \ 65 - }, \ 66 64 } 67 65 68 66 #define init_thread_info (init_thread_union.thread_info)
+1 -1
arch/c6x/kernel/signal.c
··· 68 68 sigset_t set; 69 69 70 70 /* Always make any pending restarted system calls return -EINTR */ 71 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 71 + current->restart_block.fn = do_no_restart_syscall; 72 72 73 73 /* 74 74 * Since we stacked the signal on a dword boundary,
+1 -1
arch/cris/arch-v10/kernel/signal.c
··· 67 67 unsigned long old_usp; 68 68 69 69 /* Always make any pending restarted system calls return -EINTR */ 70 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 70 + current->restart_block.fn = do_no_restart_syscall; 71 71 72 72 /* restore the regs from &sc->regs (same as sc, since regs is first) 73 73 * (sc is already checked for VERIFY_READ since the sigframe was
+1 -1
arch/cris/arch-v32/kernel/signal.c
··· 59 59 unsigned long old_usp; 60 60 61 61 /* Always make any pending restarted system calls return -EINTR */ 62 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 62 + current->restart_block.fn = do_no_restart_syscall; 63 63 64 64 /* 65 65 * Restore the registers from &sc->regs. sc is already checked
-4
arch/cris/include/asm/thread_info.h
··· 38 38 0-0xBFFFFFFF for user-thead 39 39 0-0xFFFFFFFF for kernel-thread 40 40 */ 41 - struct restart_block restart_block; 42 41 __u8 supervisor_stack[0]; 43 42 }; 44 43 ··· 55 56 .cpu = 0, \ 56 57 .preempt_count = INIT_PREEMPT_COUNT, \ 57 58 .addr_limit = KERNEL_DS, \ 58 - .restart_block = { \ 59 - .fn = do_no_restart_syscall, \ 60 - }, \ 61 59 } 62 60 63 61 #define init_thread_info (init_thread_union.thread_info)
-4
arch/frv/include/asm/thread_info.h
··· 41 41 * 0-0xBFFFFFFF for user-thead 42 42 * 0-0xFFFFFFFF for kernel-thread 43 43 */ 44 - struct restart_block restart_block; 45 44 46 45 __u8 supervisor_stack[0]; 47 46 }; ··· 64 65 .cpu = 0, \ 65 66 .preempt_count = INIT_PREEMPT_COUNT, \ 66 67 .addr_limit = KERNEL_DS, \ 67 - .restart_block = { \ 68 - .fn = do_no_restart_syscall, \ 69 - }, \ 70 68 } 71 69 72 70 #define init_thread_info (init_thread_union.thread_info)
-1
arch/frv/kernel/asm-offsets.c
··· 40 40 OFFSET(TI_CPU, thread_info, cpu); 41 41 OFFSET(TI_PREEMPT_COUNT, thread_info, preempt_count); 42 42 OFFSET(TI_ADDR_LIMIT, thread_info, addr_limit); 43 - OFFSET(TI_RESTART_BLOCK, thread_info, restart_block); 44 43 BLANK(); 45 44 46 45 /* offsets into register file storage */
+1 -1
arch/frv/kernel/signal.c
··· 62 62 unsigned long tbr, psr; 63 63 64 64 /* Always make any pending restarted system calls return -EINTR */ 65 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 65 + current->restart_block.fn = do_no_restart_syscall; 66 66 67 67 tbr = user->i.tbr; 68 68 psr = user->i.psr;
-4
arch/hexagon/include/asm/thread_info.h
··· 56 56 * used for syscalls somehow; 57 57 * seems to have a function pointer and four arguments 58 58 */ 59 - struct restart_block restart_block; 60 59 /* Points to the current pt_regs frame */ 61 60 struct pt_regs *regs; 62 61 /* ··· 82 83 .cpu = 0, \ 83 84 .preempt_count = 1, \ 84 85 .addr_limit = KERNEL_DS, \ 85 - .restart_block = { \ 86 - .fn = do_no_restart_syscall, \ 87 - }, \ 88 86 .sp = 0, \ 89 87 .regs = NULL, \ 90 88 }
+1 -1
arch/hexagon/kernel/signal.c
··· 239 239 sigset_t blocked; 240 240 241 241 /* Always make any pending restarted system calls return -EINTR */ 242 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 242 + current->restart_block.fn = do_no_restart_syscall; 243 243 244 244 frame = (struct rt_sigframe __user *)pt_psp(regs); 245 245 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
-4
arch/ia64/include/asm/thread_info.h
··· 27 27 __u32 status; /* Thread synchronous flags */ 28 28 mm_segment_t addr_limit; /* user-level address space limit */ 29 29 int preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */ 30 - struct restart_block restart_block; 31 30 #ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE 32 31 __u64 ac_stamp; 33 32 __u64 ac_leave; ··· 45 46 .cpu = 0, \ 46 47 .addr_limit = KERNEL_DS, \ 47 48 .preempt_count = INIT_PREEMPT_COUNT, \ 48 - .restart_block = { \ 49 - .fn = do_no_restart_syscall, \ 50 - }, \ 51 49 } 52 50 53 51 #ifndef ASM_OFFSETS_C
+1 -1
arch/ia64/kernel/signal.c
··· 46 46 long err; 47 47 48 48 /* Always make any pending restarted system calls return -EINTR */ 49 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 49 + current->restart_block.fn = do_no_restart_syscall; 50 50 51 51 /* restore scratch that always needs gets updated during signal delivery: */ 52 52 err = __get_user(flags, &sc->sc_flags);
-5
arch/m32r/include/asm/thread_info.h
··· 34 34 0-0xBFFFFFFF for user-thread 35 35 0-0xFFFFFFFF for kernel-thread 36 36 */ 37 - struct restart_block restart_block; 38 37 39 38 __u8 supervisor_stack[0]; 40 39 }; ··· 48 49 #define TI_CPU 0x00000010 49 50 #define TI_PRE_COUNT 0x00000014 50 51 #define TI_ADDR_LIMIT 0x00000018 51 - #define TI_RESTART_BLOCK 0x000001C 52 52 53 53 #endif 54 54 ··· 66 68 .cpu = 0, \ 67 69 .preempt_count = INIT_PREEMPT_COUNT, \ 68 70 .addr_limit = KERNEL_DS, \ 69 - .restart_block = { \ 70 - .fn = do_no_restart_syscall, \ 71 - }, \ 72 71 } 73 72 74 73 #define init_thread_info (init_thread_union.thread_info)
+1 -1
arch/m32r/kernel/signal.c
··· 48 48 unsigned int err = 0; 49 49 50 50 /* Always make any pending restarted system calls return -EINTR */ 51 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 51 + current->restart_block.fn = do_no_restart_syscall; 52 52 53 53 #define COPY(x) err |= __get_user(regs->x, &sc->sc_##x) 54 54 COPY(r4);
-4
arch/m68k/include/asm/thread_info.h
··· 31 31 int preempt_count; /* 0 => preemptable, <0 => BUG */ 32 32 __u32 cpu; /* should always be 0 on m68k */ 33 33 unsigned long tp_value; /* thread pointer */ 34 - struct restart_block restart_block; 35 34 }; 36 35 #endif /* __ASSEMBLY__ */ 37 36 ··· 40 41 .exec_domain = &default_exec_domain, \ 41 42 .addr_limit = KERNEL_DS, \ 42 43 .preempt_count = INIT_PREEMPT_COUNT, \ 43 - .restart_block = { \ 44 - .fn = do_no_restart_syscall, \ 45 - }, \ 46 44 } 47 45 48 46 #define init_stack (init_thread_union.stack)
+2 -2
arch/m68k/kernel/signal.c
··· 655 655 int err = 0; 656 656 657 657 /* Always make any pending restarted system calls return -EINTR */ 658 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 658 + current->restart_block.fn = do_no_restart_syscall; 659 659 660 660 /* get previous context */ 661 661 if (copy_from_user(&context, usc, sizeof(context))) ··· 693 693 int err; 694 694 695 695 /* Always make any pending restarted system calls return -EINTR */ 696 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 696 + current->restart_block.fn = do_no_restart_syscall; 697 697 698 698 err = __get_user(temp, &uc->uc_mcontext.version); 699 699 if (temp != MCONTEXT_VERSION)
+1 -5
arch/metag/include/asm/thread_info.h
··· 35 35 int preempt_count; /* 0 => preemptable, <0 => BUG */ 36 36 37 37 mm_segment_t addr_limit; /* thread address space */ 38 - struct restart_block restart_block; 39 38 40 - u8 supervisor_stack[0]; 39 + u8 supervisor_stack[0] __aligned(8); 41 40 }; 42 41 43 42 #else /* !__ASSEMBLY__ */ ··· 73 74 .cpu = 0, \ 74 75 .preempt_count = INIT_PREEMPT_COUNT, \ 75 76 .addr_limit = KERNEL_DS, \ 76 - .restart_block = { \ 77 - .fn = do_no_restart_syscall, \ 78 - }, \ 79 77 } 80 78 81 79 #define init_thread_info (init_thread_union.thread_info)
+1 -1
arch/metag/kernel/signal.c
··· 48 48 int err; 49 49 50 50 /* Always make any pending restarted system calls return -EINTR */ 51 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 51 + current->restart_block.fn = do_no_restart_syscall; 52 52 53 53 err = metag_gp_regs_copyin(regs, 0, sizeof(struct user_gp_regs), NULL, 54 54 &sc->regs);
-4
arch/microblaze/include/asm/thread_info.h
··· 71 71 __u32 cpu; /* current CPU */ 72 72 __s32 preempt_count; /* 0 => preemptable,< 0 => BUG*/ 73 73 mm_segment_t addr_limit; /* thread address space */ 74 - struct restart_block restart_block; 75 74 76 75 struct cpu_context cpu_context; 77 76 }; ··· 86 87 .cpu = 0, \ 87 88 .preempt_count = INIT_PREEMPT_COUNT, \ 88 89 .addr_limit = KERNEL_DS, \ 89 - .restart_block = { \ 90 - .fn = do_no_restart_syscall, \ 91 - }, \ 92 90 } 93 91 94 92 #define init_thread_info (init_thread_union.thread_info)
+1 -1
arch/microblaze/kernel/signal.c
··· 89 89 int rval; 90 90 91 91 /* Always make any pending restarted system calls return -EINTR */ 92 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 92 + current->restart_block.fn = do_no_restart_syscall; 93 93 94 94 if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) 95 95 goto badframe;
-4
arch/mips/include/asm/thread_info.h
··· 34 34 * 0x7fffffff for user-thead 35 35 * 0xffffffff for kernel-thread 36 36 */ 37 - struct restart_block restart_block; 38 37 struct pt_regs *regs; 39 38 long syscall; /* syscall number */ 40 39 }; ··· 49 50 .cpu = 0, \ 50 51 .preempt_count = INIT_PREEMPT_COUNT, \ 51 52 .addr_limit = KERNEL_DS, \ 52 - .restart_block = { \ 53 - .fn = do_no_restart_syscall, \ 54 - }, \ 55 53 } 56 54 57 55 #define init_thread_info (init_thread_union.thread_info)
-1
arch/mips/kernel/asm-offsets.c
··· 98 98 OFFSET(TI_CPU, thread_info, cpu); 99 99 OFFSET(TI_PRE_COUNT, thread_info, preempt_count); 100 100 OFFSET(TI_ADDR_LIMIT, thread_info, addr_limit); 101 - OFFSET(TI_RESTART_BLOCK, thread_info, restart_block); 102 101 OFFSET(TI_REGS, thread_info, regs); 103 102 DEFINE(_THREAD_SIZE, THREAD_SIZE); 104 103 DEFINE(_THREAD_MASK, THREAD_MASK);
+1 -1
arch/mips/kernel/signal.c
··· 243 243 int i; 244 244 245 245 /* Always make any pending restarted system calls return -EINTR */ 246 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 246 + current->restart_block.fn = do_no_restart_syscall; 247 247 248 248 err |= __get_user(regs->cp0_epc, &sc->sc_pc); 249 249
+1 -1
arch/mips/kernel/signal32.c
··· 220 220 int i; 221 221 222 222 /* Always make any pending restarted system calls return -EINTR */ 223 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 223 + current->restart_block.fn = do_no_restart_syscall; 224 224 225 225 err |= __get_user(regs->cp0_epc, &sc->sc_pc); 226 226 err |= __get_user(regs->hi, &sc->sc_mdhi);
-4
arch/mn10300/include/asm/thread_info.h
··· 50 50 0-0xBFFFFFFF for user-thead 51 51 0-0xFFFFFFFF for kernel-thread 52 52 */ 53 - struct restart_block restart_block; 54 53 55 54 __u8 supervisor_stack[0]; 56 55 }; ··· 79 80 .cpu = 0, \ 80 81 .preempt_count = INIT_PREEMPT_COUNT, \ 81 82 .addr_limit = KERNEL_DS, \ 82 - .restart_block = { \ 83 - .fn = do_no_restart_syscall, \ 84 - }, \ 85 83 } 86 84 87 85 #define init_thread_info (init_thread_union.thread_info)
-1
arch/mn10300/kernel/asm-offsets.c
··· 28 28 OFFSET(TI_cpu, thread_info, cpu); 29 29 OFFSET(TI_preempt_count, thread_info, preempt_count); 30 30 OFFSET(TI_addr_limit, thread_info, addr_limit); 31 - OFFSET(TI_restart_block, thread_info, restart_block); 32 31 BLANK(); 33 32 34 33 OFFSET(REG_D0, pt_regs, d0);
+1 -1
arch/mn10300/kernel/signal.c
··· 40 40 unsigned int err = 0; 41 41 42 42 /* Always make any pending restarted system calls return -EINTR */ 43 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 43 + current->restart_block.fn = do_no_restart_syscall; 44 44 45 45 if (is_using_fpu(current)) 46 46 fpu_kill_state(current);
-4
arch/openrisc/include/asm/thread_info.h
··· 57 57 0-0x7FFFFFFF for user-thead 58 58 0-0xFFFFFFFF for kernel-thread 59 59 */ 60 - struct restart_block restart_block; 61 60 __u8 supervisor_stack[0]; 62 61 63 62 /* saved context data */ ··· 78 79 .cpu = 0, \ 79 80 .preempt_count = 1, \ 80 81 .addr_limit = KERNEL_DS, \ 81 - .restart_block = { \ 82 - .fn = do_no_restart_syscall, \ 83 - }, \ 84 82 .ksp = 0, \ 85 83 } 86 84
+1 -1
arch/openrisc/kernel/signal.c
··· 46 46 int err = 0; 47 47 48 48 /* Always make any pending restarted system calls return -EINTR */ 49 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 49 + current->restart_block.fn = do_no_restart_syscall; 50 50 51 51 /* 52 52 * Restore the regs from &sc->regs.
-4
arch/parisc/include/asm/thread_info.h
··· 14 14 mm_segment_t addr_limit; /* user-level address space limit */ 15 15 __u32 cpu; /* current CPU */ 16 16 int preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */ 17 - struct restart_block restart_block; 18 17 }; 19 18 20 19 #define INIT_THREAD_INFO(tsk) \ ··· 24 25 .cpu = 0, \ 25 26 .addr_limit = KERNEL_DS, \ 26 27 .preempt_count = INIT_PREEMPT_COUNT, \ 27 - .restart_block = { \ 28 - .fn = do_no_restart_syscall \ 29 - } \ 30 28 } 31 29 32 30 #define init_thread_info (init_thread_union.thread_info)
+1 -1
arch/parisc/kernel/signal.c
··· 99 99 sigframe_size = PARISC_RT_SIGFRAME_SIZE32; 100 100 #endif 101 101 102 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 102 + current->restart_block.fn = do_no_restart_syscall; 103 103 104 104 /* Unwind the user stack to get the rt_sigframe structure. */ 105 105 frame = (struct rt_sigframe __user *)
-4
arch/powerpc/include/asm/thread_info.h
··· 43 43 int cpu; /* cpu we're on */ 44 44 int preempt_count; /* 0 => preemptable, 45 45 <0 => BUG */ 46 - struct restart_block restart_block; 47 46 unsigned long local_flags; /* private flags for thread */ 48 47 49 48 /* low level flags - has atomic operations done on it */ ··· 58 59 .exec_domain = &default_exec_domain, \ 59 60 .cpu = 0, \ 60 61 .preempt_count = INIT_PREEMPT_COUNT, \ 61 - .restart_block = { \ 62 - .fn = do_no_restart_syscall, \ 63 - }, \ 64 62 .flags = 0, \ 65 63 } 66 64
+2 -2
arch/powerpc/kernel/signal_32.c
··· 1231 1231 int tm_restore = 0; 1232 1232 #endif 1233 1233 /* Always make any pending restarted system calls return -EINTR */ 1234 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 1234 + current->restart_block.fn = do_no_restart_syscall; 1235 1235 1236 1236 rt_sf = (struct rt_sigframe __user *) 1237 1237 (regs->gpr[1] + __SIGNAL_FRAMESIZE + 16); ··· 1504 1504 #endif 1505 1505 1506 1506 /* Always make any pending restarted system calls return -EINTR */ 1507 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 1507 + current->restart_block.fn = do_no_restart_syscall; 1508 1508 1509 1509 sf = (struct sigframe __user *)(regs->gpr[1] + __SIGNAL_FRAMESIZE); 1510 1510 sc = &sf->sctx;
+1 -1
arch/powerpc/kernel/signal_64.c
··· 666 666 #endif 667 667 668 668 /* Always make any pending restarted system calls return -EINTR */ 669 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 669 + current->restart_block.fn = do_no_restart_syscall; 670 670 671 671 if (!access_ok(VERIFY_READ, uc, sizeof(*uc))) 672 672 goto badframe;
-4
arch/s390/include/asm/thread_info.h
··· 39 39 unsigned long sys_call_table; /* System call table address */ 40 40 unsigned int cpu; /* current CPU */ 41 41 int preempt_count; /* 0 => preemptable, <0 => BUG */ 42 - struct restart_block restart_block; 43 42 unsigned int system_call; 44 43 __u64 user_timer; 45 44 __u64 system_timer; ··· 55 56 .flags = 0, \ 56 57 .cpu = 0, \ 57 58 .preempt_count = INIT_PREEMPT_COUNT, \ 58 - .restart_block = { \ 59 - .fn = do_no_restart_syscall, \ 60 - }, \ 61 59 } 62 60 63 61 #define init_thread_info (init_thread_union.thread_info)
+1 -1
arch/s390/kernel/compat_signal.c
··· 209 209 int i; 210 210 211 211 /* Alwys make any pending restarted system call return -EINTR */ 212 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 212 + current->restart_block.fn = do_no_restart_syscall; 213 213 214 214 if (__copy_from_user(&user_sregs, &sregs->regs, sizeof(user_sregs))) 215 215 return -EFAULT;
+1 -1
arch/s390/kernel/signal.c
··· 162 162 _sigregs user_sregs; 163 163 164 164 /* Alwys make any pending restarted system call return -EINTR */ 165 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 165 + current->restart_block.fn = do_no_restart_syscall; 166 166 167 167 if (__copy_from_user(&user_sregs, sregs, sizeof(user_sregs))) 168 168 return -EFAULT;
-4
arch/score/include/asm/thread_info.h
··· 42 42 * 0-0xFFFFFFFF for kernel-thread 43 43 */ 44 44 mm_segment_t addr_limit; 45 - struct restart_block restart_block; 46 45 struct pt_regs *regs; 47 46 }; 48 47 ··· 57 58 .cpu = 0, \ 58 59 .preempt_count = 1, \ 59 60 .addr_limit = KERNEL_DS, \ 60 - .restart_block = { \ 61 - .fn = do_no_restart_syscall, \ 62 - }, \ 63 61 } 64 62 65 63 #define init_thread_info (init_thread_union.thread_info)
-1
arch/score/kernel/asm-offsets.c
··· 106 106 OFFSET(TI_CPU, thread_info, cpu); 107 107 OFFSET(TI_PRE_COUNT, thread_info, preempt_count); 108 108 OFFSET(TI_ADDR_LIMIT, thread_info, addr_limit); 109 - OFFSET(TI_RESTART_BLOCK, thread_info, restart_block); 110 109 OFFSET(TI_REGS, thread_info, regs); 111 110 DEFINE(KERNEL_STACK_SIZE, THREAD_SIZE); 112 111 DEFINE(KERNEL_STACK_MASK, THREAD_MASK);
+1 -1
arch/score/kernel/signal.c
··· 141 141 int sig; 142 142 143 143 /* Always make any pending restarted system calls return -EINTR */ 144 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 144 + current->restart_block.fn = do_no_restart_syscall; 145 145 146 146 frame = (struct rt_sigframe __user *) regs->regs[0]; 147 147 if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
-4
arch/sh/include/asm/thread_info.h
··· 33 33 __u32 cpu; 34 34 int preempt_count; /* 0 => preemptable, <0 => BUG */ 35 35 mm_segment_t addr_limit; /* thread address space */ 36 - struct restart_block restart_block; 37 36 unsigned long previous_sp; /* sp of previous stack in case 38 37 of nested IRQ stacks */ 39 38 __u8 supervisor_stack[0]; ··· 62 63 .cpu = 0, \ 63 64 .preempt_count = INIT_PREEMPT_COUNT, \ 64 65 .addr_limit = KERNEL_DS, \ 65 - .restart_block = { \ 66 - .fn = do_no_restart_syscall, \ 67 - }, \ 68 66 } 69 67 70 68 #define init_thread_info (init_thread_union.thread_info)
-1
arch/sh/kernel/asm-offsets.c
··· 25 25 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); 26 26 DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); 27 27 DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count)); 28 - DEFINE(TI_RESTART_BLOCK,offsetof(struct thread_info, restart_block)); 29 28 DEFINE(TI_SIZE, sizeof(struct thread_info)); 30 29 31 30 #ifdef CONFIG_HIBERNATION
+2 -2
arch/sh/kernel/signal_32.c
··· 156 156 int r0; 157 157 158 158 /* Always make any pending restarted system calls return -EINTR */ 159 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 159 + current->restart_block.fn = do_no_restart_syscall; 160 160 161 161 if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) 162 162 goto badframe; ··· 186 186 int r0; 187 187 188 188 /* Always make any pending restarted system calls return -EINTR */ 189 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 189 + current->restart_block.fn = do_no_restart_syscall; 190 190 191 191 if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) 192 192 goto badframe;
+2 -2
arch/sh/kernel/signal_64.c
··· 260 260 long long ret; 261 261 262 262 /* Always make any pending restarted system calls return -EINTR */ 263 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 263 + current->restart_block.fn = do_no_restart_syscall; 264 264 265 265 if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) 266 266 goto badframe; ··· 294 294 long long ret; 295 295 296 296 /* Always make any pending restarted system calls return -EINTR */ 297 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 297 + current->restart_block.fn = do_no_restart_syscall; 298 298 299 299 if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) 300 300 goto badframe;
-6
arch/sparc/include/asm/thread_info_32.h
··· 47 47 struct reg_window32 reg_window[NSWINS]; /* align for ldd! */ 48 48 unsigned long rwbuf_stkptrs[NSWINS]; 49 49 unsigned long w_saved; 50 - 51 - struct restart_block restart_block; 52 50 }; 53 51 54 52 /* ··· 60 62 .flags = 0, \ 61 63 .cpu = 0, \ 62 64 .preempt_count = INIT_PREEMPT_COUNT, \ 63 - .restart_block = { \ 64 - .fn = do_no_restart_syscall, \ 65 - }, \ 66 65 } 67 66 68 67 #define init_thread_info (init_thread_union.thread_info) ··· 98 103 #define TI_REG_WINDOW 0x30 99 104 #define TI_RWIN_SPTRS 0x230 100 105 #define TI_W_SAVED 0x250 101 - /* #define TI_RESTART_BLOCK 0x25n */ /* Nobody cares */ 102 106 103 107 /* 104 108 * thread information flag bit numbers
+3 -9
arch/sparc/include/asm/thread_info_64.h
··· 58 58 unsigned long gsr[7]; 59 59 unsigned long xfsr[7]; 60 60 61 - struct restart_block restart_block; 62 - 63 61 struct pt_regs *kern_una_regs; 64 62 unsigned int kern_una_insn; 65 63 ··· 90 92 #define TI_RWIN_SPTRS 0x000003c8 91 93 #define TI_GSR 0x00000400 92 94 #define TI_XFSR 0x00000438 93 - #define TI_RESTART_BLOCK 0x00000470 94 - #define TI_KUNA_REGS 0x000004a0 95 - #define TI_KUNA_INSN 0x000004a8 96 - #define TI_FPREGS 0x000004c0 95 + #define TI_KUNA_REGS 0x00000470 96 + #define TI_KUNA_INSN 0x00000478 97 + #define TI_FPREGS 0x00000480 97 98 98 99 /* We embed this in the uppermost byte of thread_info->flags */ 99 100 #define FAULT_CODE_WRITE 0x01 /* Write access, implies D-TLB */ ··· 121 124 .current_ds = ASI_P, \ 122 125 .exec_domain = &default_exec_domain, \ 123 126 .preempt_count = INIT_PREEMPT_COUNT, \ 124 - .restart_block = { \ 125 - .fn = do_no_restart_syscall, \ 126 - }, \ 127 127 } 128 128 129 129 #define init_thread_info (init_thread_union.thread_info)
+2 -2
arch/sparc/kernel/signal32.c
··· 150 150 int err, i; 151 151 152 152 /* Always make any pending restarted system calls return -EINTR */ 153 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 153 + current->restart_block.fn = do_no_restart_syscall; 154 154 155 155 synchronize_user_stack(); 156 156 ··· 235 235 int err, i; 236 236 237 237 /* Always make any pending restarted system calls return -EINTR */ 238 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 238 + current->restart_block.fn = do_no_restart_syscall; 239 239 240 240 synchronize_user_stack(); 241 241 regs->u_regs[UREG_FP] &= 0x00000000ffffffffUL;
+1 -1
arch/sparc/kernel/signal_32.c
··· 70 70 int err; 71 71 72 72 /* Always make any pending restarted system calls return -EINTR */ 73 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 73 + current->restart_block.fn = do_no_restart_syscall; 74 74 75 75 synchronize_user_stack(); 76 76
+1 -1
arch/sparc/kernel/signal_64.c
··· 254 254 int err; 255 255 256 256 /* Always make any pending restarted system calls return -EINTR */ 257 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 257 + current->restart_block.fn = do_no_restart_syscall; 258 258 259 259 synchronize_user_stack (); 260 260 sf = (struct rt_signal_frame __user *)
-2
arch/sparc/kernel/traps_64.c
··· 2730 2730 TI_NEW_CHILD != offsetof(struct thread_info, new_child) || 2731 2731 TI_CURRENT_DS != offsetof(struct thread_info, 2732 2732 current_ds) || 2733 - TI_RESTART_BLOCK != offsetof(struct thread_info, 2734 - restart_block) || 2735 2733 TI_KUNA_REGS != offsetof(struct thread_info, 2736 2734 kern_una_regs) || 2737 2735 TI_KUNA_INSN != offsetof(struct thread_info,
-4
arch/tile/include/asm/thread_info.h
··· 36 36 37 37 mm_segment_t addr_limit; /* thread address space 38 38 (KERNEL_DS or USER_DS) */ 39 - struct restart_block restart_block; 40 39 struct single_step_state *step_state; /* single step state 41 40 (if non-zero) */ 42 41 int align_ctl; /* controls unaligned access */ ··· 56 57 .cpu = 0, \ 57 58 .preempt_count = INIT_PREEMPT_COUNT, \ 58 59 .addr_limit = KERNEL_DS, \ 59 - .restart_block = { \ 60 - .fn = do_no_restart_syscall, \ 61 - }, \ 62 60 .step_state = NULL, \ 63 61 .align_ctl = 0, \ 64 62 }
+1 -1
arch/tile/kernel/signal.c
··· 48 48 int err; 49 49 50 50 /* Always make any pending restarted system calls return -EINTR */ 51 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 51 + current->restart_block.fn = do_no_restart_syscall; 52 52 53 53 /* 54 54 * Enforce that sigcontext is like pt_regs, and doesn't mess
-4
arch/um/include/asm/thread_info.h
··· 22 22 mm_segment_t addr_limit; /* thread address space: 23 23 0-0xBFFFFFFF for user 24 24 0-0xFFFFFFFF for kernel */ 25 - struct restart_block restart_block; 26 25 struct thread_info *real_thread; /* Points to non-IRQ stack */ 27 26 }; 28 27 ··· 33 34 .cpu = 0, \ 34 35 .preempt_count = INIT_PREEMPT_COUNT, \ 35 36 .addr_limit = KERNEL_DS, \ 36 - .restart_block = { \ 37 - .fn = do_no_restart_syscall, \ 38 - }, \ 39 37 .real_thread = NULL, \ 40 38 } 41 39
-4
arch/unicore32/include/asm/thread_info.h
··· 79 79 #ifdef CONFIG_UNICORE_FPU_F64 80 80 struct fp_state fpstate __attribute__((aligned(8))); 81 81 #endif 82 - struct restart_block restart_block; 83 82 }; 84 83 85 84 #define INIT_THREAD_INFO(tsk) \ ··· 88 89 .flags = 0, \ 89 90 .preempt_count = INIT_PREEMPT_COUNT, \ 90 91 .addr_limit = KERNEL_DS, \ 91 - .restart_block = { \ 92 - .fn = do_no_restart_syscall, \ 93 - }, \ 94 92 } 95 93 96 94 #define init_thread_info (init_thread_union.thread_info)
+1 -1
arch/unicore32/kernel/signal.c
··· 105 105 struct rt_sigframe __user *frame; 106 106 107 107 /* Always make any pending restarted system calls return -EINTR */ 108 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 108 + current->restart_block.fn = do_no_restart_syscall; 109 109 110 110 /* 111 111 * Since we stacked the signal on a 64-bit boundary,
+1 -1
arch/x86/ia32/ia32_signal.c
··· 169 169 u32 tmp; 170 170 171 171 /* Always make any pending restarted system calls return -EINTR */ 172 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 172 + current->restart_block.fn = do_no_restart_syscall; 173 173 174 174 get_user_try { 175 175 /*
-4
arch/x86/include/asm/thread_info.h
··· 31 31 __u32 cpu; /* current CPU */ 32 32 int saved_preempt_count; 33 33 mm_segment_t addr_limit; 34 - struct restart_block restart_block; 35 34 void __user *sysenter_return; 36 35 unsigned int sig_on_uaccess_error:1; 37 36 unsigned int uaccess_err:1; /* uaccess failed */ ··· 44 45 .cpu = 0, \ 45 46 .saved_preempt_count = INIT_PREEMPT_COUNT, \ 46 47 .addr_limit = KERNEL_DS, \ 47 - .restart_block = { \ 48 - .fn = do_no_restart_syscall, \ 49 - }, \ 50 48 } 51 49 52 50 #define init_thread_info (init_thread_union.thread_info)
+1 -1
arch/x86/kernel/signal.c
··· 69 69 unsigned int err = 0; 70 70 71 71 /* Always make any pending restarted system calls return -EINTR */ 72 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 72 + current->restart_block.fn = do_no_restart_syscall; 73 73 74 74 get_user_try { 75 75
+1 -1
arch/x86/um/signal.c
··· 157 157 int err, pid; 158 158 159 159 /* Always make any pending restarted system calls return -EINTR */ 160 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 160 + current->restart_block.fn = do_no_restart_syscall; 161 161 162 162 err = copy_from_user(&sc, from, sizeof(sc)); 163 163 if (err)
-5
arch/xtensa/include/asm/thread_info.h
··· 51 51 __s32 preempt_count; /* 0 => preemptable,< 0 => BUG*/ 52 52 53 53 mm_segment_t addr_limit; /* thread address space */ 54 - struct restart_block restart_block; 55 54 56 55 unsigned long cpenable; 57 56 ··· 71 72 #define TI_CPU 0x00000010 72 73 #define TI_PRE_COUNT 0x00000014 73 74 #define TI_ADDR_LIMIT 0x00000018 74 - #define TI_RESTART_BLOCK 0x000001C 75 75 76 76 #endif 77 77 ··· 88 90 .cpu = 0, \ 89 91 .preempt_count = INIT_PREEMPT_COUNT, \ 90 92 .addr_limit = KERNEL_DS, \ 91 - .restart_block = { \ 92 - .fn = do_no_restart_syscall, \ 93 - }, \ 94 93 } 95 94 96 95 #define init_thread_info (init_thread_union.thread_info)
+1 -1
arch/xtensa/kernel/signal.c
··· 245 245 int ret; 246 246 247 247 /* Always make any pending restarted system calls return -EINTR */ 248 - current_thread_info()->restart_block.fn = do_no_restart_syscall; 248 + current->restart_block.fn = do_no_restart_syscall; 249 249 250 250 if (regs->depc > 64) 251 251 panic("rt_sigreturn in double exception!\n");
+1 -1
fs/select.c
··· 971 971 if (ret == -EINTR) { 972 972 struct restart_block *restart_block; 973 973 974 - restart_block = &current_thread_info()->restart_block; 974 + restart_block = &current->restart_block; 975 975 restart_block->fn = do_restart_poll; 976 976 restart_block->poll.ufds = ufds; 977 977 restart_block->poll.nfds = nfds;
+3
include/linux/init_task.h
··· 193 193 .nr_cpus_allowed= NR_CPUS, \ 194 194 .mm = NULL, \ 195 195 .active_mm = &init_mm, \ 196 + .restart_block = { \ 197 + .fn = do_no_restart_syscall, \ 198 + }, \ 196 199 .se = { \ 197 200 .group_node = LIST_HEAD_INIT(tsk.se.group_node), \ 198 201 }, \
+2
include/linux/sched.h
··· 1370 1370 1371 1371 unsigned long atomic_flags; /* Flags needing atomic access. */ 1372 1372 1373 + struct restart_block restart_block; 1374 + 1373 1375 pid_t pid; 1374 1376 pid_t tgid; 1375 1377
+2 -3
kernel/compat.c
··· 276 276 * core implementation decides to return random nonsense. 277 277 */ 278 278 if (ret == -ERESTART_RESTARTBLOCK) { 279 - struct restart_block *restart 280 - = &current_thread_info()->restart_block; 279 + struct restart_block *restart = &current->restart_block; 281 280 282 281 restart->fn = compat_nanosleep_restart; 283 282 restart->nanosleep.compat_rmtp = rmtp; ··· 859 860 return -EFAULT; 860 861 861 862 if (err == -ERESTART_RESTARTBLOCK) { 862 - restart = &current_thread_info()->restart_block; 863 + restart = &current->restart_block; 863 864 restart->fn = compat_clock_nanosleep_restart; 864 865 restart->nanosleep.compat_rmtp = rmtp; 865 866 }
+1 -1
kernel/futex.c
··· 2217 2217 if (!abs_time) 2218 2218 goto out; 2219 2219 2220 - restart = &current_thread_info()->restart_block; 2220 + restart = &current->restart_block; 2221 2221 restart->fn = futex_wait_restart; 2222 2222 restart->futex.uaddr = uaddr; 2223 2223 restart->futex.val = val;
+1 -1
kernel/signal.c
··· 2501 2501 */ 2502 2502 SYSCALL_DEFINE0(restart_syscall) 2503 2503 { 2504 - struct restart_block *restart = &current_thread_info()->restart_block; 2504 + struct restart_block *restart = &current->restart_block; 2505 2505 return restart->fn(restart); 2506 2506 } 2507 2507
+1 -1
kernel/time/alarmtimer.c
··· 788 788 goto out; 789 789 } 790 790 791 - restart = &current_thread_info()->restart_block; 791 + restart = &current->restart_block; 792 792 restart->fn = alarm_timer_nsleep_restart; 793 793 restart->nanosleep.clockid = type; 794 794 restart->nanosleep.expires = exp.tv64;
+1 -1
kernel/time/hrtimer.c
··· 1583 1583 goto out; 1584 1584 } 1585 1585 1586 - restart = &current_thread_info()->restart_block; 1586 + restart = &current->restart_block; 1587 1587 restart->fn = hrtimer_nanosleep_restart; 1588 1588 restart->nanosleep.clockid = t.timer.base->clockid; 1589 1589 restart->nanosleep.rmtp = rmtp;
+1 -2
kernel/time/posix-cpu-timers.c
··· 1334 1334 static int posix_cpu_nsleep(const clockid_t which_clock, int flags, 1335 1335 struct timespec *rqtp, struct timespec __user *rmtp) 1336 1336 { 1337 - struct restart_block *restart_block = 1338 - &current_thread_info()->restart_block; 1337 + struct restart_block *restart_block = &current->restart_block; 1339 1338 struct itimerspec it; 1340 1339 int error; 1341 1340