[2.1.90 patch] SMP sys_idle() user level hang

Andrea Arcangeli (arcangeli@mbox.queen.it)
Wed, 25 Mar 1998 15:49:12 +0100 (CET)


This program call sys_idle() and then the process became unkillable
since sys_idle should not be used from userland.

void main()
{
__asm__ volatile ("int $0x80" : : "a" ((long)0x70));
}

Here the patch:
--- linux/arch/i386/kernel/process.c 1998/03/25 14:29:40 1.1
+++ linux/arch/i386/kernel/process.c 1998/03/25 14:35:05
@@ -171,6 +171,8 @@

asmlinkage int sys_idle(void)
{
+ if (current->pid != 0)
+ return -EPERM;
cpu_idle(NULL);
return 0;
}

Thanks to Eliott for the tipsy.c program that showed this up (but please
Eliott remeber to tell people run it as nobody!!!!!! for example with
`echo ~andrea/devel/tipsy | su - nobody`). Not it' s running from some
minutes and no more problems here.

Andrea[s] Arcangeli

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu