From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE48CC04EB9 for ; Mon, 3 Dec 2018 21:56:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9B55520864 for ; Mon, 3 Dec 2018 21:56:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9B55520864 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726070AbeLCV4u (ORCPT ); Mon, 3 Dec 2018 16:56:50 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:49008 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725938AbeLCV4t (ORCPT ); Mon, 3 Dec 2018 16:56:49 -0500 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.91 #2 (Red Hat Linux)) id 1gTwCl-0001pC-Cp; Mon, 03 Dec 2018 21:56:39 +0000 Date: Mon, 3 Dec 2018 21:56:39 +0000 From: Al Viro To: Ondrej Mosnacek Cc: Paul Moore , Stephen Rothwell , linux-next@vger.kernel.org, Linux kernel mailing list , David Howells , selinux@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: linux-next: manual merge of the selinux tree with the vfs tree Message-ID: <20181203215639.GV2217@ZenIV.linux.org.uk> References: <20181127115246.00967523@canb.auug.org.au> <20181127225013.133adc7d@canb.auug.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 03, 2018 at 11:12:59AM +0100, Ondrej Mosnacek wrote: > I think I figured out what's the problem. NFS still creates the > submount via the old vfs_submount() call, which calls > vfs_kern_mount(), which creates an fs_context with > FS_CONTEXT_FOR_USER_MOUNT because FS_CONTEXT_FOR_SUBMOUNT needs the > mountpoint dentry reference and there is currently no way to pass that > to vfs_kern_mount(). This is further complicated by the fact that > vfs_submount() accepts only a const reference to the mountpoint, while > vfs_new_fs_context() expects a non-const one... > > I think all users of the old vfs_submount call should be converted to > the new API before the VFS changes are merged into mainline, otherwise > they will break the SELinux submount fix. We could work around it in > the SELinux hook by checking the fc->sb_flags[_mask] for SB_SUBMOUNT, > but I guess that would be a hack. Could you take a look at vfs.git#Q28? There's still a massive reshuffling going on, so there will be more branches; this one is the latest at the moment. I really hate the situation around sb_clone_mnt_opts/sb_set_mnt_opts and I'm none too fond of the way fs_context_validate is done, so there will be quite a bit of LSM tweaking. If we are doing that, let's do it right...