Re: [patch] generic-pidhash-2.5.36-D4, BK-curr

Linus Torvalds (torvalds@transmeta.com)
Thu, 19 Sep 2002 08:12:31 -0700 (PDT)


On Thu, 19 Sep 2002, William Lee Irwin III wrote:
>
> I did this intentionally. Basically, sys_setsid() does the right thing,
> but tty_ioctl() does not. There is already some inconsistency
> about how task->tty is locked, and I'd not yet come to a conclusion.

I agree about the locking issue (although I do _not_ believe that the
tasklock should have anything to do with the tsk->tty locking - it should
most likely use some per-task lock for the actual tty accesses, together
with the optimization that a write lock on the tasklock is sufficient to
protect it because it means that nobody else can look up the task).

However, what I worry about is that there may not (will not) be a 1:1
session<->tty thing. In particular, when somebody creates a new session
with "setsid()", that does not remove the tty from processes that used to
hold it, I think (this is all from memory, so I might be wrong).

Which means that if the tty is going away, it has to be removed from _all_
tasks, not just from the one session that happened to be the most recent
one.

Linus

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