Re: Slight change to daemonless kernel/kmod.c: please test

Shaw Carruthers (shaw@shawc.demon.co.uk)
Wed, 29 Apr 1998 22:16:29 +0100 (GMT+0100)


On Wed, 29 Apr 1998, Mikael Pettersson wrote:

>
> Adam: couldn't this be caused by the fact that exec_modprobe()
> doesn't set current->fsuid to zero.
> I.e., I strongly suspect that we _should_ set fsuid to zero too;
> that is, after all, what happens when a setuid-root executable is run.
>

Spot on, thanks. This fixes the problem

--- linux/kernel/kmod.c~ Fri Apr 24 09:23:04 1998
+++ linux/kernel/kmod.c Wed Apr 29 22:03:20 1998
@@ -67,7 +67,7 @@
spin_unlock_irq(&current->sigmask_lock);

set_fs(KERNEL_DS); /* Allow execve args to be in kernel space. */
- current->uid = current->euid = 0;
+ current->uid = current->euid = current->fsuid = 0;
if (execve(modprobe_path, argv, envp) < 0) {
printk(KERN_ERR
"kmod: failed to exec %s -s -k %s, errno = %d\n",

--
Shaw Carruthers - shaw@shawc.demon.co.uk
London SW14 7JW UK
This is not a sig( with homage to Magritte).
  

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