kernel-hardening.lists.openwall.com archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/1] Restrict access to TIOCLINUX
@ 2023-08-28 16:41 Günther Noack
  2023-08-28 16:41 ` [PATCH v3 1/1] tty: Restrict access to TIOCLINUX' copy-and-paste subcommands Günther Noack
  2023-08-28 16:45 ` [PATCH v3 0/1] Restrict access to TIOCLINUX Samuel Thibault
  0 siblings, 2 replies; 13+ messages in thread
From: Günther Noack @ 2023-08-28 16:41 UTC (permalink / raw)
  To: Greg KH
  Cc: Hanno Böck, kernel-hardening, Kees Cook, Jiri Slaby,
	Geert Uytterhoeven, Paul Moore, Samuel Thibault, David Laight,
	Simon Brand, Dave Mielke, Mickaël Salaün, KP Singh,
	Nico Schottelius, Günther Noack

Hello!

This is a re-send of a patch by Hanno Böck from 2023-04-02 [1], to restrict the
use of the copy-and-paste functionality in the TIOCLINUX IOCTL.

These copy-and-paste operations can be misused in the same way as the TIOCSTI
IOCTL, which can be disabled with a CONFIG option, since commit 83efeeeb3d04
("tty: Allow TIOCSTI to be disabled") and commit 690c8b804ad2 ("TIOCSTI: always
enable for CAP_SYS_ADMIN").  With this option set to N, the use of TIOCSTI
requires CAP_SYS_ADMIN.

We believe that it should be OK to not make this configurable: For TIOCLINUX's
copy-and-paste subcommands, the only known usage so far is GPM.  I have
personally verified that this continues to work, as GPM runs as root.

The number of affected programs should be much lower than it was the case for
TIOCSTI (as TIOCLINUX only applies to virtual terminals), and even in the
TIOCLINUX case, only a handful of legitimate use cases were mentioned.  (BRLTTY,
tcsh, Emacs, special versions of "mail").  I have high confidence that GPM is
the only existing usage of that copy-and-paste feature.

(If configurability is really required, the way to be absolutely sure would be
to introduce a CONFIG option for it as well -- but it would be a pretty obscure
option to have, but we can do that if needed.)

Changes in v3:
 - Added missing Signed-off-by: line

Changes in v2:
 - Rebased to Linux v6.5
 - Reworded commit message a bit
 - Added Tested-By

[1] https://lore.kernel.org/all/20230402160815.74760f87.hanno@hboeck.de/

Hanno Böck (1):
  tty: Restrict access to TIOCLINUX' copy-and-paste subcommands

 drivers/tty/vt/vt.c | 6 ++++++
 1 file changed, 6 insertions(+)


base-commit: 2dde18cd1d8fac735875f2e4987f11817cc0bc2c
-- 
2.42.0.rc2.253.gd59a3bf2b4-goog


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-10-11 15:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-28 16:41 [PATCH v3 0/1] Restrict access to TIOCLINUX Günther Noack
2023-08-28 16:41 ` [PATCH v3 1/1] tty: Restrict access to TIOCLINUX' copy-and-paste subcommands Günther Noack
2023-08-28 18:43   ` Mickaël Salaün
2023-08-28 18:48     ` Greg KH
2023-08-28 16:45 ` [PATCH v3 0/1] Restrict access to TIOCLINUX Samuel Thibault
2023-08-29 13:00   ` Günther Noack
2023-08-30  0:36     ` Samuel Thibault
2023-09-15 13:32     ` Günther Noack
2023-10-09 20:19       ` Kees Cook
2023-10-10  6:17         ` Greg KH
2023-10-10 22:23           ` Kees Cook
2023-10-11  6:22             ` Greg KH
2023-10-11 15:49               ` sending commit notification to patch thread (was "Re: [PATCH v3 0/1] Restrict access to TIOCLINUX") Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).