Message ID | 20230710002645.v565c7xq5iddruse@begin |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp4702102vqx; Sun, 9 Jul 2023 17:59:38 -0700 (PDT) X-Google-Smtp-Source: APBJJlHyFcS71KPOCEMCMzcK2yBWEDr88sLZusHWRagGRJFqhvdzw0RK8EbmToz8FH5hIJmXnnub X-Received: by 2002:a05:6a00:2444:b0:67e:ca79:36f0 with SMTP id d4-20020a056a00244400b0067eca7936f0mr13221096pfj.0.1688950777834; Sun, 09 Jul 2023 17:59:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688950777; cv=none; d=google.com; s=arc-20160816; b=k6GHIjpDaaUGrgGX9Jm+VpvaGbld27RT05nDimIePrUo69QM4ih7N2tZhoNHcDFNkL kl6cIjDrJAaQ/4ZjnMcw2IKo9ZU8zV4lhGKK3gwev4b9HJwCyVR7EFdaF7VJrlxDB+bP qIcRnw7ffsc8IX3Ta8YkWX1iK1Bc9Ihx2lK2FkL1Seu5lAGL/DOiJrneE5RpfXXvOimI ovk3dYRROMkoUoqnFTd/rsLzk8XInEOU3I0+TeGp4kFeQzNM/p9iDqM42hfcLV6275ig rO9oaPCoVV/kSwtg0BeQy78B5S5mWlM5TgAgYjueYYuMkSlOxSUoBWch0WL7a1UemJNT fS/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:content-disposition:mime-version :mail-followup-to:message-id:subject:cc:to:from:date; bh=0oxpsIdif9Vyu5/rwnma5uHUTwsqOnTvUFqQlQn7pzA=; fh=vPPFO9Cz1cnYYkMsGjKN6hXWaGysjjyBBxYd/bHeFEc=; b=ujqz/rYj1im5kqA7GFqk7lH/rax1jsOJJcwYCDiXa100+ujzx/VQgU6LhnHerXpT64 n2FIm+2MnMv+xJBxAquQ+fifObAsKhw4Taoob7cOswLRKqHHxJtEFboyaD+UmdhFk94S DYidLSjmp7gaPKWhuQ42Ym6prbDMtC+iN6xN0e455GARFIknqrDh7hi544Re27MB/rc0 tZiGVIzmTIiqdKc0cuVQ9498Q9ctCmgp5CakC2sqd3Yxoax2UTM6o1uzwOPbqD/8A5kc XzyHaBKCNW+uGicQJlBlvlchB8hW6dI/nv5enIiu8Xx06lp4d6w+1PUXy/5NS4wqoQrM gqVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k18-20020a056a00135200b0067d204bf281si2303710pfu.3.2023.07.09.17.59.16; Sun, 09 Jul 2023 17:59:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229795AbjGJA04 (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Sun, 9 Jul 2023 20:26:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbjGJA0z (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 9 Jul 2023 20:26:55 -0400 Received: from sonata.ens-lyon.org (domu-toccata.ens-lyon.fr [140.77.166.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 996A311C for <linux-kernel@vger.kernel.org>; Sun, 9 Jul 2023 17:26:53 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 1907720156; Mon, 10 Jul 2023 02:26:46 +0200 (CEST) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Pi8yPwfYqiJA; Mon, 10 Jul 2023 02:26:45 +0200 (CEST) Received: from begin (lfbn-bor-1-1163-184.w92-158.abo.wanadoo.fr [92.158.138.184]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id 88F7020155; Mon, 10 Jul 2023 02:26:45 +0200 (CEST) Received: from samy by begin with local (Exim 4.96) (envelope-from <samuel.thibault@ens-lyon.org>) id 1qIejl-00FI59-0C; Mon, 10 Jul 2023 02:26:45 +0200 Date: Mon, 10 Jul 2023 02:26:45 +0200 From: Samuel Thibault <samuel.thibault@ens-lyon.org> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Randy Dunlap <rdunlap@infradead.org>, Jiri Slaby <jirislaby@kernel.org>, Simon Brand <simon.brand@postadigitale.de>, Kees Cook <keescook@chromium.org> Cc: linux-kernel@vger.kernel.org, Dave@mielke.cc Subject: [PATCH] TIOCSTI: always enable for CAP_SYS_ADMIN Message-ID: <20230710002645.v565c7xq5iddruse@begin> Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Randy Dunlap <rdunlap@infradead.org>, Jiri Slaby <jirislaby@kernel.org>, Simon Brand <simon.brand@postadigitale.de>, Kees Cook <keescook@chromium.org>, linux-kernel@vger.kernel.org, Dave@mielke.cc MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: NeoMutt/20170609 (1.8.3) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1770993250782197730 X-GMAIL-MSGID: 1770993250782197730 |
Series |
TIOCSTI: always enable for CAP_SYS_ADMIN
|
|
Commit Message
Samuel Thibault
July 10, 2023, 12:26 a.m. UTC
83efeeeb3d04 ("tty: Allow TIOCSTI to be disabled") broke BRLTTY's ability to simulate keypresses on the console, thus effectively breaking braille keyboards of blind users. This restores the TIOCSTI feature for CAP_SYS_ADMIN processes, which BRLTTY is, thus fixing braille keyboards without re-opening the security issue. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Acked-by: Kees Cook <keescook@chromium.org> Fixes: 83efeeeb3d04 ("tty: Allow TIOCSTI to be disabled") Cc: stable@vger.kernel.org
Comments
On 10. 07. 23, 2:26, Samuel Thibault wrote: > 83efeeeb3d04 ("tty: Allow TIOCSTI to be disabled") broke BRLTTY's > ability to simulate keypresses on the console, thus effectively breaking > braille keyboards of blind users. > > This restores the TIOCSTI feature for CAP_SYS_ADMIN processes, which > BRLTTY is, thus fixing braille keyboards without re-opening the security > issue. > > Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> > Acked-by: Kees Cook <keescook@chromium.org> > Fixes: 83efeeeb3d04 ("tty: Allow TIOCSTI to be disabled") > Cc: stable@vger.kernel.org Acked-by: Jiri Slaby <jirislaby@kernel.org> thanks,
Index: linux-6.4/drivers/tty/tty_io.c =================================================================== --- linux-6.4.orig/drivers/tty/tty_io.c +++ linux-6.4/drivers/tty/tty_io.c @@ -2276,7 +2276,7 @@ static int tiocsti(struct tty_struct *tt char ch, mbz = 0; struct tty_ldisc *ld; - if (!tty_legacy_tiocsti) + if (!tty_legacy_tiocsti && !capable(CAP_SYS_ADMIN)) return -EIO; if ((current->signal->tty != tty) && !capable(CAP_SYS_ADMIN))