Received: by 2002:ac8:71d8:0:b0:40f:fb00:664b with SMTP id i24csp214535qtp; Fri, 4 Aug 2023 08:47:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE/plDd3zMxRc0tvizVl4/CxF4hpIjMRllGTMXZp9qa7GICCgoSmmd8XbFCIeaSdvA7hvHX X-Received: by 2002:a17:902:b70e:b0:1bb:a922:4a1a with SMTP id d14-20020a170902b70e00b001bba9224a1amr1799136pls.6.1691164078002; Fri, 04 Aug 2023 08:47:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691164077; cv=none; d=google.com; s=arc-20160816; b=dK/KVN1gLtzRlztpMwB8CyZHURzlbTXz1qmO3Ny1C1CBC//Baozz8Wi7EUueAvGbXD VPG+tDBvMNqU1kUfY6hJ8t7adYVrDvtI+gWuIT8UhpsoGqNoS25dcMIwwcveZ4g5fD2L 9CGiAtOsJLp+uJY+pT7FXbV/anh+JDY9r0lkqu0LKpyZMhwXcy/0mu7l9mmt3u1jrn1G wzustyFSXINF43Q8YrMBlRVnfqw+l84C7ZNL11R1LOj4IGx9JKqADWoA401V+0Pqlp6+ 09rUXyb56sy/fF+E0NK6q7MxGH3eTzc/tVjgY3e7adn4HEL4T3XT7Uz6bxuaksyfj5MK NWlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-transfer-encoding :content-id:mime-version:subject:cc:to:references:in-reply-to:from :organization:dkim-signature; bh=cRTKIps5e2RvIdzVyJjgI0cG9YCwq1ahnGCNR3vJoyY=; fh=5uFZxSwCnASVdYxTU8tHsNdxuXn6/rzobCC/EhWaWp4=; b=FW62+mum9B0up5J/hUv+iqxBSPRB8zpiM2gasHv8SaCeE8C//V0ezkQK6IOGn+qZS+ nTiXc3x2GjQde4UiIkx2uLi7CAEyHHs4oDFCSr1YkYTqYmoNKoeVzb+pF9Fb/VmUQkN/ A3r/Py7aFeLtN9Kd6Sn3GtkeRcQ0CKZUtCFiG72suyTgZIEvAypD5VWfseSPjvB0hvP8 Q18wwrQZyZSSLGAai0zowjkWp5DxZ7TJp0rlgFtQBitGUaZg+tKrhICCylYlWUa7y+wz 9BAOeyxFUwVY5q4zpVqGPlMNO4/ZxdNxykEW4VUz7BTzfur6zrom7Qp7ZhoyQo5uOzhR Lv7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gyDUWc41; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jy16-20020a17090342d000b001b89f653005si1873301plb.394.2023.08.04.08.47.25; Fri, 04 Aug 2023 08:47:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gyDUWc41; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232099AbjHDPXk (ORCPT + 99 others); Fri, 4 Aug 2023 11:23:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbjHDPXU (ORCPT ); Fri, 4 Aug 2023 11:23:20 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7983949C3 for ; Fri, 4 Aug 2023 08:22:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691162555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cRTKIps5e2RvIdzVyJjgI0cG9YCwq1ahnGCNR3vJoyY=; b=gyDUWc41rqRD8pQe+9Y8Q2HuSIu+i93nfcfs/EmcyKSjPQK8jAjcA+3Xw5FElwG/to9/o/ QVqEMSWubhOziX4xa0J49ez+EKo9pKqjg7ZR26xsOulo8pc8/xvgLkZnrILhfmnaAA48kz PV3DvvtAArJDUSaZ9NPVgcg+Upl1TOs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-294-KRoTGT2sO_Ka4gD5uqoLZg-1; Fri, 04 Aug 2023 11:22:31 -0400 X-MC-Unique: KRoTGT2sO_Ka4gD5uqoLZg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7DDB483FC20; Fri, 4 Aug 2023 15:22:30 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id 701101121325; Fri, 4 Aug 2023 15:22:28 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <2678222.1691162178@warthog.procyon.org.uk> References: <2678222.1691162178@warthog.procyon.org.uk> <20230802-master-v6-1-45d48299168b@kernel.org> To: Paul Moore Cc: dhowells@redhat.com, Jeff Layton , Alexander Viro , Christian Brauner , Trond Myklebust , Anna Schumaker , James Morris , "Serge E. Hallyn" , Stephen Smalley , Eric Paris , Casey Schaufler , Scott Mayhew , Stephen Smalley , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-security-module@vger.kernel.org, selinux@vger.kernel.org Subject: Re: [PATCH v6] vfs, security: Fix automount superblock LSM init problem, preventing NFS sb sharing MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2680107.1691162547.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Aug 2023 16:22:27 +0100 Message-ID: <2680108.1691162547@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org David Howells wrote: > IIRC, the issue is when you make a mount with an explicit context=3D set= ting and > make another mount from some way down the export tree that doesn't have = an > explicit setting, e.g.: > = > mount carina:/ /mnt -o context=3Dsystem_u:object_r:root_t:s0 > mount carina:/nfs/scratch /mnt2 > = > and then cause an automount to walk from one to the other: > = > stat /mnt/nfs/scratch/foo Actually, the order there isn't quite right. The problem is with this ord= er: # mount carina:/ /mnt -o context=3Dsystem_u:object_r:root_t:s0 # stat /mnt/nfs/scratch/bus File: /mnt/nfs/scratch/bus Size: 124160 Blocks: 248 IO Block: 1048576 regular file Device: 0,55 Inode: 131 Links: 1 ... # mount carina:/nfs/scratch /mnt2 mount.nfs: /mnt2 is busy or already mounted or sharecache fail with the error: SELinux: mount invalid. Same superblock, different security settings for= (dev 0:52, type nfs4) David