all arches, signal: move restart_block to struct task_struct
authorAndy Lutomirski <luto@amacapital.net>
Thu, 12 Feb 2015 23:01:14 +0000 (15:01 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 13 Feb 2015 02:54:12 +0000 (18:54 -0800)
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>
84 files changed:
arch/alpha/include/asm/thread_info.h
arch/alpha/kernel/signal.c
arch/arc/include/asm/thread_info.h
arch/arc/kernel/signal.c
arch/arm/include/asm/thread_info.h
arch/arm/kernel/signal.c
arch/arm64/include/asm/thread_info.h
arch/arm64/kernel/signal.c
arch/arm64/kernel/signal32.c
arch/avr32/include/asm/thread_info.h
arch/avr32/kernel/asm-offsets.c
arch/avr32/kernel/signal.c
arch/blackfin/include/asm/thread_info.h
arch/blackfin/kernel/signal.c
arch/c6x/include/asm/thread_info.h
arch/c6x/kernel/signal.c
arch/cris/arch-v10/kernel/signal.c
arch/cris/arch-v32/kernel/signal.c
arch/cris/include/asm/thread_info.h
arch/frv/include/asm/thread_info.h
arch/frv/kernel/asm-offsets.c
arch/frv/kernel/signal.c
arch/hexagon/include/asm/thread_info.h
arch/hexagon/kernel/signal.c
arch/ia64/include/asm/thread_info.h
arch/ia64/kernel/signal.c
arch/m32r/include/asm/thread_info.h
arch/m32r/kernel/signal.c
arch/m68k/include/asm/thread_info.h
arch/m68k/kernel/signal.c
arch/metag/include/asm/thread_info.h
arch/metag/kernel/signal.c
arch/microblaze/include/asm/thread_info.h
arch/microblaze/kernel/signal.c
arch/mips/include/asm/thread_info.h
arch/mips/kernel/asm-offsets.c
arch/mips/kernel/signal.c
arch/mips/kernel/signal32.c
arch/mn10300/include/asm/thread_info.h
arch/mn10300/kernel/asm-offsets.c
arch/mn10300/kernel/signal.c
arch/openrisc/include/asm/thread_info.h
arch/openrisc/kernel/signal.c
arch/parisc/include/asm/thread_info.h
arch/parisc/kernel/signal.c
arch/powerpc/include/asm/thread_info.h
arch/powerpc/kernel/signal_32.c
arch/powerpc/kernel/signal_64.c
arch/s390/include/asm/thread_info.h
arch/s390/kernel/compat_signal.c
arch/s390/kernel/signal.c
arch/score/include/asm/thread_info.h
arch/score/kernel/asm-offsets.c
arch/score/kernel/signal.c
arch/sh/include/asm/thread_info.h
arch/sh/kernel/asm-offsets.c
arch/sh/kernel/signal_32.c
arch/sh/kernel/signal_64.c
arch/sparc/include/asm/thread_info_32.h
arch/sparc/include/asm/thread_info_64.h
arch/sparc/kernel/signal32.c
arch/sparc/kernel/signal_32.c
arch/sparc/kernel/signal_64.c
arch/sparc/kernel/traps_64.c
arch/tile/include/asm/thread_info.h
arch/tile/kernel/signal.c
arch/um/include/asm/thread_info.h
arch/unicore32/include/asm/thread_info.h
arch/unicore32/kernel/signal.c
arch/x86/ia32/ia32_signal.c
arch/x86/include/asm/thread_info.h
arch/x86/kernel/signal.c
arch/x86/um/signal.c
arch/xtensa/include/asm/thread_info.h
arch/xtensa/kernel/signal.c
fs/select.c
include/linux/init_task.h
include/linux/sched.h
kernel/compat.c
kernel/futex.c
kernel/signal.c
kernel/time/alarmtimer.c
kernel/time/hrtimer.c
kernel/time/posix-cpu-timers.c

index 48bbea6898b30c23c4846d486347e1a17c16d5c2..d5b98ab514bbda2bbd6270ea7802a8a402857f37 100644 (file)
@@ -27,8 +27,6 @@ struct thread_info {
        int bpt_nsaved;
        unsigned long bpt_addr[2];              /* breakpoint handling  */
        unsigned int bpt_insn[2];
-
-       struct restart_block    restart_block;
 };
 
 /*
@@ -40,9 +38,6 @@ struct thread_info {
        .exec_domain    = &default_exec_domain, \
        .addr_limit     = KERNEL_DS,            \
        .preempt_count  = INIT_PREEMPT_COUNT,   \
-       .restart_block = {                      \
-               .fn = do_no_restart_syscall,    \
-       },                                      \
 }
 
 #define init_thread_info       (init_thread_union.thread_info)
index 6cec2881acbf2fe7f21195fb7eb036b4b5d75c80..8dbfb15f17450501a80f6b3439e16aeab3546158 100644 (file)
@@ -150,7 +150,7 @@ restore_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs)
        struct switch_stack *sw = (struct switch_stack *)regs - 1;
        long i, err = __get_user(regs->pc, &sc->sc_pc);
 
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        sw->r26 = (unsigned long) ret_from_sys_call;
 
index 02bc5ec0fb2e4e813249aeb42d04bb97aea8f4e9..1163a1838ac1ae4e6ef3220196d7a0cf581a72de 100644 (file)
@@ -46,7 +46,6 @@ struct thread_info {
        struct exec_domain *exec_domain;/* execution domain */
        __u32 cpu;                      /* current CPU */
        unsigned long thr_ptr;          /* TLS ptr */
-       struct restart_block restart_block;
 };
 
 /*
@@ -62,9 +61,6 @@ struct thread_info {
        .cpu        = 0,                        \
        .preempt_count  = INIT_PREEMPT_COUNT,   \
        .addr_limit = KERNEL_DS,                \
-       .restart_block  = {                     \
-               .fn = do_no_restart_syscall,    \
-       },                                      \
 }
 
 #define init_thread_info    (init_thread_union.thread_info)
index cb3142a2d40b2bd3c85a6c86741debab6a1cf334..114234e83caa25968e08302b5e61f14e152e2d16 100644 (file)
@@ -104,7 +104,7 @@ SYSCALL_DEFINE0(rt_sigreturn)
        struct pt_regs *regs = current_pt_regs();
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        /* Since we stacked the signal on a word boundary,
         * then 'sp' should be word aligned here.  If it's
index d890e41f55207b3b3df4d78f0c26354a85f94739..72812a1f3d1cc9df83c8b7354655adf345069dad 100644 (file)
@@ -68,7 +68,6 @@ struct thread_info {
 #ifdef CONFIG_ARM_THUMBEE
        unsigned long           thumbee_state;  /* ThumbEE Handler Base register */
 #endif
-       struct restart_block    restart_block;
 };
 
 #define INIT_THREAD_INFO(tsk)                                          \
@@ -81,9 +80,6 @@ struct thread_info {
        .cpu_domain     = domain_val(DOMAIN_USER, DOMAIN_MANAGER) |     \
                          domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) |   \
                          domain_val(DOMAIN_IO, DOMAIN_CLIENT),         \
