Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934138AbcCIVHn (ORCPT ); Wed, 9 Mar 2016 16:07:43 -0500 Received: from out03.mta.xmission.com ([166.70.13.233]:33527 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932580AbcCIVHe (ORCPT ); Wed, 9 Mar 2016 16:07:34 -0500 From: ebiederm@xmission.com (Eric W. Biederman) To: Seth Forshee Cc: linux-fsdevel@vger.kernel.org, "Serge E. Hallyn" , linux-kernel@vger.kernel.org References: <1457536687-32794-1-git-send-email-seth.forshee@canonical.com> Date: Wed, 09 Mar 2016 14:57:47 -0600 In-Reply-To: <1457536687-32794-1-git-send-email-seth.forshee@canonical.com> (Seth Forshee's message of "Wed, 9 Mar 2016 09:18:05 -0600") Message-ID: <87oaanz7w4.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: U2FsdGVkX1/8hNSNuNEIW2MJgnygE3BYo2qnvquwr+A= X-SA-Exim-Connect-IP: 70.59.168.211 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 * 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.4818] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa06 1397; Body=1 Fuz1=1 Fuz2=1] X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: *;Seth Forshee X-Spam-Relay-Country: X-Spam-Timing: total 383 ms - load_scoreonly_sql: 0.03 (0.0%), signal_user_changed: 2.9 (0.8%), b_tie_ro: 2.1 (0.5%), parse: 0.87 (0.2%), extract_message_metadata: 17 (4.5%), get_uri_detail_list: 1.71 (0.4%), tests_pri_-1000: 5 (1.4%), tests_pri_-950: 1.27 (0.3%), tests_pri_-900: 1.04 (0.3%), tests_pri_-400: 22 (5.7%), check_bayes: 20 (5.3%), b_tokenize: 7 (1.9%), b_tok_get_all: 6 (1.5%), b_comp_prob: 2.1 (0.6%), b_tok_touch_all: 3.0 (0.8%), b_finish: 0.73 (0.2%), tests_pri_0: 191 (49.9%), check_dkim_signature: 0.49 (0.1%), check_dkim_adsp: 3.8 (1.0%), tests_pri_500: 138 (36.0%), poll_dns_idle: 132 (34.6%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH 0/2] Fix debugfs bind mount regression 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: 1562 Lines: 31 Seth Forshee writes: > Some full-OS container software bind mounts debugfs into containers to > satisfy the assumptions of older userspaces which expect to be able to > mount debugfs. This regressed in 4.1 due to the addition of tracefs, > which gets automounted in the tracing subdirectory of debugfs. In a > cloned mount namespace the bind mount now fails because the tracefs > mount is a locked child of the debugfs mount. > > For new mounts we already make an exception to the "locked child mount" > rule. Directories in psuedo filesystems created for the sole purpose of > being mountpoints are created as permanently empty directories which can > never contain any entries, therefore the kernel can know than any mounts > on these directories are not for security purposes. These mounts are > then excluded from locked mount tests in some circumstances. > > The same logic clearly applies to directories created in > debugfs_create_automount(). The following patches update this function > to create permanently empty directories for mountpoints and adds an > exclusion to the tests for bind mounts to exclude child mounts on > permanently empty directories. So I don't know that this approach is bad. However in reading through your patch descriptions I do not see any consideration of using "mount --rbind" instead of "mount --bind". AKA adding the MS_REC flag to your bind mount. I would think simply using MS_REC would solve this problem, without needing any additional kernel support. Am I missing something? Eric