Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1251069pxb; Sat, 29 Jan 2022 00:14:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJwE27a87rFeK9XNgUSUpeMsTEjfU+myxe5Sloin0ajmCwQCJDDiQmOENWxOQ/LOxueeDUw2 X-Received: by 2002:a17:906:4793:: with SMTP id cw19mr4236442ejc.100.1643444087864; Sat, 29 Jan 2022 00:14:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643444087; cv=none; d=google.com; s=arc-20160816; b=Aae6SUEcwHh51iw59vP4m4iVJi9ocSyE79JPuHU3Yoc+PruFjMzykYA9fX66ddu1r3 jpfKXNpfh1I8hZdNc14S/MnOBJB+JFvbo0/1h2Olpg/VycxBrbe9XYWN7B4kLpe2esQ5 kv8Cp2WLHmoTsMbzjJTfRZHLMbJKjfm5NjdOMiULjCvMzZ2S+xRsxT/cvGZHlIgpT+U1 idwioVvkaYxAU7FmUmSBRhIRoiQiWhF682rxLRdkVxcbnLwvT9yKy9wVnUqd/LUqHSpN QbOaDvAPl+3QqPtbEBIdR/M1nC2zSd5e5wPAQPQJ/g/xVO5Fx/E5pBoOAj95SchuZkyb eLDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=TIM/9YxONk8z0lexlFGrsOXlsM+mXoPlWV7GxMGCHPU=; b=b9buyW54PEo+PDLqdH2ONATwGIvP6Qix3HkPd0zqHKw5Qja/FKT/sREgn34CFX+44q qB7508ys1dNZvLzLVzQomvnUeGodacV3vyRppGwHy5gXg2z/irJ0y+E6eciV+yFVAsbM kVNHzztrhhk19KrGEn8wZtDQKDwG27DoMHxMoFZ2uKbETmLlNanPCIqxTSHsc3tqTmug NgC7yQaL9hh8wGzYln9qyv5L04RCMFBjpA94m3TerYBbFK7AWf6ykbqCIBnokNZyRPrt zgDa/0+mjtV79p62N/oksE0XfoDXcy/Aorg13U5KevrgGw5HB/Gr1WBY3/yV0tGKV7yY aoxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20210112.gappssmtp.com header.s=20210112 header.b=mINAVHjX; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h11si190761edq.272.2022.01.29.00.14.23; Sat, 29 Jan 2022 00:14:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore-com.20210112.gappssmtp.com header.s=20210112 header.b=mINAVHjX; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345327AbiA1CZa (ORCPT + 99 others); Thu, 27 Jan 2022 21:25:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345322AbiA1CZa (ORCPT ); Thu, 27 Jan 2022 21:25:30 -0500 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8278BC061747 for ; Thu, 27 Jan 2022 18:25:29 -0800 (PST) Received: by mail-ed1-x530.google.com with SMTP id m11so6724315edi.13 for ; Thu, 27 Jan 2022 18:25:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TIM/9YxONk8z0lexlFGrsOXlsM+mXoPlWV7GxMGCHPU=; b=mINAVHjXaAFiquQLI+M15IWJaVPPEA6dLZ3Zm9VgsWOTI5Pfl5KjdqSgvZGS70G9vY dywxPdd1gcSy9qY+TqvgtEJyZFm755lGxQ7gs1+9z7bIrObl3EVT175ZusPCi2pceHNr XbKd1hQkPit95lQVUqkiZOYC5JatCLaZdAfvbGi5SBanfAbkRoOlT1EU4IV8OZGT0tlz va69LKX7VRAB1tqFPGbg84kwTYMt+g+Tohb1mnBwhuC0rl35gtLxhf4l8EMor/3VzCta QAe6NUmz8BqmmVB/f7DElWtwol3tE7uSmYP7JK+aEZpGteRWHVb2+cgpXGmRe/wRmxxS Z4Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TIM/9YxONk8z0lexlFGrsOXlsM+mXoPlWV7GxMGCHPU=; b=Ac8qZOMGXIDseee53QTgoifpbFLgyRxg6ydlcYmS5AQnzc59jMICSrFkARLB+jxtH+ kzVTU2EINpybnCjJLBE35Ve3dVLRp8ousnGZBINPwplacND131eVY5bPmNgf1B60DIJ7 DXh8+d9KegAmogUN4zoZ7qeUbvKMtbCL3zGkissFe5/JWLtWL/740BlCe31BDF722VGg 2eRkOZLU7lZQKy9a83r0EXEkrki7p0ZFqVlG00zl/onvZn8aeCBMA1XTqa2IbM+TOOuU rdQShLCxCn2q7sBMtj/RHwRFYgpyqGY+Q4zivzKsF8SgywiveBCJN0rTGaFjtH3zrV1n JvOg== X-Gm-Message-State: AOAM530mAM7MHwcT/ISlLwvX2n/31+l//gRSpGrVAMAfvJ806XyksaRj yXiZ9B3xQ9wU61THLf1kU24cs20B5TPKWGvIbPIcXm/H4w== X-Received: by 2002:a50:ef16:: with SMTP id m22mr6093537eds.340.1643336728063; Thu, 27 Jan 2022 18:25:28 -0800 (PST) MIME-Version: 1.0 References: <20220120214948.3637895-1-smayhew@redhat.com> <20220120214948.3637895-2-smayhew@redhat.com> In-Reply-To: From: Paul Moore Date: Thu, 27 Jan 2022 21:25:17 -0500 Message-ID: Subject: Re: [PATCH RFC v2 1/2] selinux: Fix selinux_sb_mnt_opts_compat() To: Ondrej Mosnacek Cc: Scott Mayhew , SElinux list , linux-nfs , Linux kernel mailing list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Thu, Jan 27, 2022 at 4:54 AM Ondrej Mosnacek wrote: > I wonder if we could make this all much simpler by *always* doing the > label parsing in selinux_add_opt() and just returning an error when > !selinux_initialized(&selinux_state). Before the new mount API, mount > options were always passed directly to the mount(2) syscall, so it > wasn't possible to pass any SELinux mount options before the SELinux > policy was loaded. I don't see why we need to jump through hoops here > just to support this pseudo-feature of stashing an unparsed label into > an fs_context before policy is loaded... Userspace should never need > to do that. I could agree with that, although part of my mind is a little nervous about the "userspace should *never* ..." because that always seems to bite us. Although I'm struggling to think of a case where userspace would need to set explicit SELinux mount options without having a policy loaded. -- paul-moore.com