-       .restart_block  = {                                             \
-               .fn     = do_no_restart_syscall,                        \
-       },                                                              \
 }
 
 #define init_thread_info       (init_thread_union.thread_info)
index 8aa6f1b87c9e2b1325c0ec8b8778f94f4106450b..023ac905e4c38c9858e5c644a374c343a0be334b 100644 (file)
@@ -191,7 +191,7 @@ asmlinkage int sys_sigreturn(struct pt_regs *regs)
        struct sigframe __user *frame;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        /*
         * Since we stacked the signal on a 64-bit boundary,
@@ -221,7 +221,7 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
        struct rt_sigframe __user *frame;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        /*
         * Since we stacked the signal on a 64-bit boundary,
index 459bf8e53208662a6117c5d496b5d21e08e67657..702e1e6a0d80f915871ff7c938b93695a22ba5aa 100644 (file)
@@ -48,7 +48,6 @@ struct thread_info {
        mm_segment_t            addr_limit;     /* address limit */
        struct task_struct      *task;          /* main task structure */
        struct exec_domain      *exec_domain;   /* execution domain */
-       struct restart_block    restart_block;
        int                     preempt_count;  /* 0 => preemptable, <0 => bug */
        int                     cpu;            /* cpu */
 };
@@ -60,9 +59,6 @@ struct thread_info {
        .flags          = 0,                                            \
        .preempt_count  = INIT_PREEMPT_COUNT,                           \
        .addr_limit     = KERNEL_DS,                                    \
-       .restart_block  = {                                             \
-               .fn     = do_no_restart_syscall,                        \
-       },                                                              \
 }
 
 #define init_thread_info       (init_thread_union.thread_info)
index 6fa792137eda6ad5014dc195b7fc2f98ed01b3bd..660ccf9f7524cb665e3318b32fa23bfe06577e05 100644 (file)
@@ -131,7 +131,7 @@ asmlinkage long sys_rt_sigreturn(struct pt_regs *regs)
        struct rt_sigframe __user *frame;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        /*
         * Since we stacked the signal on a 128-bit boundary, then 'sp' should
index e299de396e9b33d2c6945275b2d30d7285c3fbd9..c20a300e22137f741a236cb8385864b90fac9df4 100644 (file)
@@ -347,7 +347,7 @@ asmlinkage int compat_sys_sigreturn(struct pt_regs *regs)
        struct compat_sigframe __user *frame;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        /*
         * Since we stacked the signal on a 64-bit boundary,
@@ -381,7 +381,7 @@ asmlinkage int compat_sys_rt_sigreturn(struct pt_regs *regs)
        struct compat_rt_sigframe __user *frame;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        /*
         * Since we stacked the signal on a 64-bit boundary,
index a978f3fe7c25a2fc651b19179b846f3939047bd9..d56afa99a5149c5a2504d3e7c472a940b9ab4930 100644 (file)
@@ -30,7 +30,6 @@ struct thread_info {
                                                   saved by debug handler
                                                   when setting up
                                                   trampoline */
-       struct restart_block    restart_block;
        __u8                    supervisor_stack[0];
 };
 
@@ -41,9 +40,6 @@ struct thread_info {
        .flags          = 0,                                            \
        .cpu            = 0,                                            \
        .preempt_count  = INIT_PREEMPT_COUNT,                           \
-       .restart_block  = {                                             \
-               .fn     = do_no_restart_syscall                         \
-       }                                                               \
 }
 
 #define init_thread_info       (init_thread_union.thread_info)
index d6a8193a1d2f09c8d9356212db5bd6ae44efeda4..e41c84516e5d1e7949dd7279ac4ee8d2229c01af 100644 (file)
@@ -18,7 +18,6 @@ void foo(void)
        OFFSET(TI_preempt_count, thread_info, preempt_count);
        OFFSET(TI_rar_saved, thread_info, rar_saved);
        OFFSET(TI_rsr_saved, thread_info, rsr_saved);
-       OFFSET(TI_restart_block, thread_info, restart_block);
        BLANK();
        OFFSET(TSK_active_mm, task_struct, active_mm);
        BLANK();
index d309fbcc3bd641b6b5e92f070c4aa786c5577e2e..8f1c63b9b9839bd8de2562c55b72013b2cfc99cf 100644 (file)
@@ -69,7 +69,7 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
        sigset_t set;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        frame = (struct rt_sigframe __user *)regs->sp;
        pr_debug("SIG return: frame = %p\n", frame);
index 55f473bdad361a42ca625433a8d8bfb629f378bf..57c3a8bd583d46d34d2169637fbf4b9a838af172 100644 (file)
@@ -42,7 +42,6 @@ struct thread_info {
        int cpu;                /* cpu we're on */
        int preempt_count;      /* 0 => preemptable, <0 => BUG */
        mm_segment_t addr_limit;        /* address limit */
-       struct restart_block restart_block;
 #ifndef CONFIG_SMP
        struct l1_scratch_task_info l1_task_info;
 #endif
@@ -58,9 +57,6 @@ struct thread_info {
        .flags          = 0,                    \
        .cpu            = 0,                    \
        .preempt_count  = INIT_PREEMPT_COUNT,   \
-       .restart_block  = {                     \
-               .fn = do_no_restart_syscall,    \
-       },                                      \
 }
 #define init_thread_info       (init_thread_union.thread_info)
 #define init_stack             (init_thread_union.stack)
index ef275571d88533da4c1c4fabdc2314fa71b2eea1..f2a8b5493bd32820dfd96eacaf168be2c4fc3b8e 100644 (file)
@@ -44,7 +44,7 @@ rt_restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *p
        int err = 0;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
 #define RESTORE(x) err |= __get_user(regs->x, &sc->sc_##x)
 
index d4e9ef87076dbe4e0013876c27fdd84d69840d75..584e253f32179952ab1d4b77a53892fe4e42d608 100644 (file)
@@ -45,7 +45,6 @@ struct thread_info {
        int                     cpu;            /* cpu we're on */
        int                     preempt_count;  /* 0 = preemptable, <0 = BUG */
        mm_segment_t            addr_limit;     /* thread address space */
-       struct restart_block    restart_block;
 };
 
 /*
@@ -61,9 +60,6 @@ struct thread_info {
        .cpu            = 0,                    \
        .preempt_count  = INIT_PREEMPT_COUNT,   \
        .addr_limit     = KERNEL_DS,            \
-       .restart_block  = {                     \
-               .fn = do_no_restart_syscall,    \
-       },                                      \
 }
 
 #define init_thread_info       (init_thread_union.thread_info)
index fe68226f6c4d6080393e6bf3473fe586cb199a1b..3c4bb5a5c3820a1d3ad7b7a1ffef55f6206ff838 100644 (file)
@@ -68,7 +68,7 @@ asmlinkage int do_rt_sigreturn(struct pt_regs *regs)
        sigset_t set;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        /*
         * Since we stacked the signal on a dword boundary,
index 9b32d338838b75935277165034a8de309412cde6..74d7ba35120d3130a611f3aba8433139a7dc7a97 100644 (file)
@@ -67,7 +67,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
        unsigned long old_usp;
 
         /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        /* restore the regs from &sc->regs (same as sc, since regs is first)
         * (sc is already checked for VERIFY_READ since the sigframe was
index 78ce3b1c9bcb05748f59b1e574e1d41b245fd25b..870e3e069318522ef26912ee92c4453721782ec9 100644 (file)
@@ -59,7 +59,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
        unsigned long old_usp;
 
         /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        /*
         * Restore the registers from &sc->regs. sc is already checked
index 55dede18c032e37195cdb5c17ccebfddebc505a8..7286db5ed90e383161df1a72573b957d528b6540 100644 (file)
@@ -38,7 +38,6 @@ struct thread_info {
                                                   0-0xBFFFFFFF for user-thead
                                                   0-0xFFFFFFFF for kernel-thread
                                                */
-       struct restart_block    restart_block;
        __u8                    supervisor_stack[0];
 };
 
