Commit a5b32379 authored by Linus Torvalds's avatar Linus Torvalds

Fix some special cases for "sysenter" - some system calls depend on

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.
parent ca41247f
......@@ -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;
}
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment