]> git.neil.brown.name Git - history.git/commitdiff
Fix some special cases for "sysenter" - some system calls depend on
authorLinus Torvalds <torvalds@home.transmeta.com>
Sun, 29 Dec 2002 07:42:40 +0000 (23:42 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sun, 29 Dec 2002 07:42:40 +0000 (23:42 -0800)
doing a full register restore on return to user space, and thus require
the long system call exit path (ie "iret" instead of "sysexit").

 * execve() - we need to set edx/ecx correctly at process startup.
 * iopl() - needs iret to restore eflags with new IOPL levels.

arch/i386/kernel/ioport.c
arch/i386/kernel/process.c

index d80fd0b70284177ecd58378165cb99e10e279031..a795bafc6f177cfcfb8f610be4e64a8c037181aa 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/smp_lock.h>
 #include <linux/stddef.h>
 #include <linux/slab.h>
+#include <linux/thread_info.h>
 
 /* Set EXTENT bits starting at BASE in BITMAP to value TURN_ON. */
 static void set_bitmap(unsigned long *bitmap, short base, short extent, int new_value)
@@ -122,5 +123,7 @@ asmlinkage int sys_iopl(unsigned long unused)
                        return -EPERM;
        }
        regs->eflags = (regs->eflags & 0xffffcfff) | (level << 12);
+       /* Make sure we return the long way (not sysenter) */
+       set_thread_flag(TIF_SIGPENDING);
        return 0;
 }
index f5e6bb3948645c0ba441dfe59c9afba175f2e208..1c9c7d17dcc5b6c7b6ff4dc50858541f7f8ccdc6 100644 (file)
@@ -558,8 +558,11 @@ asmlinkage int sys_execve(struct pt_regs regs)
        if (IS_ERR(filename))
                goto out;
        error = do_execve(filename, (char **) regs.ecx, (char **) regs.edx, &regs);
-       if (error == 0)
+       if (error == 0) {
                current->ptrace &= ~PT_DTRACE;
+               /* Make sure we don't return using sysenter.. */
+               set_thread_flag(TIF_SIGPENDING);
+       }
        putname(filename);
 out:
        return error;