@@ -56,9 +55,6 @@ struct thread_info {
        .cpu            = 0,                            \
        .preempt_count  = INIT_PREEMPT_COUNT,           \
        .addr_limit     = KERNEL_DS,                    \
-       .restart_block = {                              \
-                      .fn = do_no_restart_syscall,     \
-       },                                              \
 }
 
 #define init_thread_info       (init_thread_union.thread_info)
index af29e17c01814a2d88be2ca5d535f31441ddc474..6b917f1c29554304758f75e8fb50405da3217f68 100644 (file)
@@ -41,7 +41,6 @@ struct thread_info {
                                                 * 0-0xBFFFFFFF for user-thead
                                                 * 0-0xFFFFFFFF for kernel-thread
                                                 */
-       struct restart_block    restart_block;
 
        __u8                    supervisor_stack[0];
 };
@@ -65,9 +64,6 @@ struct thread_info {
        .cpu            = 0,                    \
        .preempt_count  = INIT_PREEMPT_COUNT,   \
        .addr_limit     = KERNEL_DS,            \
-       .restart_block = {                      \
-               .fn = do_no_restart_syscall,    \
-       },                                      \
 }
 
 #define init_thread_info       (init_thread_union.thread_info)
index 9de96843a27808d0f98e0221057f6d2b53a02f06..446e89d500cc4fe9db3a8ad97c655df7c6c585d0 100644 (file)
@@ -40,7 +40,6 @@ void foo(void)
        OFFSET(TI_CPU,                  thread_info, cpu);
        OFFSET(TI_PREEMPT_COUNT,        thread_info, preempt_count);
        OFFSET(TI_ADDR_LIMIT,           thread_info, addr_limit);
-       OFFSET(TI_RESTART_BLOCK,        thread_info, restart_block);
        BLANK();
 
        /* offsets into register file storage */
index dc3d59de08704636d44672b4c81e3b8d544292b7..336713ab47454fa2afd8e603d53255f5d91acaa0 100644 (file)
@@ -62,7 +62,7 @@ static int restore_sigcontext(struct sigcontext __user *sc, int *_gr8)
        unsigned long tbr, psr;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        tbr = user->i.tbr;
        psr = user->i.psr;
