Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp844685imu; Tue, 20 Nov 2018 07:49:41 -0800 (PST) X-Google-Smtp-Source: AJdET5fnM9G5122eV6U1EE7vKswL9ELgdWc002U8HlnxHGTvzc86w6flAeFZVPEhzHHsJrgdkIKr X-Received: by 2002:a62:35c2:: with SMTP id c185-v6mr2748202pfa.82.1542728981087; Tue, 20 Nov 2018 07:49:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542728981; cv=none; d=google.com; s=arc-20160816; b=t3xapDNFmmH03/pzPPrEq42MvEGllaEemsy3fOv9kKHxvgfZU2sbvV2PkbtLYm0XgW kJnOvyxOGZWVnMqp+WbvdeaSXhPqxyZBx0zGMXqZfGFEBkyIr3NEVMpxgZtsaIr6be5B 45lqzLZM6G4V41YRWnb5XNGYsVVNzmrf54nwKXSpDKI/HJU4msfDPdsQNoUArhba8fyf KuniQWLmtN3oIKYy9PEsGLRjGxxMAke852zYuFmYQDbXWjnjCoZ9vjAHcFkLw5T4UI6m 5XVzZbnLZI6rrKJ/27qeGMH8XzD5YiMdl+sWud0W/XbA86gaDORQcXM9PPWkhGVrfBnQ S9xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=nOZAofDrET5nugfHFHnLEDcwrmhqefNmJx1R7Fo1+qA=; b=aCZ/a4H5+jJD5W8js7mmUZ2IAT3XWk3DJ36gFiSbQfQOkbJT9Oga3hx9gSJWR0wZmP e7ZD8OS6Q42YEU7jEd3gBMWu6CeCoBr8TO4xmtPoGcHuDt2GOQvcI7j0Jg5/XJHpi1YL W7ZbIA9P5drK19i6fzfNQprBwhchgDZXIlMBXU0AdPMYxAPCXx6Ag4sKvpTwt/dra6zX dpxw8wlQk1zpJl/cdcEFCCfZMpkcH+mWJbLMErkar0gWMaQhw0GKBajRYu3+7q6fPev2 mfROrKo+US1dwKPiU2d4Xgn/+SXlbCSRm5ubNYwhETFqQJKAmwjTaZIrkUBku7YhKmV4 MqRw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cc8-v6si50163014plb.377.2018.11.20.07.49.26; Tue, 20 Nov 2018 07:49:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728202AbeKUCSR (ORCPT + 99 others); Tue, 20 Nov 2018 21:18:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56861 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726123AbeKUCSQ (ORCPT ); Tue, 20 Nov 2018 21:18:16 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C63473086254; Tue, 20 Nov 2018 15:48:29 +0000 (UTC) Received: from madcap2.tricolour.ca (ovpn-112-24.phx2.redhat.com [10.3.112.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6A81060BF6; Tue, 20 Nov 2018 15:48:23 +0000 (UTC) Date: Tue, 20 Nov 2018 10:48:20 -0500 From: Richard Guy Briggs To: Miklos Szeredi Cc: linux-kernel@vger.kernel.org, linux-audit@redhat.com, Al Viro , linux-fsdevel@vger.kernel.org, Steve Grubb , Eric Paris , Paul Moore Subject: Re: [RFC PATCH ghak100 V1 1/2] audit: avoid fcaps on MNT_FORCE Message-ID: <20181120154820.4s6jflcnyu4ha5qn@madcap2.tricolour.ca> References: <218e806e61cd5ae2fd38f9d546f953f86c763b58.1542149969.git.rgb@redhat.com> <20181119225856.dt3l7qzg2ftggon4@madcap2.tricolour.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Tue, 20 Nov 2018 15:48:30 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-11-20 09:17, Miklos Szeredi wrote: > On Mon, Nov 19, 2018 at 11:59 PM Richard Guy Briggs wrote: > > > The simple answer is that the audit PATH record format expects the four > > cap_f* fields to be there and a best effort is being attempted to fill > > in that information in an expected way with meaningful values. Perhaps > > better to accept that it is unreasonable to expect any fcaps on any > > umount operation and simply ignore those fields in the PATH record for > > umount syscall events. > > When there's a mount there are in fact two objects belonging to the > exact same path, each having completely independent metadata: the > mount point and the root of the mount. For example: > > stat /mnt > umount /mnt > stat /mnt > > The first stat will show the root of the mount, the second one will > show the mount point. > Which one is the relevant for audit? It would be the root of the mount, the one that is visible to processes in that mount namespace. Obviously, once that mount has been unmounted, it would be the mount point (no longer in use as such at that point) that is of interest. On mounting, I'm guessing both would be of interest if the fcaps changed for that process-visible path in that mount namespace, so this provides an additional operation that would need recording aside from the case of a simple attribute change. > Not saying audit should be doing getxattr on any of them, just trying > to see more clearly. > > Thanks, > Miklos - RGB -- Richard Guy Briggs Sr. S/W Engineer, Kernel Security, Base Operating Systems Remote, Ottawa, Red Hat Canada IRC: rgb, SunRaycer Voice: +1.647.777.2635, Internal: (81) 32635