Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp3985704rwl; Tue, 27 Dec 2022 19:37:10 -0800 (PST) X-Google-Smtp-Source: AMrXdXs9qCuuooH/oYkoBB53+JIAGzv2UxpifuEg/FUg/H49+iVPW6ADZsndavENS8IMQ3GuaZ2a X-Received: by 2002:a17:906:490a:b0:7c1:1444:da2e with SMTP id b10-20020a170906490a00b007c11444da2emr20694308ejq.63.1672198629968; Tue, 27 Dec 2022 19:37:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672198629; cv=none; d=google.com; s=arc-20160816; b=zcrncIigU0g9x8AvXqdLARbsHODenkd5xlzWPfHq8V6OMvTjijiC13V1bniVV3JxS3 thY7lo+NIMXq7HQPy3Z1Dk2jDfA3KG2ZRSjgQOCddvaQgUgarUdHicHMhnn4FJLTlxTQ /wKh27NIo2e+Roy7AAR5Avh8Q2Trxq3AlXS9T5RORBt2doJv8jJX2iRIQ7t9R6+BACzc yIqA3qrgd9bdLzxUGYmpRFPhO6P02B2Q9WJnZz8fGuaMkQnnh47gQwYgvDl9m/J0yZg5 g3emG3kRUcYAZ/AaTAyr28XHUgIQKc+CToUiN6weOmKmuZaxZwJoO7k/dst199JcdPr8 THiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:references:in-reply-to:user-agent:subject:cc:to:from :date:dkim-signature; bh=w9mpzeCvEROC54qvL7ZvnKKhW+eFwQeW1NXSj0dwglI=; b=PDp8pozqxKVwO32us1aP0tRG+UCyizIIt5antTS/xzbIaxxQBcIO3LrgX0vAcl10er n7KyrpKAIQwIhGQfMkuX5faoqxyf/KdGjuAUN6QQ6+OsOcvzpNOzOajZsORWYm9CG3MP Qno+GGAWbWmAedLqLYAjtHXUjeiGeRrRQ6hieDtVbLA5GstP7zo0Q4cYjY0wwH7ulBvk DCp8QOh8Dz6n8jCjzSi0Xvy7m6trbT2VC2UXXSDGbL5bD187V3tJkPDWaPugKsydmRCl WvhQ05hPXFDKsXnVVZxCpLJ7ofRBjwJmcSpkcZeox7fr41/lJayFyiAUzLDrPolU9p4j rH/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OH0Lyt6+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bb6-20020a1709070a0600b007c3d44b41cfsi12182677ejc.988.2022.12.27.19.36.54; Tue, 27 Dec 2022 19:37:09 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OH0Lyt6+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230317AbiL1DdA (ORCPT + 65 others); Tue, 27 Dec 2022 22:33:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229660AbiL1Dc6 (ORCPT ); Tue, 27 Dec 2022 22:32:58 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEDCE635B; Tue, 27 Dec 2022 19:32:57 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 19969612E8; Wed, 28 Dec 2022 03:32:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C5C2C433EF; Wed, 28 Dec 2022 03:32:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672198376; bh=bc+s+NbQoL95udEHZ4Axbwh4eI0R3gw4cmHickwG5nE=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=OH0Lyt6+n6l25DKimmA9JD3OXpI2oBTwGv8S45TDcXtmj1INpaG/92riGhvA2uqOP Fh5jmHd/wyKaiUkmrkOzqxfiqC1xnx2GZCmFvg/kIjNCBY22/W0xtXfUwhM7VzTqa/ KmaQFpc6wEJisymhk1dhLvZVGY21VCtSTezLoNV8+kiY0p39cVb9j5WmQuE9wWqBCX 0iIFqgv7JQehIwPrjV91VhoFYzQhlTrATOGre4OuH9N/ccn5ebfS8FNLTaZPTI9TGK hYtjjsQ8NxeH6RlZdMW9ylIJpBtEBwQ9sWkARHwE3I/ad1lEC9Rvm1BF+jIQd7ps6o JkMs24OYDECMQ== Date: Tue, 27 Dec 2022 19:32:55 -0800 From: Kees Cook To: Samuel Thibault , Kees Cook CC: Greg Kroah-Hartman , Jiri Slaby , Simon Brand , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v3 2/2] tty: Allow TIOCSTI to be disabled User-Agent: K-9 Mail for Android In-Reply-To: <20221227234000.jgosvixx7eahqb3z@begin> References: <20221022182828.give.717-kees@kernel.org> <20221022182949.2684794-2-keescook@chromium.org> <20221227234000.jgosvixx7eahqb3z@begin> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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: X-Mailing-List: linux-kernel@vger.kernel.org On December 27, 2022 3:40:00 PM PST, Samuel Thibault wrote: >Hello, > >Kees Cook, le sam=2E 22 oct=2E 2022 11:29:49 -0700, a ecrit: >> TIOCSTI continues its long history of being used in privilege escalatio= n >> attacks[1]=2E Prior attempts to provide a mechanism to disable this hav= e >> devolved into discussions around creating full-blown LSMs to provide >> arbitrary ioctl filtering, which is hugely over-engineered -- only >> TIOCSTI is being used this way=2E 3 years ago OpenBSD entirely removed >> TIOCSTI[2], Android has had it filtered for longer[3], and the tools th= at >> had historically used TIOCSTI either do not need it, are not commonly >> built with it, or have had its use removed=2E > >No=2E The Brltty screen reader entirely relies on TIOCSTI to be able to >support input from various Braille devices=2E Please make sure to keep >TIOCSTI enabled by default, otherwise some people would just completely >lose their usual way of simply typing on Linux=2E Yup, it remains default enabled: > [=2E=2E=2E] >> +config LEGACY_TIOCSTI >> + bool "Allow legacy TIOCSTI usage" >> + default y >> + help >> + Historically the kernel has allowed TIOCSTI, which will push >> + characters into a controlling TTY=2E This continues to be used >> + as a malicious privilege escalation mechanism, and provides no >> + meaningful real-world utility any more=2E > >Yes it does=2E Can you send a patch to adjust this language? Also, what does FreeBSD use for screen readers? -Kees --=20 Kees Cook