Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/x86_64/ia32/ia32_signal.c |
| 3 | * |
| 4 | * Copyright (C) 1991, 1992 Linus Torvalds |
| 5 | * |
| 6 | * 1997-11-28 Modified for POSIX.1b signals by Richard Henderson |
| 7 | * 2000-06-20 Pentium III FXSR, SSE support by Gareth Hughes |
| 8 | * 2000-12-* x86-64 compatibility mode signal handling by Andi Kleen |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | #include <linux/sched.h> |
| 12 | #include <linux/mm.h> |
| 13 | #include <linux/smp.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | #include <linux/kernel.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | #include <linux/errno.h> |
| 16 | #include <linux/wait.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | #include <linux/unistd.h> |
| 18 | #include <linux/stddef.h> |
| 19 | #include <linux/personality.h> |
| 20 | #include <linux/compat.h> |
Andi Kleen | 9fbbd4d | 2007-02-13 13:26:26 +0100 | [diff] [blame] | 21 | #include <linux/binfmts.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | #include <asm/ucontext.h> |
| 23 | #include <asm/uaccess.h> |
| 24 | #include <asm/i387.h> |
Linus Torvalds | 1361b83 | 2012-02-21 13:19:22 -0800 | [diff] [blame] | 25 | #include <asm/fpu-internal.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | #include <asm/ptrace.h> |
| 27 | #include <asm/ia32_unistd.h> |
| 28 | #include <asm/user32.h> |
| 29 | #include <asm/sigcontext32.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | #include <asm/proto.h> |
Roland McGrath | af65d64 | 2008-01-30 13:30:43 +0100 | [diff] [blame] | 31 | #include <asm/vdso.h> |
Hiroshi Shimamoto | d98f9d8 | 2008-12-17 18:52:45 -0800 | [diff] [blame] | 32 | #include <asm/sigframe.h> |
H. Peter Anvin | f28f0c2 | 2012-02-19 07:38:43 -0800 | [diff] [blame] | 33 | #include <asm/sighandling.h> |
Jaswinder Singh Rajput | 2f06de0 | 2008-12-27 21:37:10 +0530 | [diff] [blame] | 34 | #include <asm/sys_ia32.h> |
H. Peter Anvin | 49b8c695 | 2012-09-21 17:18:44 -0700 | [diff] [blame] | 35 | #include <asm/smap.h> |
Hiroshi Shimamoto | d98f9d8 | 2008-12-17 18:52:45 -0800 | [diff] [blame] | 36 | |
Al Viro | ce39596 | 2013-10-13 17:23:53 -0400 | [diff] [blame] | 37 | int copy_siginfo_to_user32(compat_siginfo_t __user *to, const siginfo_t *from) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | { |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 39 | int err = 0; |
Suresh Siddha | 0b91f45 | 2012-06-14 18:07:15 -0700 | [diff] [blame] | 40 | bool ia32 = test_thread_flag(TIF_IA32); |
Thomas Gleixner | 99b9cdf | 2008-01-30 13:30:07 +0100 | [diff] [blame] | 41 | |
| 42 | if (!access_ok(VERIFY_WRITE, to, sizeof(compat_siginfo_t))) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | return -EFAULT; |
| 44 | |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 45 | put_user_try { |
| 46 | /* If you change siginfo_t structure, please make sure that |
| 47 | this code is fixed accordingly. |
| 48 | It should never copy any pad contained in the structure |
| 49 | to avoid security leaks, but must copy the generic |
| 50 | 3 ints plus the relevant union member. */ |
| 51 | put_user_ex(from->si_signo, &to->si_signo); |
| 52 | put_user_ex(from->si_errno, &to->si_errno); |
| 53 | put_user_ex((short)from->si_code, &to->si_code); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 55 | if (from->si_code < 0) { |
| 56 | put_user_ex(from->si_pid, &to->si_pid); |
| 57 | put_user_ex(from->si_uid, &to->si_uid); |
| 58 | put_user_ex(ptr_to_compat(from->si_ptr), &to->si_ptr); |
| 59 | } else { |
| 60 | /* |
| 61 | * First 32bits of unions are always present: |
| 62 | * si_pid === si_band === si_tid === si_addr(LS half) |
| 63 | */ |
| 64 | put_user_ex(from->_sifields._pad[0], |
| 65 | &to->_sifields._pad[0]); |
| 66 | switch (from->si_code >> 16) { |
| 67 | case __SI_FAULT >> 16: |
| 68 | break; |
Will Drewry | a0727e8 | 2012-04-12 16:48:00 -0500 | [diff] [blame] | 69 | case __SI_SYS >> 16: |
| 70 | put_user_ex(from->si_syscall, &to->si_syscall); |
| 71 | put_user_ex(from->si_arch, &to->si_arch); |
| 72 | break; |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 73 | case __SI_CHLD >> 16: |
H. Peter Anvin | e7084fd | 2012-03-05 13:40:24 -0800 | [diff] [blame] | 74 | if (ia32) { |
| 75 | put_user_ex(from->si_utime, &to->si_utime); |
| 76 | put_user_ex(from->si_stime, &to->si_stime); |
| 77 | } else { |
| 78 | put_user_ex(from->si_utime, &to->_sifields._sigchld_x32._utime); |
| 79 | put_user_ex(from->si_stime, &to->_sifields._sigchld_x32._stime); |
| 80 | } |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 81 | put_user_ex(from->si_status, &to->si_status); |
| 82 | /* FALL THROUGH */ |
| 83 | default: |
| 84 | case __SI_KILL >> 16: |
| 85 | put_user_ex(from->si_uid, &to->si_uid); |
| 86 | break; |
| 87 | case __SI_POLL >> 16: |
| 88 | put_user_ex(from->si_fd, &to->si_fd); |
| 89 | break; |
| 90 | case __SI_TIMER >> 16: |
| 91 | put_user_ex(from->si_overrun, &to->si_overrun); |
| 92 | put_user_ex(ptr_to_compat(from->si_ptr), |
| 93 | &to->si_ptr); |
| 94 | break; |
| 95 | /* This is not generated by the kernel as of now. */ |
| 96 | case __SI_RT >> 16: |
| 97 | case __SI_MESGQ >> 16: |
| 98 | put_user_ex(from->si_uid, &to->si_uid); |
| 99 | put_user_ex(from->si_int, &to->si_int); |
| 100 | break; |
| 101 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 102 | } |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 103 | } put_user_catch(err); |
| 104 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 105 | return err; |
| 106 | } |
| 107 | |
| 108 | int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from) |
| 109 | { |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 110 | int err = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 111 | u32 ptr32; |
Thomas Gleixner | 99b9cdf | 2008-01-30 13:30:07 +0100 | [diff] [blame] | 112 | |
| 113 | if (!access_ok(VERIFY_READ, from, sizeof(compat_siginfo_t))) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 114 | return -EFAULT; |
| 115 | |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 116 | get_user_try { |
| 117 | get_user_ex(to->si_signo, &from->si_signo); |
| 118 | get_user_ex(to->si_errno, &from->si_errno); |
| 119 | get_user_ex(to->si_code, &from->si_code); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 120 | |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 121 | get_user_ex(to->si_pid, &from->si_pid); |
| 122 | get_user_ex(to->si_uid, &from->si_uid); |
| 123 | get_user_ex(ptr32, &from->si_ptr); |
| 124 | to->si_ptr = compat_ptr(ptr32); |
| 125 | } get_user_catch(err); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 126 | |
| 127 | return err; |
| 128 | } |
| 129 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 130 | /* |
| 131 | * Do a signal return; undo the signal stack. |
| 132 | */ |
Hiroshi Shimamoto | a967bb3 | 2009-02-20 19:00:54 -0800 | [diff] [blame] | 133 | #define loadsegment_gs(v) load_gs_index(v) |
| 134 | #define loadsegment_fs(v) loadsegment(fs, v) |
| 135 | #define loadsegment_ds(v) loadsegment(ds, v) |
| 136 | #define loadsegment_es(v) loadsegment(es, v) |
| 137 | |
| 138 | #define get_user_seg(seg) ({ unsigned int v; savesegment(seg, v); v; }) |
| 139 | #define set_user_seg(seg, v) loadsegment_##seg(v) |
| 140 | |
Hiroshi Shimamoto | b78a5b5 | 2008-11-17 15:44:50 -0800 | [diff] [blame] | 141 | #define COPY(x) { \ |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 142 | get_user_ex(regs->x, &sc->x); \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 143 | } |
| 144 | |
Hiroshi Shimamoto | 8801ead4 | 2009-02-20 19:00:13 -0800 | [diff] [blame] | 145 | #define GET_SEG(seg) ({ \ |
| 146 | unsigned short tmp; \ |
| 147 | get_user_ex(tmp, &sc->seg); \ |
| 148 | tmp; \ |
| 149 | }) |
| 150 | |
| 151 | #define COPY_SEG_CPL3(seg) do { \ |
| 152 | regs->seg = GET_SEG(seg) | 3; \ |
| 153 | } while (0) |
Hiroshi Shimamoto | d71a68d | 2008-11-17 15:47:06 -0800 | [diff] [blame] | 154 | |
Hiroshi Shimamoto | 8c6e5ce | 2008-11-17 15:47:48 -0800 | [diff] [blame] | 155 | #define RELOAD_SEG(seg) { \ |
Hiroshi Shimamoto | a967bb3 | 2009-02-20 19:00:54 -0800 | [diff] [blame] | 156 | unsigned int pre = GET_SEG(seg); \ |
| 157 | unsigned int cur = get_user_seg(seg); \ |
Hiroshi Shimamoto | 8c6e5ce | 2008-11-17 15:47:48 -0800 | [diff] [blame] | 158 | pre |= 3; \ |
| 159 | if (pre != cur) \ |
Hiroshi Shimamoto | a967bb3 | 2009-02-20 19:00:54 -0800 | [diff] [blame] | 160 | set_user_seg(seg, pre); \ |
Hiroshi Shimamoto | 8c6e5ce | 2008-11-17 15:47:48 -0800 | [diff] [blame] | 161 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 162 | |
Thomas Gleixner | 99b9cdf | 2008-01-30 13:30:07 +0100 | [diff] [blame] | 163 | static int ia32_restore_sigcontext(struct pt_regs *regs, |
Brian Gerst | 6a3713f | 2015-04-04 08:58:23 -0400 | [diff] [blame^] | 164 | struct sigcontext_ia32 __user *sc) |
Thomas Gleixner | 99b9cdf | 2008-01-30 13:30:07 +0100 | [diff] [blame] | 165 | { |
Hiroshi Shimamoto | a967bb3 | 2009-02-20 19:00:54 -0800 | [diff] [blame] | 166 | unsigned int tmpflags, err = 0; |
Suresh Siddha | ab51370 | 2008-07-29 10:29:22 -0700 | [diff] [blame] | 167 | void __user *buf; |
Thomas Gleixner | 99b9cdf | 2008-01-30 13:30:07 +0100 | [diff] [blame] | 168 | u32 tmp; |
| 169 | |
| 170 | /* Always make any pending restarted system calls return -EINTR */ |
Andy Lutomirski | f56141e | 2015-02-12 15:01:14 -0800 | [diff] [blame] | 171 | current->restart_block.fn = do_no_restart_syscall; |
Thomas Gleixner | 99b9cdf | 2008-01-30 13:30:07 +0100 | [diff] [blame] | 172 | |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 173 | get_user_try { |
| 174 | /* |
| 175 | * Reload fs and gs if they have changed in the signal |
| 176 | * handler. This does not handle long fs/gs base changes in |
| 177 | * the handler, but does not clobber them at least in the |
| 178 | * normal case. |
| 179 | */ |
Hiroshi Shimamoto | a967bb3 | 2009-02-20 19:00:54 -0800 | [diff] [blame] | 180 | RELOAD_SEG(gs); |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 181 | RELOAD_SEG(fs); |
| 182 | RELOAD_SEG(ds); |
| 183 | RELOAD_SEG(es); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 184 | |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 185 | COPY(di); COPY(si); COPY(bp); COPY(sp); COPY(bx); |
Brian Gerst | 6a3713f | 2015-04-04 08:58:23 -0400 | [diff] [blame^] | 186 | COPY(dx); COPY(cx); COPY(ip); COPY(ax); |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 187 | /* Don't touch extended registers */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 188 | |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 189 | COPY_SEG_CPL3(cs); |
| 190 | COPY_SEG_CPL3(ss); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 191 | |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 192 | get_user_ex(tmpflags, &sc->flags); |
| 193 | regs->flags = (regs->flags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS); |
| 194 | /* disable syscall checks */ |
| 195 | regs->orig_ax = -1; |
Thomas Gleixner | 99b9cdf | 2008-01-30 13:30:07 +0100 | [diff] [blame] | 196 | |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 197 | get_user_ex(tmp, &sc->fpstate); |
| 198 | buf = compat_ptr(tmp); |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 199 | } get_user_catch(err); |
| 200 | |
H. Peter Anvin | 49b8c695 | 2012-09-21 17:18:44 -0700 | [diff] [blame] | 201 | err |= restore_xstate_sig(buf, 1); |
H. Peter Anvin | 5e88353 | 2012-09-21 12:43:15 -0700 | [diff] [blame] | 202 | |
Brian Gerst | 1daeaa3 | 2015-03-21 18:54:21 -0400 | [diff] [blame] | 203 | force_iret(); |
| 204 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 205 | return err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 206 | } |
| 207 | |
Al Viro | 3fe26fa | 2012-11-12 14:32:42 -0500 | [diff] [blame] | 208 | asmlinkage long sys32_sigreturn(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 209 | { |
Al Viro | 3fe26fa | 2012-11-12 14:32:42 -0500 | [diff] [blame] | 210 | struct pt_regs *regs = current_pt_regs(); |
Hiroshi Shimamoto | 3b0d29e | 2008-12-17 18:51:46 -0800 | [diff] [blame] | 211 | struct sigframe_ia32 __user *frame = (struct sigframe_ia32 __user *)(regs->sp-8); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 212 | sigset_t set; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 213 | |
| 214 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) |
| 215 | goto badframe; |
| 216 | if (__get_user(set.sig[0], &frame->sc.oldmask) |
| 217 | || (_COMPAT_NSIG_WORDS > 1 |
Thomas Gleixner | 99b9cdf | 2008-01-30 13:30:07 +0100 | [diff] [blame] | 218 | && __copy_from_user((((char *) &set.sig) + 4), |
| 219 | &frame->extramask, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 220 | sizeof(frame->extramask)))) |
| 221 | goto badframe; |
| 222 | |
Oleg Nesterov | 905f29e | 2011-07-10 21:27:24 +0200 | [diff] [blame] | 223 | set_current_blocked(&set); |
Thomas Gleixner | 99b9cdf | 2008-01-30 13:30:07 +0100 | [diff] [blame] | 224 | |
Brian Gerst | 6a3713f | 2015-04-04 08:58:23 -0400 | [diff] [blame^] | 225 | if (ia32_restore_sigcontext(regs, &frame->sc)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 226 | goto badframe; |
Brian Gerst | 6a3713f | 2015-04-04 08:58:23 -0400 | [diff] [blame^] | 227 | return regs->ax; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 228 | |
| 229 | badframe: |
| 230 | signal_fault(regs, frame, "32bit sigreturn"); |
| 231 | return 0; |
Thomas Gleixner | 99b9cdf | 2008-01-30 13:30:07 +0100 | [diff] [blame] | 232 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 233 | |
Al Viro | 3fe26fa | 2012-11-12 14:32:42 -0500 | [diff] [blame] | 234 | asmlinkage long sys32_rt_sigreturn(void) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 235 | { |
Al Viro | 3fe26fa | 2012-11-12 14:32:42 -0500 | [diff] [blame] | 236 | struct pt_regs *regs = current_pt_regs(); |
Hiroshi Shimamoto | 3b0d29e | 2008-12-17 18:51:46 -0800 | [diff] [blame] | 237 | struct rt_sigframe_ia32 __user *frame; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 238 | sigset_t set; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 239 | |
Hiroshi Shimamoto | 3b0d29e | 2008-12-17 18:51:46 -0800 | [diff] [blame] | 240 | frame = (struct rt_sigframe_ia32 __user *)(regs->sp - 4); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 241 | |
| 242 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) |
| 243 | goto badframe; |
| 244 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
| 245 | goto badframe; |
| 246 | |
Oleg Nesterov | 905f29e | 2011-07-10 21:27:24 +0200 | [diff] [blame] | 247 | set_current_blocked(&set); |
Thomas Gleixner | 99b9cdf | 2008-01-30 13:30:07 +0100 | [diff] [blame] | 248 | |
Brian Gerst | 6a3713f | 2015-04-04 08:58:23 -0400 | [diff] [blame^] | 249 | if (ia32_restore_sigcontext(regs, &frame->uc.uc_mcontext)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 250 | goto badframe; |
| 251 | |
Al Viro | 9026843 | 2012-12-14 14:47:53 -0500 | [diff] [blame] | 252 | if (compat_restore_altstack(&frame->uc.uc_stack)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 253 | goto badframe; |
| 254 | |
Brian Gerst | 6a3713f | 2015-04-04 08:58:23 -0400 | [diff] [blame^] | 255 | return regs->ax; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 256 | |
| 257 | badframe: |
Thomas Gleixner | 99b9cdf | 2008-01-30 13:30:07 +0100 | [diff] [blame] | 258 | signal_fault(regs, frame, "32bit rt sigreturn"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 259 | return 0; |
Thomas Gleixner | 99b9cdf | 2008-01-30 13:30:07 +0100 | [diff] [blame] | 260 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 261 | |
| 262 | /* |
| 263 | * Set up a signal frame. |
| 264 | */ |
| 265 | |
Thomas Gleixner | 99b9cdf | 2008-01-30 13:30:07 +0100 | [diff] [blame] | 266 | static int ia32_setup_sigcontext(struct sigcontext_ia32 __user *sc, |
Suresh Siddha | ab51370 | 2008-07-29 10:29:22 -0700 | [diff] [blame] | 267 | void __user *fpstate, |
Thomas Gleixner | 99b9cdf | 2008-01-30 13:30:07 +0100 | [diff] [blame] | 268 | struct pt_regs *regs, unsigned int mask) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 269 | { |
Hiroshi Shimamoto | a967bb3 | 2009-02-20 19:00:54 -0800 | [diff] [blame] | 270 | int err = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 271 | |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 272 | put_user_try { |
Hiroshi Shimamoto | a967bb3 | 2009-02-20 19:00:54 -0800 | [diff] [blame] | 273 | put_user_ex(get_user_seg(gs), (unsigned int __user *)&sc->gs); |
| 274 | put_user_ex(get_user_seg(fs), (unsigned int __user *)&sc->fs); |
| 275 | put_user_ex(get_user_seg(ds), (unsigned int __user *)&sc->ds); |
| 276 | put_user_ex(get_user_seg(es), (unsigned int __user *)&sc->es); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 277 | |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 278 | put_user_ex(regs->di, &sc->di); |
| 279 | put_user_ex(regs->si, &sc->si); |
| 280 | put_user_ex(regs->bp, &sc->bp); |
| 281 | put_user_ex(regs->sp, &sc->sp); |
| 282 | put_user_ex(regs->bx, &sc->bx); |
| 283 | put_user_ex(regs->dx, &sc->dx); |
| 284 | put_user_ex(regs->cx, &sc->cx); |
| 285 | put_user_ex(regs->ax, &sc->ax); |
Srikar Dronamraju | 51e7dc7 | 2012-03-12 14:55:55 +0530 | [diff] [blame] | 286 | put_user_ex(current->thread.trap_nr, &sc->trapno); |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 287 | put_user_ex(current->thread.error_code, &sc->err); |
| 288 | put_user_ex(regs->ip, &sc->ip); |
| 289 | put_user_ex(regs->cs, (unsigned int __user *)&sc->cs); |
| 290 | put_user_ex(regs->flags, &sc->flags); |
| 291 | put_user_ex(regs->sp, &sc->sp_at_signal); |
| 292 | put_user_ex(regs->ss, (unsigned int __user *)&sc->ss); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 293 | |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 294 | put_user_ex(ptr_to_compat(fpstate), &sc->fpstate); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 295 | |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 296 | /* non-iBCS2 extensions.. */ |
| 297 | put_user_ex(mask, &sc->oldmask); |
| 298 | put_user_ex(current->thread.cr2, &sc->cr2); |
| 299 | } put_user_catch(err); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 300 | |
| 301 | return err; |
| 302 | } |
| 303 | |
| 304 | /* |
| 305 | * Determine which stack to use.. |
| 306 | */ |
Al Viro | 235b802 | 2012-11-09 23:51:47 -0500 | [diff] [blame] | 307 | static void __user *get_sigframe(struct ksignal *ksig, struct pt_regs *regs, |
Suresh Siddha | 3c1c7f1 | 2008-07-29 10:29:21 -0700 | [diff] [blame] | 308 | size_t frame_size, |
Mathias Krause | 0ff8fef | 2012-09-02 23:31:42 +0200 | [diff] [blame] | 309 | void __user **fpstate) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 310 | { |
H. Peter Anvin | 65ea5b0 | 2008-01-30 13:30:56 +0100 | [diff] [blame] | 311 | unsigned long sp; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 312 | |
| 313 | /* Default to using normal stack */ |
H. Peter Anvin | 65ea5b0 | 2008-01-30 13:30:56 +0100 | [diff] [blame] | 314 | sp = regs->sp; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 315 | |
| 316 | /* This is the X/Open sanctioned signal stack switching. */ |
Al Viro | 235b802 | 2012-11-09 23:51:47 -0500 | [diff] [blame] | 317 | if (ksig->ka.sa.sa_flags & SA_ONSTACK) |
| 318 | sp = sigsp(sp, ksig); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 319 | /* This is the legacy signal stack switching. */ |
Hiroshi Shimamoto | 8bee3f0 | 2008-12-16 14:04:43 -0800 | [diff] [blame] | 320 | else if ((regs->ss & 0xffff) != __USER32_DS && |
Al Viro | 235b802 | 2012-11-09 23:51:47 -0500 | [diff] [blame] | 321 | !(ksig->ka.sa.sa_flags & SA_RESTORER) && |
| 322 | ksig->ka.sa.sa_restorer) |
| 323 | sp = (unsigned long) ksig->ka.sa.sa_restorer; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 324 | |
Suresh Siddha | 3c1c7f1 | 2008-07-29 10:29:21 -0700 | [diff] [blame] | 325 | if (used_math()) { |
Suresh Siddha | 72a671c | 2012-07-24 16:05:29 -0700 | [diff] [blame] | 326 | unsigned long fx_aligned, math_size; |
| 327 | |
| 328 | sp = alloc_mathframe(sp, 1, &fx_aligned, &math_size); |
Mathias Krause | 0ff8fef | 2012-09-02 23:31:42 +0200 | [diff] [blame] | 329 | *fpstate = (struct _fpstate_ia32 __user *) sp; |
Suresh Siddha | 72a671c | 2012-07-24 16:05:29 -0700 | [diff] [blame] | 330 | if (save_xstate_sig(*fpstate, (void __user *)fx_aligned, |
| 331 | math_size) < 0) |
Hiroshi Shimamoto | 99ea1b93 | 2008-11-05 18:32:54 -0800 | [diff] [blame] | 332 | return (void __user *) -1L; |
Suresh Siddha | 3c1c7f1 | 2008-07-29 10:29:21 -0700 | [diff] [blame] | 333 | } |
| 334 | |
H. Peter Anvin | 65ea5b0 | 2008-01-30 13:30:56 +0100 | [diff] [blame] | 335 | sp -= frame_size; |
Markus F.X.J. Oberhumer | d347f37 | 2005-10-09 18:54:23 +0200 | [diff] [blame] | 336 | /* Align the stack pointer according to the i386 ABI, |
| 337 | * i.e. so that on function entry ((sp + 4) & 15) == 0. */ |
H. Peter Anvin | 65ea5b0 | 2008-01-30 13:30:56 +0100 | [diff] [blame] | 338 | sp = ((sp + 4) & -16ul) - 4; |
| 339 | return (void __user *) sp; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 340 | } |
| 341 | |
Al Viro | 235b802 | 2012-11-09 23:51:47 -0500 | [diff] [blame] | 342 | int ia32_setup_frame(int sig, struct ksignal *ksig, |
Thomas Gleixner | 99b9cdf | 2008-01-30 13:30:07 +0100 | [diff] [blame] | 343 | compat_sigset_t *set, struct pt_regs *regs) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 344 | { |
Hiroshi Shimamoto | 3b0d29e | 2008-12-17 18:51:46 -0800 | [diff] [blame] | 345 | struct sigframe_ia32 __user *frame; |
Thomas Gleixner | 99b9cdf | 2008-01-30 13:30:07 +0100 | [diff] [blame] | 346 | void __user *restorer; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 347 | int err = 0; |
Suresh Siddha | ab51370 | 2008-07-29 10:29:22 -0700 | [diff] [blame] | 348 | void __user *fpstate = NULL; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 349 | |
Thomas Gleixner | 99b9cdf | 2008-01-30 13:30:07 +0100 | [diff] [blame] | 350 | /* copy_to_user optimizes that into a single 8 byte store */ |
| 351 | static const struct { |
| 352 | u16 poplmovl; |
| 353 | u32 val; |
| 354 | u16 int80; |
Thomas Gleixner | 99b9cdf | 2008-01-30 13:30:07 +0100 | [diff] [blame] | 355 | } __attribute__((packed)) code = { |
| 356 | 0xb858, /* popl %eax ; movl $...,%eax */ |
| 357 | __NR_ia32_sigreturn, |
| 358 | 0x80cd, /* int $0x80 */ |
Thomas Gleixner | 99b9cdf | 2008-01-30 13:30:07 +0100 | [diff] [blame] | 359 | }; |
| 360 | |
Al Viro | 235b802 | 2012-11-09 23:51:47 -0500 | [diff] [blame] | 361 | frame = get_sigframe(ksig, regs, sizeof(*frame), &fpstate); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 362 | |
| 363 | if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) |
Hiroshi Shimamoto | 3d0aedd | 2008-09-12 17:01:09 -0700 | [diff] [blame] | 364 | return -EFAULT; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 365 | |
Hiroshi Shimamoto | 2ba48e1 | 2008-09-12 17:02:53 -0700 | [diff] [blame] | 366 | if (__put_user(sig, &frame->sig)) |
Hiroshi Shimamoto | 3d0aedd | 2008-09-12 17:01:09 -0700 | [diff] [blame] | 367 | return -EFAULT; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 368 | |
Hiroshi Shimamoto | 2ba48e1 | 2008-09-12 17:02:53 -0700 | [diff] [blame] | 369 | if (ia32_setup_sigcontext(&frame->sc, fpstate, regs, set->sig[0])) |
Hiroshi Shimamoto | 3d0aedd | 2008-09-12 17:01:09 -0700 | [diff] [blame] | 370 | return -EFAULT; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 371 | |
| 372 | if (_COMPAT_NSIG_WORDS > 1) { |
Hiroshi Shimamoto | 2ba48e1 | 2008-09-12 17:02:53 -0700 | [diff] [blame] | 373 | if (__copy_to_user(frame->extramask, &set->sig[1], |
| 374 | sizeof(frame->extramask))) |
Hiroshi Shimamoto | 3d0aedd | 2008-09-12 17:01:09 -0700 | [diff] [blame] | 375 | return -EFAULT; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 376 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 377 | |
Al Viro | 235b802 | 2012-11-09 23:51:47 -0500 | [diff] [blame] | 378 | if (ksig->ka.sa.sa_flags & SA_RESTORER) { |
| 379 | restorer = ksig->ka.sa.sa_restorer; |
Roland McGrath | af65d64 | 2008-01-30 13:30:43 +0100 | [diff] [blame] | 380 | } else { |
| 381 | /* Return stub is in 32bit vsyscall page */ |
Roland McGrath | 1a3e4ca | 2008-04-09 01:29:27 -0700 | [diff] [blame] | 382 | if (current->mm->context.vdso) |
Andy Lutomirski | 6f121e5 | 2014-05-05 12:19:34 -0700 | [diff] [blame] | 383 | restorer = current->mm->context.vdso + |
| 384 | selected_vdso32->sym___kernel_sigreturn; |
Roland McGrath | af65d64 | 2008-01-30 13:30:43 +0100 | [diff] [blame] | 385 | else |
Jan Engelhardt | ade1af7 | 2008-01-30 13:33:23 +0100 | [diff] [blame] | 386 | restorer = &frame->retcode; |
Roland McGrath | af65d64 | 2008-01-30 13:30:43 +0100 | [diff] [blame] | 387 | } |
Thomas Gleixner | 99b9cdf | 2008-01-30 13:30:07 +0100 | [diff] [blame] | 388 | |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 389 | put_user_try { |
| 390 | put_user_ex(ptr_to_compat(restorer), &frame->pretcode); |
| 391 | |
| 392 | /* |
| 393 | * These are actually not used anymore, but left because some |
| 394 | * gdb versions depend on them as a marker. |
| 395 | */ |
Mathias Krause | 0ff8fef | 2012-09-02 23:31:42 +0200 | [diff] [blame] | 396 | put_user_ex(*((u64 *)&code), (u64 __user *)frame->retcode); |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 397 | } put_user_catch(err); |
| 398 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 399 | if (err) |
Hiroshi Shimamoto | 3d0aedd | 2008-09-12 17:01:09 -0700 | [diff] [blame] | 400 | return -EFAULT; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 401 | |
| 402 | /* Set up registers for signal handler */ |
H. Peter Anvin | 65ea5b0 | 2008-01-30 13:30:56 +0100 | [diff] [blame] | 403 | regs->sp = (unsigned long) frame; |
Al Viro | 235b802 | 2012-11-09 23:51:47 -0500 | [diff] [blame] | 404 | regs->ip = (unsigned long) ksig->ka.sa.sa_handler; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 405 | |
Andi Kleen | 536e3ee | 2006-09-26 10:52:41 +0200 | [diff] [blame] | 406 | /* Make -mregparm=3 work */ |
H. Peter Anvin | 65ea5b0 | 2008-01-30 13:30:56 +0100 | [diff] [blame] | 407 | regs->ax = sig; |
| 408 | regs->dx = 0; |
| 409 | regs->cx = 0; |
Andi Kleen | 536e3ee | 2006-09-26 10:52:41 +0200 | [diff] [blame] | 410 | |
Jeremy Fitzhardinge | b6edbb1 | 2008-08-19 13:04:19 -0700 | [diff] [blame] | 411 | loadsegment(ds, __USER32_DS); |
| 412 | loadsegment(es, __USER32_DS); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 413 | |
Thomas Gleixner | 99b9cdf | 2008-01-30 13:30:07 +0100 | [diff] [blame] | 414 | regs->cs = __USER32_CS; |
| 415 | regs->ss = __USER32_DS; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 416 | |
Andi Kleen | 1d001df | 2006-09-26 10:52:26 +0200 | [diff] [blame] | 417 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 418 | } |
| 419 | |
Al Viro | 235b802 | 2012-11-09 23:51:47 -0500 | [diff] [blame] | 420 | int ia32_setup_rt_frame(int sig, struct ksignal *ksig, |
Thomas Gleixner | 99b9cdf | 2008-01-30 13:30:07 +0100 | [diff] [blame] | 421 | compat_sigset_t *set, struct pt_regs *regs) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 422 | { |
Hiroshi Shimamoto | 3b0d29e | 2008-12-17 18:51:46 -0800 | [diff] [blame] | 423 | struct rt_sigframe_ia32 __user *frame; |
Roland McGrath | af65d64 | 2008-01-30 13:30:43 +0100 | [diff] [blame] | 424 | void __user *restorer; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 425 | int err = 0; |
Suresh Siddha | ab51370 | 2008-07-29 10:29:22 -0700 | [diff] [blame] | 426 | void __user *fpstate = NULL; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 427 | |
Thomas Gleixner | 99b9cdf | 2008-01-30 13:30:07 +0100 | [diff] [blame] | 428 | /* __copy_to_user optimizes that into a single 8 byte store */ |
| 429 | static const struct { |
| 430 | u8 movl; |
| 431 | u32 val; |
| 432 | u16 int80; |
Hiroshi Shimamoto | 9cc3c49 | 2008-11-11 19:11:39 -0800 | [diff] [blame] | 433 | u8 pad; |
Thomas Gleixner | 99b9cdf | 2008-01-30 13:30:07 +0100 | [diff] [blame] | 434 | } __attribute__((packed)) code = { |
| 435 | 0xb8, |
| 436 | __NR_ia32_rt_sigreturn, |
| 437 | 0x80cd, |
| 438 | 0, |
| 439 | }; |
| 440 | |
Al Viro | 235b802 | 2012-11-09 23:51:47 -0500 | [diff] [blame] | 441 | frame = get_sigframe(ksig, regs, sizeof(*frame), &fpstate); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 442 | |
| 443 | if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) |
Hiroshi Shimamoto | 3d0aedd | 2008-09-12 17:01:09 -0700 | [diff] [blame] | 444 | return -EFAULT; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 445 | |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 446 | put_user_try { |
| 447 | put_user_ex(sig, &frame->sig); |
| 448 | put_user_ex(ptr_to_compat(&frame->info), &frame->pinfo); |
| 449 | put_user_ex(ptr_to_compat(&frame->uc), &frame->puc); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 450 | |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 451 | /* Create the ucontext. */ |
| 452 | if (cpu_has_xsave) |
| 453 | put_user_ex(UC_FP_XSTATE, &frame->uc.uc_flags); |
| 454 | else |
| 455 | put_user_ex(0, &frame->uc.uc_flags); |
| 456 | put_user_ex(0, &frame->uc.uc_link); |
Al Viro | bd1c149a | 2013-09-01 20:35:01 +0100 | [diff] [blame] | 457 | compat_save_altstack_ex(&frame->uc.uc_stack, regs->sp); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 458 | |
Al Viro | 235b802 | 2012-11-09 23:51:47 -0500 | [diff] [blame] | 459 | if (ksig->ka.sa.sa_flags & SA_RESTORER) |
| 460 | restorer = ksig->ka.sa.sa_restorer; |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 461 | else |
Andy Lutomirski | 6f121e5 | 2014-05-05 12:19:34 -0700 | [diff] [blame] | 462 | restorer = current->mm->context.vdso + |
| 463 | selected_vdso32->sym___kernel_rt_sigreturn; |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 464 | put_user_ex(ptr_to_compat(restorer), &frame->pretcode); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 465 | |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 466 | /* |
| 467 | * Not actually used anymore, but left because some gdb |
| 468 | * versions need it. |
| 469 | */ |
Mathias Krause | 0ff8fef | 2012-09-02 23:31:42 +0200 | [diff] [blame] | 470 | put_user_ex(*((u64 *)&code), (u64 __user *)frame->retcode); |
Hiroshi Shimamoto | 3b4b757 | 2009-01-23 15:50:38 -0800 | [diff] [blame] | 471 | } put_user_catch(err); |
| 472 | |
Al Viro | 235b802 | 2012-11-09 23:51:47 -0500 | [diff] [blame] | 473 | err |= copy_siginfo_to_user32(&frame->info, &ksig->info); |
H. Peter Anvin | 5e88353 | 2012-09-21 12:43:15 -0700 | [diff] [blame] | 474 | err |= ia32_setup_sigcontext(&frame->uc.uc_mcontext, fpstate, |
| 475 | regs, set->sig[0]); |
| 476 | err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); |
| 477 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 478 | if (err) |
Hiroshi Shimamoto | 3d0aedd | 2008-09-12 17:01:09 -0700 | [diff] [blame] | 479 | return -EFAULT; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 480 | |
| 481 | /* Set up registers for signal handler */ |
H. Peter Anvin | 65ea5b0 | 2008-01-30 13:30:56 +0100 | [diff] [blame] | 482 | regs->sp = (unsigned long) frame; |
Al Viro | 235b802 | 2012-11-09 23:51:47 -0500 | [diff] [blame] | 483 | regs->ip = (unsigned long) ksig->ka.sa.sa_handler; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 484 | |
Albert Cahalan | a7aacdf | 2006-10-29 22:26:17 -0500 | [diff] [blame] | 485 | /* Make -mregparm=3 work */ |
H. Peter Anvin | 65ea5b0 | 2008-01-30 13:30:56 +0100 | [diff] [blame] | 486 | regs->ax = sig; |
| 487 | regs->dx = (unsigned long) &frame->info; |
| 488 | regs->cx = (unsigned long) &frame->uc; |
Albert Cahalan | a7aacdf | 2006-10-29 22:26:17 -0500 | [diff] [blame] | 489 | |
Jeremy Fitzhardinge | b6edbb1 | 2008-08-19 13:04:19 -0700 | [diff] [blame] | 490 | loadsegment(ds, __USER32_DS); |
| 491 | loadsegment(es, __USER32_DS); |
Thomas Gleixner | 99b9cdf | 2008-01-30 13:30:07 +0100 | [diff] [blame] | 492 | |
| 493 | regs->cs = __USER32_CS; |
| 494 | regs->ss = __USER32_DS; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 495 | |
Andi Kleen | 1d001df | 2006-09-26 10:52:26 +0200 | [diff] [blame] | 496 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 497 | } |