Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751292AbdFBUMC (ORCPT ); Fri, 2 Jun 2017 16:12:02 -0400 Received: from mail-wr0-f169.google.com ([209.85.128.169]:36008 "EHLO mail-wr0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750971AbdFBUMA (ORCPT ); Fri, 2 Jun 2017 16:12:00 -0400 MIME-Version: 1.0 In-Reply-To: <20170602210544.73680be8@lxorguk.ukuu.org.uk> References: <20170530132427.016053da@alans-desktop> <2ab8580e-bf8e-21bd-6bfa-33e5fa82400b@nmatt.com> <20170530235106.11aab25c@alans-desktop> <3bd4ff7b-6f7d-52b0-03f6-026bac79f11f@nmatt.com> <20170531005633.484a2e14@alans-desktop> <20170601140812.583cf0a5@alans-desktop> <20170601222432.6f593538@lxorguk.ukuu.org.uk> <2d0ad49c-886e-1caf-771a-d251957f614c@nmatt.com> <20170602153647.GA2688@mail.hallyn.com> <20170602210544.73680be8@lxorguk.ukuu.org.uk> From: Nick Kralevich Date: Fri, 2 Jun 2017 13:11:56 -0700 Message-ID: Subject: Re: [kernel-hardening] Re: [PATCH v7 2/2] security: tty: make TIOCSTI ioctl require CAP_SYS_ADMIN To: Alan Cox Cc: Matt Brown , "Serge E. Hallyn" , Kees Cook , Casey Schaufler , Boris Lukashev , Greg KH , "kernel-hardening@lists.openwall.com" , linux-security-module , linux-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 613 Lines: 23 On Fri, Jun 2, 2017 at 1:05 PM, Alan Cox wrote: > So I'd say it's all the generic tty ioctls except TIOCSTI and TIOCSETD > but it would be good to see what Android is going with and why. Android limits tty ioctls to the following whitelist: TIOCOUTQ FIOCLEX TCGETS TCSETS TIOCGWINSZ TIOCSWINSZ TIOCSCTTY TCSETSW TCFLSH TIOCSPGRP TIOCGPGRP See unpriv_tty_ioctls at https://android.googlesource.com/platform/system/sepolicy/+/34b4b73729b288b4109b2225c1445eb58393b8cb/public/ioctl_macros#51 -- Nick Kralevich | Android Security | nnk@google.com | 650.214.4037