index a59dad3b3695112e6f15633de0f3b9304af17532..bacd3d6030c5764a5bf8762f54666b2f5d7cbfa8 100644 (file)
@@ -56,7 +56,6 @@ struct thread_info {
         * used for syscalls somehow;
         * seems to have a function pointer and four arguments
         */
-       struct restart_block    restart_block;
        /* Points to the current pt_regs frame  */
        struct pt_regs          *regs;
        /*
@@ -83,9 +82,6 @@ struct thread_info {
        .cpu            = 0,                    \
        .preempt_count  = 1,                    \
        .addr_limit     = KERNEL_DS,            \
-       .restart_block = {                      \
-               .fn = do_no_restart_syscall,    \
-       },                                      \
        .sp = 0,                                \
        .regs = NULL,                   \
 }
index eadd70e47e7edd9f52994c9aad79d326ff6f15e6..b039a624c170a331b05e28a1d0f1bdb22f76d7ba 100644 (file)
@@ -239,7 +239,7 @@ asmlinkage int sys_rt_sigreturn(void)
        sigset_t blocked;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        frame = (struct rt_sigframe __user *)pt_psp(regs);
        if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
index 5b17418b42239be81694cdc7b3c1f60ae68c5347..c16f21a068ff7edc553dff54570463622d5f5f9f 100644 (file)
@@ -27,7 +27,6 @@ struct thread_info {
        __u32 status;                   /* Thread synchronous flags */
        mm_segment_t addr_limit;        /* user-level address space limit */
        int preempt_count;              /* 0=premptable, <0=BUG; will also serve as bh-counter */
-       struct restart_block restart_block;
 #ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
        __u64 ac_stamp;
        __u64 ac_leave;
@@ -46,9 +45,6 @@ struct thread_info {
        .cpu            = 0,                    \
        .addr_limit     = KERNEL_DS,            \
        .preempt_count  = INIT_PREEMPT_COUNT,   \
-       .restart_block = {                      \
-               .fn = do_no_restart_syscall,    \
-       },                                      \
 }
 
 #ifndef ASM_OFFSETS_C
index 6d92170be4579cd6b52b8dc2c417bb5f1a9bd040..b3a124da71e5ec7cd960dc5e18096379ed0f860d 100644 (file)
@@ -46,7 +46,7 @@ restore_sigcontext (struct sigcontext __user *sc, struct sigscratch *scr)
        long err;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        /* restore scratch that always needs gets updated during signal delivery: */
        err  = __get_user(flags, &sc->sc_flags);
index 00171703402f19b576612f699bf733fe12252390..32422d0211c3d50e405cb66bacc9712d44a53196 100644 (file)
@@ -34,7 +34,6 @@ struct thread_info {
                                                   0-0xBFFFFFFF for user-thread
                                                   0-0xFFFFFFFF for kernel-thread
                                                */
-       struct restart_block    restart_block;
 
        __u8                    supervisor_stack[0];
 };
@@ -49,7 +48,6 @@ struct thread_info {
 #define TI_CPU         0x00000010
 #define TI_PRE_COUNT   0x00000014
 #define TI_ADDR_LIMIT  0x00000018
-#define TI_RESTART_BLOCK 0x000001C
 
 #endif
 
@@ -68,9 +66,6 @@ struct thread_info {
        .cpu            = 0,                    \
        .preempt_count  = INIT_PREEMPT_COUNT,   \
        .addr_limit     = KERNEL_DS,            \
-       .restart_block = {                      \
-               .fn = do_no_restart_syscall,    \
-       },                                      \
 }
 
 #define init_thread_info       (init_thread_union.thread_info)
index 95408b8f130af6264ecf5d949de470a5557ef585..7736c6660a1580562bbbed37ece6aae5a61ac99a 100644 (file)
@@ -48,7 +48,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc,
        unsigned int err = 0;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
 #define COPY(x)                err |= __get_user(regs->x, &sc->sc_##x)
        COPY(r4);
index 21a4784ca5a186256cfbb5bc6d1d1b7cd4de3e1c..c54256e69e642a7395899a085763250ca9f37bfb 100644 (file)
@@ -31,7 +31,6 @@ struct thread_info {
        int                     preempt_count;  /* 0 => preemptable, <0 => BUG */
        __u32                   cpu;            /* should always be 0 on m68k */
        unsigned long           tp_value;       /* thread pointer */
-       struct restart_block    restart_block;
 };
 #endif /* __ASSEMBLY__ */
 
@@ -41,9 +40,6 @@ struct thread_info {
        .exec_domain    = &default_exec_domain, \
        .addr_limit     = KERNEL_DS,            \
        .preempt_count  = INIT_PREEMPT_COUNT,   \
-       .restart_block = {                      \
-               .fn = do_no_restart_syscall,    \
-       },                                      \
 }
 
 #define init_stack             (init_thread_union.stack)
index 967a8b7e152727d24339529e660d85d7eb8348dc..d7179281e74aff6a8bf2ef21fe4f699e63a4d224 100644 (file)
@@ -655,7 +655,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *usc, void __u
        int err = 0;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        /* get previous context */
        if (copy_from_user(&context, usc, sizeof(context)))
@@ -693,7 +693,7 @@ rt_restore_ucontext(struct pt_regs *regs, struct switch_stack *sw,
        int err;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        err = __get_user(temp, &uc->uc_mcontext.version);
        if (temp != MCONTEXT_VERSION)
index 47711336119e0f7132754957896ef4b19dc03e01..afb3ca4776d1df43271cbbe1514ad5e8478186bf 100644 (file)
@@ -35,9 +35,8 @@ struct thread_info {
        int preempt_count;      /* 0 => preemptable, <0 => BUG */
 
        mm_segment_t addr_limit;        /* thread address space */
-       struct restart_block restart_block;
 
-       u8 supervisor_stack[0];
+       u8 supervisor_stack[0] __aligned(8);
 };
 
 #else /* !__ASSEMBLY__ */
@@ -74,9 +73,6 @@ struct thread_info {
        .cpu            = 0,                    \
        .preempt_count  = INIT_PREEMPT_COUNT,   \
        .addr_limit     = KERNEL_DS,            \
-       .restart_block = {                      \
-               .fn = do_no_restart_syscall,    \
-       },                                      \
 }
 
 #define init_thread_info       (init_thread_union.thread_info)
index 0d100d5c140713de744deea8780094412e8335da..ce49d429c74aa63da08a75f1c20e1662fa7e8c00 100644 (file)
@@ -48,7 +48,7 @@ static int restore_sigcontext(struct pt_regs *regs,
        int err;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        err = metag_gp_regs_copyin(regs, 0, sizeof(struct user_gp_regs), NULL,
                                   &sc->regs);
index 8c9d36591a031d6a84e81ae7485185aea125a5e3..b699fbd7de4acac800ca7c26da59ec9d18938b4f 100644 (file)
@@ -71,7 +71,6 @@ struct thread_info {
        __u32                   cpu; /* current CPU */
        __s32                   preempt_count; /* 0 => preemptable,< 0 => BUG*/
        mm_segment_t            addr_limit; /* thread address space */
-       struct restart_block    restart_block;
 
        struct cpu_context      cpu_context;
 };
@@ -87,9 +86,6 @@ struct thread_info {
        .cpu            = 0,                    \
        .preempt_count  = INIT_PREEMPT_COUNT,   \
        .addr_limit     = KERNEL_DS,            \
-       .restart_block = {                      \
-               .fn = do_no_restart_syscall,    \
-       },                                      \
 }
 
 #define init_thread_info       (init_thread_union.thread_info)
index 235706055b7fc6fb75c40354051bc4d6f7305588..a1cbaf90e2ea47215e8bfce77d7d8d113f9fd110 100644 (file)
@@ -89,7 +89,7 @@ asmlinkage long sys_rt_sigreturn(struct pt_regs *regs)
        int rval;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
                goto badframe;
index e4440f92b366f7a1d90e4af10dd2477acdf0223a..9e1295f874f0c143f3924aac7e606b93125ed9ce 100644 (file)
@@ -34,7 +34,6 @@ struct thread_info {
                                                 * 0x7fffffff for user-thead
                                                 * 0xffffffff for kernel-thread
                                                 */
-       struct restart_block    restart_block;
        struct pt_regs          *regs;
        long                    syscall;        /* syscall number */
 };
@@ -50,9 +49,6 @@ struct thread_info {
        .cpu            = 0,                    \
        .preempt_count  = INIT_PREEMPT_COUNT,   \
        .addr_limit     = KERNEL_DS,            \
-       .restart_block  = {                     \
-               .fn = do_no_restart_syscall,    \
-       },                                      \
 }
 
 #define init_thread_info       (init_thread_union.thread_info)
index b1d84bd4efb3b4c500af92c01438aba5a89048dc..3b2dfdb4865fd9cbe208e41ca38e709db952c0e1 100644 (file)
@@ -98,7 +98,6 @@ void output_thread_info_defines(void)
        OFFSET(TI_CPU, thread_info, cpu);
        OFFSET(TI_PRE_COUNT, thread_info, preempt_count);
        OFFSET(TI_ADDR_LIMIT, thread_info, addr_limit);
-       OFFSET(TI_RESTART_BLOCK, thread_info, restart_block);
        OFFSET(TI_REGS, thread_info, regs);
        DEFINE(_THREAD_SIZE, THREAD_SIZE);
        DEFINE(_THREAD_MASK, THREAD_MASK);
index 545bf11bd2edb42fc05b37e2db9bb993be3abc4e..6a28c792d862c03b09a8f9cfdcd40d2879c401b0 100644 (file)
@@ -243,7 +243,7 @@ int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
        int i;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        err |= __get_user(regs->cp0_epc, &sc->sc_pc);
 
index d69179c0d49d4f9b6d56d129acc01f6c4c206fd4..19a7705f2a015ef4b38e1cd0a16eb22c2a2d3ca3 100644 (file)
@@ -220,7 +220,7 @@ static int restore_sigcontext32(struct pt_regs *regs,
        int i;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        err |= __get_user(regs->cp0_epc, &sc->sc_pc);
        err |= __get_user(regs->hi, &sc->sc_mdhi);
index bf280eaccd36fd7e7b963176184450fb98126340..c1c374f0ec12ef17b458f0a36ff71d4ca88fcc8c 100644 (file)
@@ -50,7 +50,6 @@ struct thread_info {
                                                   0-0xBFFFFFFF for user-thead
                                                   0-0xFFFFFFFF for kernel-thread
                                                */
-       struct restart_block    restart_block;
 
        __u8                    supervisor_stack[0];
 };
@@ -80,9 +79,6 @@ struct thread_info {
        .cpu            = 0,                    \
        .preempt_count  = INIT_PREEMPT_COUNT,   \
        .addr_limit     = KERNEL_DS,            \
-       .restart_block = {                      \
-               .fn = do_no_restart_syscall,    \
-       },                                      \
 }
 
 #define init_thread_info       (init_thread_union.thread_info)
index 47b3bb0c04ffc4f9db8395a6042235a5c7fab105..d780670cbaf36595a30cd33925b8176e3f1f83b7 100644 (file)
@@ -28,7 +28,6 @@ void foo(void)
        OFFSET(TI_cpu,                  thread_info, cpu);
        OFFSET(TI_preempt_count,        thread_info, preempt_count);
        OFFSET(TI_addr_limit,           thread_info, addr_limit);
-       OFFSET(TI_restart_block,        thread_info, restart_block);
        BLANK();
 
        OFFSET(REG_D0,                  pt_regs, d0);
index a6c0858592c3be2d8732d0551d6331d70642c9b3..8609845f12c58185158c4bdfdc0695cb8155ecec 100644 (file)
@@ -40,7 +40,7 @@ static int restore_sigcontext(struct pt_regs *regs,
        unsigned int err = 0;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        if (is_using_fpu(current))
                fpu_kill_state(current);
index d797acc901e4c2a6a81dd4998a8721c7a085b3bf..875f0845a70760b215a06d8afded0f56b564f7e0 100644 (file)
@@ -57,7 +57,6 @@ struct thread_info {
                                               0-0x7FFFFFFF for user-thead
                                               0-0xFFFFFFFF for kernel-thread
                                             */
-       struct restart_block    restart_block;
        __u8                    supervisor_stack[0];
 
        /* saved context data */
@@ -79,9 +78,6 @@ struct thread_info {
        .cpu            = 0,                            \
        .preempt_count  = 1,                            \
        .addr_limit     = KERNEL_DS,                    \
-       .restart_block  = {                             \
-                         .fn = do_no_restart_syscall,  \
-       },                                              \
        .ksp            = 0,                            \
 }
 
index 7d1b8235bf90a9b2172654325e2bee576d3a4163..4112175bf803b46b8fbd089f92d789b2011bc0ce 100644 (file)
@@ -46,7 +46,7 @@ static int restore_sigcontext(struct pt_regs *regs,
        int err = 0;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        /*
         * Restore the regs from &sc->regs.
index a84611835549c2f9a1b93e999f593a058fcc8add..fb13e3865563cd9333b76806f52e019437b31c8b 100644 (file)
@@ -14,7 +14,6 @@ struct thread_info {
        mm_segment_t addr_limit;        /* user-level address space limit */
        __u32 cpu;                      /* current CPU */
        int preempt_count;              /* 0=premptable, <0=BUG; will also serve as bh-counter */
-       struct restart_block restart_block;
 };
 
 #define INIT_THREAD_INFO(tsk)                  \
@@ -25,9 +24,6 @@ struct thread_info {
        .cpu            = 0,                    \
        .addr_limit     = KERNEL_DS,            \
        .preempt_count  = INIT_PREEMPT_COUNT,   \
-       .restart_block  = {                     \
-               .fn = do_no_restart_syscall     \
-       }                                       \
 }
 
 #define init_thread_info        (init_thread_union.thread_info)
index 012d4fa63d9763550930a4abbd4b890f9b1e2216..9b910a0251b8a0781ac0ec188a2fa2782badcb30 100644 (file)
@@ -99,7 +99,7 @@ sys_rt_sigreturn(struct pt_regs *regs, int in_syscall)
                sigframe_size = PARISC_RT_SIGFRAME_SIZE32;
 #endif
 
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        /* Unwind the user stack to get the rt_sigframe structure. */
        frame = (struct rt_sigframe __user *)
index e8abc83e699fbe32179a2bac70a91c2af9ff4ec5..72489799cf022f97885f1a973ac2fce7fdf32c6d 100644 (file)
@@ -43,7 +43,6 @@ struct thread_info {
        int             cpu;                    /* cpu we're on */
        int             preempt_count;          /* 0 => preemptable,
                                                   <0 => BUG */
-       struct restart_block restart_block;
        unsigned long   local_flags;            /* private flags for thread */
 
        /* low level flags - has atomic operations done on it */
@@ -59,9 +58,6 @@ struct thread_info {
        .exec_domain =  &default_exec_domain,   \
        .cpu =          0,                      \
        .preempt_count = INIT_PREEMPT_COUNT,    \
-       .restart_block = {                      \
-               .fn = do_no_restart_syscall,    \
-       },                                      \
        .flags =        0,                      \
 }
 
index b171001698ff32f256e4298c9f7fdfda2ddeef39..d3a831ac0f927e17304d55c406c60029ad55a4e0 100644 (file)
@@ -1231,7 +1231,7 @@ long sys_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
        int tm_restore = 0;
 #endif
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        rt_sf = (struct rt_sigframe __user *)
                (regs->gpr[1] + __SIGNAL_FRAMESIZE + 16);
@@ -1504,7 +1504,7 @@ long sys_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
 #endif
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        sf = (struct sigframe __user *)(regs->gpr[1] + __SIGNAL_FRAMESIZE);
        sc = &sf->sctx;
index 2cb0c94cafa5ef9e883b33136db22dcad1a7728b..c7c24d2e2bdbc6608c2b771f01ac5a0b9bafb3d5 100644 (file)
@@ -666,7 +666,7 @@ int sys_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
 #endif
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        if (!access_ok(VERIFY_READ, uc, sizeof(*uc)))
                goto badframe;
index 4d62fd5b56e5d13a264a1f3b691f90d282c355ac..ef1df718642d209441b07921621dbd9ad94396eb 100644 (file)
@@ -39,7 +39,6 @@ struct thread_info {
        unsigned long           sys_call_table; /* System call table address */
        unsigned int            cpu;            /* current CPU */
        int                     preempt_count;  /* 0 => preemptable, <0 => BUG */
-       struct restart_block    restart_block;
        unsigned int            system_call;
        __u64                   user_timer;
        __u64                   system_timer;
@@ -56,9 +55,6 @@ struct thread_info {
        .flags          = 0,                    \
        .cpu            = 0,                    \
        .preempt_count  = INIT_PREEMPT_COUNT,   \
-       .restart_block  = {                     \
-               .fn = do_no_restart_syscall,    \
-       },                                      \
 }
 
 #define init_thread_info       (init_thread_union.thread_info)
index 34d5fa7b01b50e6b31a805503305a85993b90cb8..bc1df12dd4f8160df92580d5e04a6a5f76e08608 100644 (file)
@@ -209,7 +209,7 @@ static int restore_sigregs32(struct pt_regs *regs,_sigregs32 __user *sregs)
        int i;
 
        /* Alwys make any pending restarted system call return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        if (__copy_from_user(&user_sregs, &sregs->regs, sizeof(user_sregs)))
                return -EFAULT;
index 6a2ac257d98f280669c29e0b8701144f635c9d3c..b3ae6f70c6d64bf66c4382da3381177f8226b90e 100644 (file)
@@ -162,7 +162,7 @@ static int restore_sigregs(struct pt_regs *regs, _sigregs __user *sregs)
        _sigregs user_sregs;
 
        /* Alwys make any pending restarted system call return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        if (__copy_from_user(&user_sregs, sregs, sizeof(user_sregs)))
                return -EFAULT;
index 656b7ada9326ab63ba45b42f3404cc39979e16f5..33864fa2a8d4cd7cc4135e9fa87b3eab591609aa 100644 (file)
@@ -42,7 +42,6 @@ struct thread_info {
         * 0-0xFFFFFFFF for kernel-thread
         */
        mm_segment_t            addr_limit;
-       struct restart_block    restart_block;
        struct pt_regs          *regs;
 };
 
@@ -58,9 +57,6 @@ struct thread_info {
        .cpu            = 0,                    \
        .preempt_count  = 1,                    \
        .addr_limit     = KERNEL_DS,            \
-       .restart_block  = {                     \
-               .fn = do_no_restart_syscall,    \
-       },                                      \
 }
 
 #define init_thread_info       (init_thread_union.thread_info)
index 57788f44c6fb09824a1c6f6412e15f93142ed358..b4d5214a7a7e261d21c3353c7901d2c0b3d129ba 100644 (file)
@@ -106,7 +106,6 @@ void output_thread_info_defines(void)
        OFFSET(TI_CPU, thread_info, cpu);
        OFFSET(TI_PRE_COUNT, thread_info, preempt_count);
        OFFSET(TI_ADDR_LIMIT, thread_info, addr_limit);
-       OFFSET(TI_RESTART_BLOCK, thread_info, restart_block);
        OFFSET(TI_REGS, thread_info, regs);
        DEFINE(KERNEL_STACK_SIZE, THREAD_SIZE);
        DEFINE(KERNEL_STACK_MASK, THREAD_MASK);
index 1651807774ad10d677a8b43467b8d91940eba127..e381c8c4ff65b613b32b0e7b81a2bc733d7bbf43 100644 (file)
@@ -141,7 +141,7 @@ score_rt_sigreturn(struct pt_regs *regs)
        int sig;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        frame = (struct rt_sigframe __user *) regs->regs[0];
        if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
index ad27ffa65e2eafd2fb89c959c812862b70ba8665..657c039196276118a150a33a93f34daf61f29544 100644 (file)
@@ -33,7 +33,6 @@ struct thread_info {
        __u32                   cpu;
        int                     preempt_count; /* 0 => preemptable, <0 => BUG */
        mm_segment_t            addr_limit;     /* thread address space */
-       struct restart_block    restart_block;
        unsigned long           previous_sp;    /* sp of previous stack in case
                                                   of nested IRQ stacks */
        __u8                    supervisor_stack[0];
@@ -63,9 +62,6 @@ struct thread_info {
        .cpu            = 0,                    \
        .preempt_count  = INIT_PREEMPT_COUNT,   \
        .addr_limit     = KERNEL_DS,            \
-       .restart_block  = {                     \
-               .fn = do_no_restart_syscall,    \
-       },                                      \
 }
 
 #define init_thread_info       (init_thread_union.thread_info)
index 08a2be775b6c79256410b25603edce0ab073e79a..542225fedb112088b881a12bb76b4c637ce9f92d 100644 (file)
@@ -25,7 +25,6 @@ int main(void)
        DEFINE(TI_FLAGS,        offsetof(struct thread_info, flags));
        DEFINE(TI_CPU,          offsetof(struct thread_info, cpu));
        DEFINE(TI_PRE_COUNT,    offsetof(struct thread_info, preempt_count));
-       DEFINE(TI_RESTART_BLOCK,offsetof(struct thread_info, restart_block));
        DEFINE(TI_SIZE,         sizeof(struct thread_info));
 
 #ifdef CONFIG_HIBERNATION
index 2f002b24fb92f4b9db193f953c311b9ebdc4b8ef..0b34f2a704fe1d2fdcf03b49fe37d73a7725ecf7 100644 (file)
@@ -156,7 +156,7 @@ asmlinkage int sys_sigreturn(void)
        int r0;
 
         /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
                goto badframe;
@@ -186,7 +186,7 @@ asmlinkage int sys_rt_sigreturn(void)
        int r0;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
                goto badframe;
index 897abe7b871e2daeb9db132930fd0c6c7cb1349e..71993c6a7d94b0f6da895f78d96176de5aa31e14 100644 (file)
@@ -260,7 +260,7 @@ asmlinkage int sys_sigreturn(unsigned long r2, unsigned long r3,
        long long ret;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
                goto badframe;
@@ -294,7 +294,7 @@ asmlinkage int sys_rt_sigreturn(unsigned long r2, unsigned long r3,
        long long ret;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        if (!access_ok(VERIFY_READ, frame, sizeof(*frame)))
                goto badframe;
index 025c98446b1ee1bce743d41ecdf4494eb62e7d50..fd7bd0a440ca717844918de9558be3a213eec571 100644 (file)
@@ -47,8 +47,6 @@ struct thread_info {
        struct reg_window32     reg_window[NSWINS];     /* align for ldd! */
        unsigned long           rwbuf_stkptrs[NSWINS];
        unsigned long           w_saved;
-
-       struct restart_block    restart_block;
 };
 
 /*
@@ -62,9 +60,6 @@ struct thread_info {
        .flags          =       0,                      \
        .cpu            =       0,                      \
        .preempt_count  =       INIT_PREEMPT_COUNT,     \
-       .restart_block  = {                             \
-               .fn     =       do_no_restart_syscall,  \
-       },                                              \
 }
 
 #define init_thread_info       (init_thread_union.thread_info)
@@ -103,7 +98,6 @@ register struct thread_info *current_thread_info_reg asm("g6");
 #define TI_REG_WINDOW  0x30
 #define TI_RWIN_SPTRS  0x230
 #define TI_W_SAVED     0x250
-/* #define TI_RESTART_BLOCK 0x25n */ /* Nobody cares */
 
 /*
  * thread information flag bit numbers
index 798f0279a4b56a3ccd23b29c7b527bbd329b3061..ff455164732a9b33b291df5a370d80c27e12828b 100644 (file)
@@ -58,8 +58,6 @@ struct thread_info {
        unsigned long           gsr[7];
        unsigned long           xfsr[7];
 
-       struct restart_block    restart_block;
-
        struct pt_regs          *kern_una_regs;
        unsigned int            kern_una_insn;
 
@@ -92,10 +90,9 @@ struct thread_info {
 #define TI_RWIN_SPTRS  0x000003c8
 #define TI_GSR         0x00000400
 #define TI_XFSR                0x00000438
-#define TI_RESTART_BLOCK 0x00000470
-#define TI_KUNA_REGS   0x000004a0
-#define TI_KUNA_INSN   0x000004a8
-#define TI_FPREGS      0x000004c0
+#define TI_KUNA_REGS   0x00000470
+#define TI_KUNA_INSN   0x00000478
+#define TI_FPREGS      0x00000480
 
 /* We embed this in the uppermost byte of thread_info->flags */
 #define FAULT_CODE_WRITE       0x01    /* Write access, implies D-TLB     */
@@ -124,9 +121,6 @@ struct thread_info {
        .current_ds     =       ASI_P,                  \
        .exec_domain    =       &default_exec_domain,   \
        .preempt_count  =       INIT_PREEMPT_COUNT,     \
-       .restart_block  = {                             \
-               .fn     =       do_no_restart_syscall,  \
-       },                                              \
 }
 
 #define init_thread_info       (init_thread_union.thread_info)
index 62deba7be1a9ed6dba7af17177c3279577a6be85..4eed773a77358b718b5e0134a56eff5b9be75772 100644 (file)
@@ -150,7 +150,7 @@ void do_sigreturn32(struct pt_regs *regs)
        int err, i;
        
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        synchronize_user_stack();
 
@@ -235,7 +235,7 @@ asmlinkage void do_rt_sigreturn32(struct pt_regs *regs)
        int err, i;
        
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        synchronize_user_stack();
        regs->u_regs[UREG_FP] &= 0x00000000ffffffffUL;
index 9ee72fc8e0e49636f1db8f97e645883d4e69b2ce..52aa5e4ce5e77c0716e083dd41372c16e5ac8967 100644 (file)
@@ -70,7 +70,7 @@ asmlinkage void do_sigreturn(struct pt_regs *regs)
        int err;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        synchronize_user_stack();
 
index 1a699986803158023c60cb9603bbf1dfbc0bab6f..d88beff47bab3eb74fece39e282f7c701ab84868 100644 (file)
@@ -254,7 +254,7 @@ void do_rt_sigreturn(struct pt_regs *regs)
        int err;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        synchronize_user_stack ();
        sf = (struct rt_signal_frame __user *)
index 981a769b955802573c00d184ed76581f68d88777..a27651e866e7a108dca92cf88c14ec8f21ae5b5b 100644 (file)
@@ -2730,8 +2730,6 @@ void __init trap_init(void)
                     TI_NEW_CHILD != offsetof(struct thread_info, new_child) ||
                     TI_CURRENT_DS != offsetof(struct thread_info,
                                                current_ds) ||
-                    TI_RESTART_BLOCK != offsetof(struct thread_info,
-                                                 restart_block) ||
                     TI_KUNA_REGS != offsetof(struct thread_info,
                                              kern_una_regs) ||
                     TI_KUNA_INSN != offsetof(struct thread_info,
index 48e4fd0f38e49e70c3a7fee5065af0f5931a1bec..96c14c1430d8e75f66fb333233c318b15a781056 100644 (file)
@@ -36,7 +36,6 @@ struct thread_info {
 
        mm_segment_t            addr_limit;     /* thread address space
                                                   (KERNEL_DS or USER_DS) */
-       struct restart_block    restart_block;
        struct single_step_state *step_state;   /* single step state
                                                   (if non-zero) */
        int                     align_ctl;      /* controls unaligned access */
@@ -57,9 +56,6 @@ struct thread_info {
        .cpu            = 0,                    \
        .preempt_count  = INIT_PREEMPT_COUNT,   \
        .addr_limit     = KERNEL_DS,            \
-       .restart_block  = {                     \
-               .fn = do_no_restart_syscall,    \
-       },                                      \
        .step_state     = NULL,                 \
        .align_ctl      = 0,                    \
 }
index bb0a9ce7ae23f6f99de8515da270ddb5f8c25ced..8a524e332c1a280b848eeb67dd3f6e34263ce32b 100644 (file)
@@ -48,7 +48,7 @@ int restore_sigcontext(struct pt_regs *regs,
        int err;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        /*
         * Enforce that sigcontext is like pt_regs, and doesn't mess
index 1c5b2a83046aab011e03c1e735b020a374608838..e04114c4fcd9e5a4bc61def6cfbd9480c69046bd 100644 (file)
@@ -22,7 +22,6 @@ struct thread_info {
        mm_segment_t            addr_limit;     /* thread address space:
                                                   0-0xBFFFFFFF for user
                                                   0-0xFFFFFFFF for kernel */
-       struct restart_block    restart_block;
        struct thread_info      *real_thread;    /* Points to non-IRQ stack */
 };
 
@@ -34,9 +33,6 @@ struct thread_info {
        .cpu =          0,                      \
        .preempt_count = INIT_PREEMPT_COUNT,    \
        .addr_limit =   KERNEL_DS,              \
-       .restart_block =  {                     \
-               .fn =  do_no_restart_syscall,   \
-       },                                      \
        .real_thread = NULL,                    \
 }
 
index af36d8eabdf1c1dd6650e10682eff053550c906a..63e2839dfeb8f829135067afd2cdf81a13292e58 100644 (file)
@@ -79,7 +79,6 @@ struct thread_info {
 #ifdef CONFIG_UNICORE_FPU_F64
        struct fp_state         fpstate __attribute__((aligned(8)));
 #endif
-       struct restart_block    restart_block;
 };
 
 #define INIT_THREAD_INFO(tsk)                                          \
@@ -89,9 +88,6 @@ struct thread_info {
        .flags          = 0,                                            \
        .preempt_count  = INIT_PREEMPT_COUNT,                           \
        .addr_limit     = KERNEL_DS,                                    \
-       .restart_block  = {                                             \
-               .fn     = do_no_restart_syscall,                        \
-       },                                                              \
 }
 
 #define init_thread_info       (init_thread_union.thread_info)
index 7c8fb7018dc6bf728a5a70ef9bde100d94f3b565..d329f85766cc5cd0b794e37a7e3ff1fd90157f9f 100644 (file)
@@ -105,7 +105,7 @@ asmlinkage int __sys_rt_sigreturn(struct pt_regs *regs)
        struct rt_sigframe __user *frame;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        /*
         * Since we stacked the signal on a 64-bit boundary,
index f9e181aaba979190be8d3d18ebf437c2e3a22e69..d0165c9a293241559c48742d6c0fb8df3e4fcf82 100644 (file)
@@ -169,7 +169,7 @@ static int ia32_restore_sigcontext(struct pt_regs *regs,
        u32 tmp;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        get_user_try {
                /*
index e82e95abc92bd514e9991af3cd97a7028c289271..1d4e4f279a3281e094684ad29bd4b544d37af6ab 100644 (file)
@@ -31,7 +31,6 @@ struct thread_info {
        __u32                   cpu;            /* current CPU */
        int                     saved_preempt_count;
        mm_segment_t            addr_limit;
-       struct restart_block    restart_block;
        void __user             *sysenter_return;
        unsigned int            sig_on_uaccess_error:1;
        unsigned int            uaccess_err:1;  /* uaccess failed */
@@ -45,9 +44,6 @@ struct thread_info {
        .cpu            = 0,                    \
        .saved_preempt_count = INIT_PREEMPT_COUNT,      \
        .addr_limit     = KERNEL_DS,            \
-       .restart_block = {                      \
-               .fn = do_no_restart_syscall,    \
-       },                                      \
 }
 
 #define init_thread_info       (init_thread_union.thread_info)
index 2a33c8f68319436a1e92f8bf654f6fcaa852764b..e5042463c1bca59107e107117984c37753d732c3 100644 (file)
@@ -69,7 +69,7 @@ int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc,
        unsigned int err = 0;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        get_user_try {
 
index 79d824551c1a564dd6b22a31a2319ec980d92ea5..0c8c32bfd7928ee252c562e0a8767ec37e02844e 100644 (file)
@@ -157,7 +157,7 @@ static int copy_sc_from_user(struct pt_regs *regs,
        int err, pid;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        err = copy_from_user(&sc, from, sizeof(sc));
        if (err)
index 470153e8547c19a6819ac4cfbea3aa095b3dd33e..a9b5d3ba196cd70dbf0b72782db03ad7de8475b5 100644 (file)
@@ -51,7 +51,6 @@ struct thread_info {
        __s32                   preempt_count;  /* 0 => preemptable,< 0 => BUG*/
 
        mm_segment_t            addr_limit;     /* thread address space */
-       struct restart_block    restart_block;
 
        unsigned long           cpenable;
 
@@ -72,7 +71,6 @@ struct thread_info {
 #define TI_CPU          0x00000010
 #define TI_PRE_COUNT    0x00000014
 #define TI_ADDR_LIMIT   0x00000018
-#define TI_RESTART_BLOCK 0x000001C
 
 #endif
 
@@ -90,9 +88,6 @@ struct thread_info {
        .cpu            = 0,                    \
        .preempt_count  = INIT_PREEMPT_COUNT,   \
        .addr_limit     = KERNEL_DS,            \
-       .restart_block = {                      \
-               .fn = do_no_restart_syscall,    \
-       },                                      \
 }
 
 #define init_thread_info       (init_thread_union.thread_info)
index 4612321c73cc1d78952e5b89ad74b73973249e39..3d733ba16f28a2db8f6f4c91c61170a44ca7fd83 100644 (file)
@@ -245,7 +245,7 @@ asmlinkage long xtensa_rt_sigreturn(long a0, long a1, long a2, long a3,
        int ret;
 
        /* Always make any pending restarted system calls return -EINTR */
-       current_thread_info()->restart_block.fn = do_no_restart_syscall;
+       current->restart_block.fn = do_no_restart_syscall;
 
        if (regs->depc > 64)
                panic("rt_sigreturn in double exception!\n");
index 467bb1cb3ea5e0da46d7d4b305b1d7fb2c143208..f684c750e08a549283733c1340420a61733b4b61 100644 (file)
@@ -971,7 +971,7 @@ SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds,
        if (ret == -EINTR) {
                struct restart_block *restart_block;
 
-               restart_block = &current_thread_info()->restart_block;
+               restart_block = &current->restart_block;
                restart_block->fn = do_restart_poll;
                restart_block->poll.ufds = ufds;
                restart_block->poll.nfds = nfds;
index 3037fc085e8e16817f37a57621fde22659f64012..d3d43ecf148cd96a22366e8569231c4df0ddbeb8 100644 (file)
@@ -193,6 +193,9 @@ extern struct task_group root_task_group;
        .nr_cpus_allowed= NR_CPUS,                                      \
        .mm             = NULL,                                         \
        .active_mm      = &init_mm,                                     \
+       .restart_block = {                                              \
+               .fn = do_no_restart_syscall,                            \
+       },                                                              \
        .se             = {                                             \
                .group_node     = LIST_HEAD_INIT(tsk.se.group_node),    \
        },                                                              \
index 8db31ef98d2f4b5ad9f68f8296fbdbb475f96c46..22ee0d5d7f8c5e310682b22556a5aacda6984603 100644 (file)
@@ -1370,6 +1370,8 @@ struct task_struct {
 
        unsigned long atomic_flags; /* Flags needing atomic access. */
 
+       struct restart_block restart_block;
+
        pid_t pid;
        pid_t tgid;
 
index ebb3c369d03d594067bda50bdffedd32159026e3..24f00610c575fd5d34c40dcf9fad35b358596c22 100644 (file)
@@ -276,8 +276,7 @@ COMPAT_SYSCALL_DEFINE2(nanosleep, struct compat_timespec __user *, rqtp,
         * core implementation decides to return random nonsense.
         */
        if (ret == -ERESTART_RESTARTBLOCK) {
-               struct restart_block *restart
-                       = &current_thread_info()->restart_block;
+               struct restart_block *restart = &current->restart_block;
 
                restart->fn = compat_nanosleep_restart;
                restart->nanosleep.compat_rmtp = rmtp;
@@ -860,7 +859,7 @@ COMPAT_SYSCALL_DEFINE4(clock_nanosleep, clockid_t, which_clock, int, flags,
                return -EFAULT;
 
        if (err == -ERESTART_RESTARTBLOCK) {
-               restart = &current_thread_info()->restart_block;
+               restart = &current->restart_block;
                restart->fn = compat_clock_nanosleep_restart;
                restart->nanosleep.compat_rmtp = rmtp;
        }
index 4eeb63de7e54e895506e468acbcd4b3bed4271c6..2a5e3830e953b72cca4aeac4ec537e276f0f355b 100644 (file)
@@ -2217,7 +2217,7 @@ retry:
        if (!abs_time)
                goto out;
 
-       restart = &current_thread_info()->restart_block;
+       restart = &current->restart_block;
        restart->fn = futex_wait_restart;
        restart->futex.uaddr = uaddr;
        restart->futex.val = val;
index 16a305295256dd2b4b50eb0e0e5e07c34a803e0e..33a52759cc0edfc62a2638a6608becee10d28694 100644 (file)
@@ -2501,7 +2501,7 @@ EXPORT_SYMBOL(unblock_all_signals);
  */
 SYSCALL_DEFINE0(restart_syscall)
 {
-       struct restart_block *restart = &current_thread_info()->restart_block;
+       struct restart_block *restart = &current->restart_block;
        return restart->fn(restart);
 }
 
index a7077d3ae52fe2e9bcd43bf076d748eb5bf6ef2a..1b001ed1edb945cd5a95238fc563f93e8971041e 100644 (file)
@@ -788,7 +788,7 @@ static int alarm_timer_nsleep(const clockid_t which_clock, int flags,
                        goto out;
        }
 
-       restart = &current_thread_info()->restart_block;
+       restart = &current->restart_block;
        restart->fn = alarm_timer_nsleep_restart;
        restart->nanosleep.clockid = type;
        restart->nanosleep.expires = exp.tv64;
index 3f5e183c3d9727934eee93ba74038cab5cf19cd5..bee0c1f780911a97a4598b81089c9bc4d807d037 100644 (file)
@@ -1583,7 +1583,7 @@ long hrtimer_nanosleep(struct timespec *rqtp, struct timespec __user *rmtp,
                        goto out;
        }
 
-       restart = &current_thread_info()->restart_block;
+       restart = &current->restart_block;
        restart->fn = hrtimer_nanosleep_restart;
        restart->nanosleep.clockid = t.timer.base->clockid;
        restart->nanosleep.rmtp = rmtp;
index a16b67859e2a79929331c5008f96fd7f29ebbfc1..0075da74abf0c5f55c823f393e96b99d79b05e13 100644 (file)
@@ -1334,8 +1334,7 @@ static long posix_cpu_nsleep_restart(struct restart_block *restart_block);
 static int posix_cpu_nsleep(const clockid_t which_clock, int flags,
                            struct timespec *rqtp, struct timespec __user *rmtp)
 {
-       struct restart_block *restart_block =
-               &current_thread_info()->restart_block;
+       struct restart_block *restart_block = &current->restart_block;
        struct itimerspec it;
        int error;