Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932867AbcDHUQd (ORCPT ); Fri, 8 Apr 2016 16:16:33 -0400 Received: from out02.mta.xmission.com ([166.70.13.232]:53866 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932818AbcDHUQb (ORCPT ); Fri, 8 Apr 2016 16:16:31 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Linus Torvalds Cc: "H. Peter Anvin" , Peter Hurley , Greg KH , Jiri Slaby , Aurelien Jarno , Andy Lutomirski , Florian Weimer , Al Viro , Serge Hallyn , Jann Horn , "security\@kernel.org" , "security\@ubuntu.com \>\> security" , security@debian.org, Willy Tarreau , Linux Kernel Mailing List References: <878u0s3orx.fsf_-_@x220.int.ebiederm.org> <1459819769-30387-1-git-send-email-ebiederm@xmission.com> <87twjcorwg.fsf@x220.int.ebiederm.org> Date: Fri, 08 Apr 2016 15:05:56 -0500 In-Reply-To: (Linus Torvalds's message of "Fri, 8 Apr 2016 12:05:56 -0700") Message-ID: <87inzroogr.fsf@x220.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-AID: U2FsdGVkX18XgNrV1HpyD67rwzs+rl/Ll53uNr2qnJU= X-SA-Exim-Connect-IP: 67.3.249.252 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.7 XMSubLong Long Subject * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa05 1397; Body=1 Fuz1=1 Fuz2=1] X-Spam-DCC: XMission; sa05 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;Linus Torvalds X-Spam-Relay-Country: X-Spam-Timing: total 226 ms - load_scoreonly_sql: 0.06 (0.0%), signal_user_changed: 4.6 (2.1%), b_tie_ro: 3.3 (1.5%), parse: 1.22 (0.5%), extract_message_metadata: 16 (7.3%), get_uri_detail_list: 2.3 (1.0%), tests_pri_-1000: 6 (2.8%), tests_pri_-950: 0.93 (0.4%), tests_pri_-900: 0.83 (0.4%), tests_pri_-400: 26 (11.7%), check_bayes: 26 (11.3%), b_tokenize: 6 (2.5%), b_tok_get_all: 9 (4.0%), b_comp_prob: 1.70 (0.8%), b_tok_touch_all: 4.8 (2.1%), b_finish: 0.71 (0.3%), tests_pri_0: 162 (71.5%), check_dkim_signature: 0.40 (0.2%), check_dkim_adsp: 2.7 (1.2%), tests_pri_500: 4.8 (2.1%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated devpts via path lookup X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Wed, 24 Sep 2014 11:00:52 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1502 Lines: 36 Linus Torvalds writes: > On Fri, Apr 8, 2016 at 11:51 AM, Eric W. Biederman > wrote: >> >> Given that concern under the rule we don't break userspace we have to >> check the permissions of /dev/pts/ptmx when we are creating a new pty, >> on a instance of devpts that was created with newinstance. > > The rule is that we don't break existing installations. > > If somebody has root and installs a "ptmx" node in an existing mount > space next to a pts subdirectory, that's not a security issue, nor is > it going to break any existing installation. Anyone can do that with "mount --bind". All it takes is root in a user namespace. I can get root in a user namespace as no one special. So someone may have set such a thing up, and it may now be possible to defeat such a regime as anyone. In practice I suspect all such cases are handled by actually hiding the mount of devpts in another mount namespace. > The whole point of the patch is that yes, we change semantics. A > change of semantics means that people will see situations where the > behavior is different. But that's not "breaking user space", that's > just "ok, you can see a difference". If we don't want to care about this case, and if someone complains about a security regression readd my permission checks I am fine with that. But I don't want to let a possibility of breaking someone (that I don't know how to test for, and would be silent breakage) slip through. Eric