Skip to content

linux: Disable LEGACY_PTYS to avoid creating numerous unused tty devices #657

Closed
pmenzel opened this issue Mar 2, 2018 · 9 comments
Closed

Comments

@pmenzel
Copy link
Collaborator

pmenzel commented Mar 2, 2018

From https://github.com/scaleway/image-debian/issues/27:

That's caused by CONFIG_LEGACY_PTYS=y and CONFIG_LEGACY_PTY_COUNT=256 in the kernel
configuration. These days it's sufficient to rely on CONFIG_UNIX98_PTYS=y only.

pmenzel added a commit that referenced this issue Mar 26, 2018
> A pseudo terminal (PTY) is a software device consisting of two                                        │
> halves: a master and a slave. The slave device behaves identical to                                   │
> a physical terminal; the master device is used by a process to                                        │
> read data from and write data to the slave, thereby emulating a                                       │
> terminal. Typical programs for the master side are telnet servers                                     │
> and xterms.                                                                                           │
>                                                                                                       │
> Linux has traditionally used the BSD-like names /dev/ptyxx                                            │
> for masters and /dev/ttyxx for slaves of pseudo                                                       │
> terminals. This scheme has a number of problems, including                                            │
> security.  This option enables these legacy devices; on most                                          │
> systems, it is safe to say N.

Fixes: #657
@thomas
Copy link
Collaborator

thomas commented Mar 27, 2018

It's worth a try, and see what eventually breaks.
Other distros are less radical,
Slackware:
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=32
Mint:
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=0

I guess the minties enable them on demand.

@pmenzel
Copy link
Collaborator Author

pmenzel commented Mar 27, 2018 via email

@donald
Copy link
Collaborator

donald commented Mar 27, 2018

Default is 'Y' so according to our policy we need a reason to disabled it. Kconfig help text says, "This scheme has a number of problems, including security. This option enables these legacy devices; on most systems, it is safe to say N." I'd say that's enough reason, so I agree, lets try to disable it and see who is missing it.

@donald
Copy link
Collaborator

donald commented Mar 27, 2018

theinternet now without CONFIG_LEGACY_PTYS. Terminal Windows and screen are happy.

@thomas
Copy link
Collaborator

thomas commented Mar 27, 2018

I hope you mean xterm :)

@pmenzel pmenzel reopened this Mar 27, 2018
@donald
Copy link
Collaborator

donald commented Mar 27, 2018

Yeah. "windows" not "Windows" :)

@donald
Copy link
Collaborator

donald commented Mar 27, 2018

Also, it’s what the Linux kernel developers recommend.

If so, I wonder, why it is defaulted to Y.

@pmenzel
Copy link
Collaborator Author

pmenzel commented Mar 27, 2018 via email

donald pushed a commit that referenced this issue Apr 11, 2018
> A pseudo terminal (PTY) is a software device consisting of two                                        │
> halves: a master and a slave. The slave device behaves identical to                                   │
> a physical terminal; the master device is used by a process to                                        │
> read data from and write data to the slave, thereby emulating a                                       │
> terminal. Typical programs for the master side are telnet servers                                     │
> and xterms.                                                                                           │
>                                                                                                       │
> Linux has traditionally used the BSD-like names /dev/ptyxx                                            │
> for masters and /dev/ttyxx for slaves of pseudo                                                       │
> terminals. This scheme has a number of problems, including                                            │
> security.  This option enables these legacy devices; on most                                          │
> systems, it is safe to say N.

Fixes: #657
@pmenzel
Copy link
Collaborator Author

pmenzel commented Apr 26, 2018

No idea, why this was re-open. Did I force push? Anyway, it’s fixed since Linux 4.14.30-211 (commit 7e5443d (linux-4.14.30-211: Unselect CONFIG_LEGACY_PTYS)).

@pmenzel pmenzel closed this as completed Apr 26, 2018
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants