Re: context switch vs. signal delivery [was: Re: Accelerating user mode

From: Udo A. Steinberg (us15@os.inf.tu-dresden.de)
Date: Tue Aug 06 2002 - 03:10:59 EST


On Mon, 05 Aug 2002 21:55:05 -0500
>
> > If you have one process per task and a kernel process, the kernel
> > process cannot change socket ownership over to the next task's
> > process, because it's not allowed to.
>
> Why not? I see nothing at all in the implementation of F_SETOWN that requires
> that it be called by the current owner:
>
> case F_SETOWN:
> lock_kernel();
> filp->f_owner.pid = arg;
> filp->f_owner.uid = current->uid;
> filp->f_owner.euid = current->euid;
> ...

Ok, I was looking at sockets and not tty's and that has the following in
net/core/sock.c
                   case F_SETOWN:
                        /*
                         * This is a little restrictive, but it's the only
                         * way to make sure that you can't send a sigurg to
                         * another process.
                         */
                        if (current->pgrp != -arg &&
                                current->pid != arg &&
                                !capable(CAP_KILL)) return(-EPERM);
                        sk->proc = arg;
                        return(0);

So it wouldn't work with socketpairs, but with tty's it should.

-Udo.
-
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/



This archive was generated by hypermail 2b29 : Wed Aug 07 2002 - 22:00:30 EST