Not only are the applications depending on this particular form of
privilege elevation generally inappropriate uses of these machines
(they are large "server-class" machines, typically shipped and run
headless), but the devices typically managed with these interfaces
are already explicitly unsupported in UNIX configurations.
This patch removes sys_iopl() and sys_ioperm() support conditional on
#ifdef CONFIG_X86_NUMAQ to prevent the device register corruption
condition without significant impact on core i386 support.
diff -urpN linux-2.5.68/arch/i386/kernel/ioport.c ioperm-2.5.68-1/arch/i386/kernel/ioport.c
--- linux-2.5.68/arch/i386/kernel/ioport.c 2003-04-19 19:49:26.000000000 -0700
+++ ioperm-2.5.68-1/arch/i386/kernel/ioport.c 2003-04-30 05:01:09.000000000 -0700
@@ -53,6 +53,12 @@ static void set_bitmap(unsigned long *bi
/*
* this changes the io permissions bitmap in the current task.
*/
+#ifdef CONFIG_X86_NUMAQ
+asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int turn_on)
+{
+ return -ENOSYS;
+}
+#else
asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int turn_on)
{
struct thread_struct * t = ¤t->thread;
@@ -97,6 +103,7 @@ asmlinkage int sys_ioperm(unsigned long
out:
return ret;
}
+#endif
/*
* sys_iopl has to be used when you want to access the IO ports
@@ -109,6 +116,12 @@ out:
* code.
*/
+#ifdef CONFIG_X86_NUMAQ
+asmlinkage int sys_iopl(unsigned long unused)
+{
+ return -ENOSYS;
+}
+#else
asmlinkage int sys_iopl(unsigned long unused)
{
volatile struct pt_regs * regs = (struct pt_regs *) &unused;
@@ -127,3 +140,4 @@ asmlinkage int sys_iopl(unsigned long un
set_thread_flag(TIF_IRET);
return 0;
}
+#endif
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/