[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wg+hJ9Y8AKjp9qD7E_-pgBFdWGLiqzi1qth8LNpuST1cA@mail.gmail.com>
Date: Sun, 21 Apr 2024 10:18:31 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Jiri Slaby <jirislaby@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>, "Starke, Daniel" <daniel.starke@...mens.com>,
LKML <linux-kernel@...r.kernel.org>,
linux-security-module <linux-security-module@...r.kernel.org>
Subject: Re: [PATCH v2] tty: n_gsm: restrict tty devices to attach
On Sun, 21 Apr 2024 at 09:04, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> The only option is to *mark* the ones that are atomic. Which was my suggestion.
Actually, another option would be to just return an error at 'set_ldisc()' time.
Sadly, the actual "tty->ops->set_ldisc()" function not only returns
'void' (easy enough to change - there aren't that many of them), but
it's called too late after the old ldisc has already been dropped.
It's basically a "inform tty about new ldisc" and is not useful for a
"is this ok"?
But we could trivially add a "ldisc_ok()" function, and have the vt
driver say "I only accept N_TTY".
Something like this ENTIRELY UNTESTED patch.
Again - this is untested, and maybe there are other tty drivers that
have issues with the stranger line disciplines, but this at least
seems simple and fairly easy to explain why we do what we do..
And if pty's really need the same thing, that would be easy to add.
But I actually think that at least pty slaves should *not* limit
ldiscs, because the whole point of a pty slave is to look like another
tty. If you want to emulate a serial device over a network, the way to
do it would be with a pty.
Hmm?
Linus
View attachment "patch.diff" of type "text/x-patch" (2497 bytes)
Powered by blists - more mailing lists