git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
arch
/
i386
/
kernel
/
ioport.c
diff --git
a/arch/i386/kernel/ioport.c
b/arch/i386/kernel/ioport.c
index
8b25160
..
79026f0
100644
(file)
--- a/
arch/i386/kernel/ioport.c
+++ b/
arch/i386/kernel/ioport.c
@@
-7,6
+7,7
@@
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/kernel.h>
+#include <linux/capability.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/ioport.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/ioport.h>
@@
-108,8
+109,11
@@
asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on)
/*
* Sets the lazy trigger so that the next I/O operation will
* reload the correct bitmap.
/*
* Sets the lazy trigger so that the next I/O operation will
* reload the correct bitmap.
+ * Reset the owner so that a process switch will not set
+ * tss->io_bitmap_base to IO_BITMAP_OFFSET.
*/
tss->io_bitmap_base = INVALID_IO_BITMAP_OFFSET_LAZY;
*/
tss->io_bitmap_base = INVALID_IO_BITMAP_OFFSET_LAZY;
+ tss->io_bitmap_owner = NULL;
put_cpu();
put_cpu();
@@
-132,6
+136,7
@@
asmlinkage long sys_iopl(unsigned long unused)
volatile struct pt_regs * regs = (struct pt_regs *) &unused;
unsigned int level = regs->ebx;
unsigned int old = (regs->eflags >> 12) & 3;
volatile struct pt_regs * regs = (struct pt_regs *) &unused;
unsigned int level = regs->ebx;
unsigned int old = (regs->eflags >> 12) & 3;
+ struct thread_struct *t = ¤t->thread;
if (level > 3)
return -EINVAL;
if (level > 3)
return -EINVAL;
@@
-140,8
+145,8
@@
asmlinkage long sys_iopl(unsigned long unused)
if (!capable(CAP_SYS_RAWIO))
return -EPERM;
}
if (!capable(CAP_SYS_RAWIO))
return -EPERM;
}
-
regs->eflags = (regs->eflags &~ 0x3000UL) | (level << 12)
;
- /* Make sure we return the long way (not sysenter) */
- set_
thread_flag(TIF_IRET
);
+
t->iopl = level << 12
;
+ regs->eflags = (regs->eflags & ~X86_EFLAGS_IOPL) | t->iopl;
+ set_
iopl_mask(t->iopl
);
return 0;
}
return 0;
}