From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753158AbbIQBBr (ORCPT ); Wed, 16 Sep 2015 21:01:47 -0400 Received: from out03.mta.xmission.com ([166.70.13.233]:36825 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752952AbbIQBBo (ORCPT ); Wed, 16 Sep 2015 21:01:44 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Andy Lutomirski Cc: Seth Forshee , Alexander Viro , Jeff Layton , "J. Bruce Fields" , Serge Hallyn , Linux FS Devel , LSM List , SELinux-NSA , "linux-kernel\@vger.kernel.org" , linux-mtd@lists.infradead.org References: <1442433764-80826-1-git-send-email-seth.forshee@canonical.com> <1442433764-80826-3-git-send-email-seth.forshee@canonical.com> Date: Wed, 16 Sep 2015 19:54:26 -0500 In-Reply-To: (Andy Lutomirski's message of "Wed, 16 Sep 2015 17:24:47 -0700") Message-ID: <87r3lxyif1.fsf@x220.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-AID: U2FsdGVkX1+8Mcip80Yj/8trmkxhsR1VrbI/oxmTbK0= X-SA-Exim-Connect-IP: 67.3.201.231 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.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 * [sa04 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_02 5+ unique symbols in subject * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa04 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Andy Lutomirski X-Spam-Relay-Country: X-Spam-Timing: total 316 ms - load_scoreonly_sql: 0.07 (0.0%), signal_user_changed: 4.8 (1.5%), b_tie_ro: 3.4 (1.1%), parse: 1.21 (0.4%), extract_message_metadata: 18 (5.8%), get_uri_detail_list: 2.5 (0.8%), tests_pri_-1000: 9 (2.8%), tests_pri_-950: 1.15 (0.4%), tests_pri_-900: 0.94 (0.3%), tests_pri_-400: 21 (6.8%), check_bayes: 20 (6.3%), b_tokenize: 6 (1.8%), b_tok_get_all: 7 (2.3%), b_comp_prob: 1.88 (0.6%), b_tok_touch_all: 2.7 (0.8%), b_finish: 0.89 (0.3%), tests_pri_0: 180 (56.8%), tests_pri_500: 76 (24.2%), poll_dns_idle: 71 (22.5%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH v3 2/7] userns: Simpilify MNT_NODEV handling. 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 Andy Lutomirski writes: > On Wed, Sep 16, 2015 at 1:02 PM, Seth Forshee > wrote: >> From: "Eric W. Biederman" >> >> - Consolidate the testing if a device node may be opened in a new >> function may_open_dev. >> >> - Move the check for allowing access to device nodes on filesystems >> not mounted in the initial user namespace from mount time to open >> time and include it in may_open_dev. >> >> This set of changes removes the implicit adding of MNT_NODEV which >> simplifies the logic in fs/namespace.c and removes a potentially >> problematic user visible difference in how normal and unprivileged >> mount namespaces work. >> >> Signed-off-by: "Eric W. Biederman" > >> - /* Only in special cases allow devices from mounts >> - * created outside the initial user namespace. >> - */ >> - if (!(type->fs_flags & FS_USERNS_DEV_MOUNT)) { >> - flags |= MS_NODEV; >> - mnt_flags |= MNT_NODEV | MNT_LOCK_NODEV; >> - } > > This is an ABI change. It's probably okay, but I think the commit > message should make it clear what's happening. You mean it should include in big flashing neon letters ***REGRESSION FIX*** ? It is longer in coming than I had hoped. But that is part of the reason I did not fix the security hole this way. Getting the s_user_ns stuff just so has been non-trivial. I do agree that because this is a user visible change we do need to keep our eyes peeled for pieces of userspace software that may depend on the exact details of the current behavior. Eric