Re: [PATCH 2/2] x86: Allow disabling of sys_iopl, sys_ioperm

From: Andrew Morton
Date: Thu Jul 14 2011 - 18:32:14 EST


On Thu, 14 Jul 2011 13:34:53 -0700
Mike Waychison <mikew@xxxxxxxxxx> wrote:

> --- a/arch/x86/kernel/ioport.c
> +++ b/arch/x86/kernel/ioport.c
> @@ -17,6 +17,7 @@
> #include <linux/bitmap.h>
> #include <asm/syscalls.h>
>
> +#ifdef CONFIG_X86_SYS_IOPL
> /*
> * this changes the io permissions bitmap in the current task.
> */
> @@ -111,3 +112,14 @@ long sys_iopl(unsigned int level, struct pt_regs *regs)
>
> return 0;
> }
> +
> +#else /* CONFIG_X86_SYS_IOPL */
> +
> +asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on) {
> + return -ENOSYS;
> +}
> +
> +long sys_iopl(unsigned int level, struct pt_regs *regs) {
> + return -ENOSYS;
> +}
> +#endif /* CONFIG_X86_SYS_IOPL */

sys_iopl() is missing asmlinkage.

It would be far more conventional to use cond_syscall(). Perhaps by
adding a CONFIG_X86 area into kernel/sys_ni.c

fyi, I'm offering special deals on checkpatch.pl site licenses this month.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/