tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: FIOSETOWN and TIOCSPGRP vs control ttys



In article <201805172011.QAA05887%Stone.Rodents-Montreal.ORG@localhost>,
Mouse  <mouse%Rodents-Montreal.ORG@localhost> wrote:
>In sys/kern/tty.c, I find
>
>	case FIOSETOWN: {		/* set pgrp of tty */
>[...]
>		if (tp->t_session != NULL && !isctty(p, tp)) {
>			mutex_exit(proc_lock);
>			return (ENOTTY);
>		}
>
>and
>
>	case TIOCSPGRP: {		/* set pgrp of tty */
>[...]
>		if (!isctty(p, tp)) {
>			mutex_exit(proc_lock);
>			return (ENOTTY);
>		}
>
>These are being a problem for me; I want to open up two ttys, neither
>being my control tty, and get SIGIO when I/O is possible on either.
>Obviously, I can just build a kernel with those tests snipped out;
>indeed, I'm doing exactly that to see if my code works then.
>
>But I'm wondering why those checks are there, wondering what hazard I'm
>risking by removing them.  Anyone happen to know?

It is a security issue (as usual).

christos



Home | Main Index | Thread Index | Old Index