Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5352897imu; Tue, 29 Jan 2019 18:01:14 -0800 (PST) X-Google-Smtp-Source: ALg8bN4JP9S5+XfCSNgt1nYvUgIVz4qpsXJEgwQnryuaJVQj00bP/sarl/KjdrbUg5i0NtKUdFVU X-Received: by 2002:a62:1b50:: with SMTP id b77mr28784406pfb.36.1548813674268; Tue, 29 Jan 2019 18:01:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548813674; cv=none; d=google.com; s=arc-20160816; b=IwDWxhwkwvkVIGnCZ2JBVq9S5m/4SSh6d5nbkFOEJcWMfdSrnrqO5mhQLF0z/VPtlc U0+R/9N9Y031A1gSp2uE0flmVwyxfg4GLn/28YY+AjKR5xMZBTSpC92itLBNPbbq57oB QHyQi7qs3IZHOAIcvICSSkvakzQGSUlHXtYEsNqVctiNta1tvKInyfI/fjrNxYJLGko4 K36KelCN1CtGe6rzJpvK23iVRQ6vEQmqpu3ALuV86SwpYI0Nm9KgtBEDZSMPuY+fue3+ Oqz5sUrWEjnVy13xoukQNtRdDbD0ShyF5RcLZnyuassFcj03C2w6i3bZcK7cBl6Z3ONJ fdzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:mime-version:user-agent :message-id:in-reply-to:date:references:cc:to:from; bh=jT/HCNCzgp9X26BwqXigbEGF9hOGLj3JVQwIZvYePLc=; b=PwY5Fa9xLhfXvLTLvOlY5jWbbK3akRqBMaWnU8LxoFKKbZmmTd/bi/sbSkVnSu3SXN TMXUSN9FiF//l8/AtxEmEZ0PfVFDCqCf5mHaAh5BlUV0Dqq+nu1VMx/nj+SlM0/SQsoY QAZnGkz2lkDmy2HdA/paAoWQwhONeMuTr591Pvj9sqsZ8wWnX9fOhr4psqZly2tK56qj TAxsOgj8RHPZ4kAqR/Ke7clCANsCEQsPx2Aew26EKabN50bwdsg4HaydUGaPe4JMNCud TDMcJGo2UbU/hP5iibRHNJqQ26JuiTg9U99H6O7G0Av+WnFBMsn+mDE6DVUoBbTMrKnC Q+Cw== 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=xmission.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m19si122252pls.437.2019.01.29.18.00.58; Tue, 29 Jan 2019 18:01:14 -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=xmission.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729728AbfA3CAv (ORCPT + 99 others); Tue, 29 Jan 2019 21:00:51 -0500 Received: from out01.mta.xmission.com ([166.70.13.231]:36935 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727729AbfA3CAv (ORCPT ); Tue, 29 Jan 2019 21:00:51 -0500 X-Greylist: delayed 2248 seconds by postgrey-1.27 at vger.kernel.org; Tue, 29 Jan 2019 21:00:50 EST Received: from in01.mta.xmission.com ([166.70.13.51]) by out01.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1goeb2-0008LQ-Py; Tue, 29 Jan 2019 18:23:20 -0700 Received: from ip68-227-174-240.om.om.cox.net ([68.227.174.240] helo=x220.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1goeb2-0002hM-6D; Tue, 29 Jan 2019 18:23:20 -0700 From: ebiederm@xmission.com (Eric W. Biederman) To: Casey Schaufler Cc: linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Al Viro , David Howells , Miklos Szeredi , Linus Torvalds , Karel Zak , util-linux@vger.kernel.org, Andy Lutomirski , LSM References: <87va2716mh.fsf@xmission.com> <03e0993b-21db-1cc4-7a33-0236de7be20d@schaufler-ca.com> <87r2cvx7wz.fsf@xmission.com> Date: Tue, 29 Jan 2019 19:23:12 -0600 In-Reply-To: <87r2cvx7wz.fsf@xmission.com> (Eric W. Biederman's message of "Tue, 29 Jan 2019 19:15:24 -0600") Message-ID: <87ef8vx7jz.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1goeb2-0002hM-6D;;;mid=<87ef8vx7jz.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=68.227.174.240;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+h0u/hM65+5LW6450Qd/ruXX6rx6yJOAg= X-SA-Exim-Connect-IP: 68.227.174.240 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on sa07.xmission.com X-Spam-Level: X-Spam-Status: No, score=-0.2 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,T_TM2_M_HEADER_IN_MSG autolearn=disabled version=3.4.2 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa07 1397; Body=1 Fuz1=1 Fuz2=1] X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Casey Schaufler X-Spam-Relay-Country: X-Spam-Timing: total 315 ms - load_scoreonly_sql: 0.05 (0.0%), signal_user_changed: 3.6 (1.1%), b_tie_ro: 2.6 (0.8%), parse: 0.85 (0.3%), extract_message_metadata: 15 (4.6%), get_uri_detail_list: 1.36 (0.4%), tests_pri_-1000: 18 (5.8%), tests_pri_-950: 1.33 (0.4%), tests_pri_-900: 1.10 (0.3%), tests_pri_-90: 21 (6.7%), check_bayes: 20 (6.3%), b_tokenize: 6 (2.0%), b_tok_get_all: 6 (2.0%), b_comp_prob: 2.2 (0.7%), b_tok_touch_all: 2.7 (0.9%), b_finish: 0.69 (0.2%), tests_pri_0: 241 (76.5%), check_dkim_signature: 0.55 (0.2%), check_dkim_adsp: 2.8 (0.9%), poll_dns_idle: 0.03 (0.0%), tests_pri_10: 3.1 (1.0%), tests_pri_500: 7 (2.3%), rewrite_mail: 0.00 (0.0%) Subject: Re: [RFD] A mount api that notices previous mounts X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ebiederm@xmission.com (Eric W. Biederman) writes: > Casey Schaufler writes: >> Are you taking the LSM specific mount options into account? > > In the design yes, and I allow setting them. It appears in the code > to retrieve the mount options I forgot to call security_sb_show_options. > > For finding the super block that you are going to mount the LSM mount > options are not relevant. Even nfs will not want to set those early as > they do not help determine the nfs super block. So the only place where > there is anything interesting in my api is in reading back the security > options so they can be compared to the options the mounter is setting. > > I will add the missing call to security_sb_show_options which is enough > to fix selinux. Unfortunately smack does not currently implement > .sb_show_options. Not implementing smack_sb_show_options means > /proc/mounts fails to match /etc/mtab which is a bug and it is likely > a real workd bug for the people who use smack and don't want to depend > on /etc/mtab, or are transitioning away from it. > > Casey do you want to implement smack_sb_show_options or should I put it > on my todo list? Oh. I should add that I am always parsing the LSM mount options out so that there is not a chance of the individual filesystems implementing comflicting options even when there are no LSMs active. Without that I am afraid we run the risk of having LSM mount otions in conflict with ordinary filesystems options at some point and by the time we discover it it would start introducing filesystem regressions. That does help with stack though as there is no fundamental reason only one LSM could process mount options. Eric