Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751916AbcDOPsw (ORCPT ); Fri, 15 Apr 2016 11:48:52 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:51086 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751636AbcDOPqn (ORCPT ); Fri, 15 Apr 2016 11:46:43 -0400 From: "Eric W. Biederman" To: Linus Torvalds Cc: "H. Peter Anvin" , Andy Lutomirski , security@debian.org, security@kernel.org, Al Viro , security@ubuntu.com, Peter Hurley , Serge Hallyn , Willy Tarreau , Aurelien Jarno , One Thousand Gnomes , Jann Horn , Greg KH , Linux Kernel Mailing List , Jiri Slaby , Florian Weimer , "Eric W. Biederman" Date: Fri, 15 Apr 2016 10:35:21 -0500 Message-Id: <1460734532-20134-5-git-send-email-ebiederm@xmission.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1460734532-20134-1-git-send-email-ebiederm@xmission.com> References: <877ffyzy1j.fsf_-_@x220.int.ebiederm.org> <1460734532-20134-1-git-send-email-ebiederm@xmission.com> X-XM-AID: U2FsdGVkX18iMY0XdoLMVuh/urjJHaYJ2OgF3UZfbaM= 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 * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.7 XMSubLong Long Subject * 0.0 TVD_RCVD_IP Message was received from an IP address * 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] * 0.0 T_TooManySym_01 4+ unique symbols in subject 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 793 ms - load_scoreonly_sql: 0.03 (0.0%), signal_user_changed: 3.0 (0.4%), b_tie_ro: 2.2 (0.3%), parse: 0.59 (0.1%), extract_message_metadata: 9 (1.2%), get_uri_detail_list: 0.61 (0.1%), tests_pri_-1000: 6 (0.7%), tests_pri_-950: 0.99 (0.1%), tests_pri_-900: 0.81 (0.1%), tests_pri_-400: 16 (2.1%), check_bayes: 16 (2.0%), b_tokenize: 4.5 (0.6%), b_tok_get_all: 5 (0.7%), b_comp_prob: 1.33 (0.2%), b_tok_touch_all: 2.7 (0.3%), b_finish: 0.60 (0.1%), tests_pri_0: 748 (94.3%), check_dkim_signature: 0.45 (0.1%), check_dkim_adsp: 2.6 (0.3%), tests_pri_500: 6 (0.7%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH 05/16] vfs: Allow unlink, and rename on expirable file mounts 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 in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 935 Lines: 32 This is motivated by /dev/ptmx now being an automount. Given that automounts eventually will go away I don't see that there is a point in making unlink and rename to wait until the automounts actually go away before allowing an operation. Signed-off-by: "Eric W. Biederman" --- fs/namespace.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fs/namespace.c b/fs/namespace.c index 714778360c2b..278ecb7b8e8e 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -718,8 +718,14 @@ bool __is_local_mountpoint(struct dentry *dentry) down_read(&namespace_sem); list_for_each_entry(mnt, &ns->list, mnt_list) { is_covered = (mnt->mnt_mountpoint == dentry); - if (is_covered) + if (is_covered) { + if (!d_is_dir(dentry) && + (mnt->mnt.mnt_flags & MNT_SHRINKABLE)) { + is_covered = false; + continue; + } break; + } } up_read(&namespace_sem); out: -- 2.8.1