Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3566450rdg; Tue, 17 Oct 2023 21:35:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEqeLNR/n8HOCnxEf7BndbfQyOsoSyNVWONiuOLeHWpZm9GEB11R4z8LV+MnqKiKBPex1d8 X-Received: by 2002:a0d:ca8d:0:b0:583:b186:d817 with SMTP id m135-20020a0dca8d000000b00583b186d817mr4069536ywd.27.1697603745826; Tue, 17 Oct 2023 21:35:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697603745; cv=none; d=google.com; s=arc-20160816; b=h1YdWIACwp+4gKvmLAb/RaXcIU7aKGcRSyjH5GKicwjOAcjsJkUD7szqTUFFJoTuKr UuZZJZx9ginRFHuldsZVrBOIh91TM/3tdFiBjHDVbV6mrL9ApCX3UjrTAcjlF2oqUQJd 4D11O/ukoNt2laJeYzxK377eAGfgCRmthdqraP7zbYpldJeviSzzs9FEqGfY17M87v0h 1pNyM/IOh+eVKCrEyLLylid2bDgqHeTiXYY026SWbx6Fa9TFPQzbXf12FY1Gv5JiqiY4 ueq/GspAZCgvuV1ndXOhyZ6/J+EHe0QaWVAnhrGnsGCgqIRb7xSyMPUimEdVWcNlTZyP WGSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=qYQT9+blz7r7f5JPqtYLXwbpV6EPD3GUZ3EjmsXbKr0=; fh=x0Qm+QgvAeVyM7fmOg2FazsWEQikjXOU5lW+aqVdVMA=; b=HBEt8j6mvzD+GRG2GD1ygw0liaXsbmoYixvcPljggjmx6SNJ+j2umQf3r8S3PSbPtO GHwxdkzyHa+daSRzri5iBG9g4xWRvtt6Nxnus+a2HMVFrWdxRo2QrJjt/eDDZxCx4cwJ Z2C4nWM5EDexjPhylOjSJmkxx4+y9u8EOegSWqgNrgPrWgjxiLH1cK7pcRv5q0Ztc2jS IkDef5TxqoxmlQ1heCdfj0dafcWxaEFn3hfdH0d0EPeUnHm69I8q5GYp7xJSYVV2Aox8 NEmZaZCb3+AMwwe0yFBiyPnkB0GvxlbmWYyZ3zmqLONQD/F54oaGxB/WOjmpGfIXzQya TMiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=BHILHLNI; spf=pass (google.com: domain of selinux-refpolicy-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id pg6-20020a17090b1e0600b0027b0a89978csi750244pjb.166.2023.10.17.21.35.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 21:35:45 -0700 (PDT) Received-SPF: pass (google.com: domain of selinux-refpolicy-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=BHILHLNI; spf=pass (google.com: domain of selinux-refpolicy-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id EFEE8803EE22; Tue, 17 Oct 2023 21:35:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229479AbjJREfk (ORCPT + 22 others); Wed, 18 Oct 2023 00:35:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjJREfk (ORCPT ); Wed, 18 Oct 2023 00:35:40 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84BF593; Tue, 17 Oct 2023 21:35:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=qYQT9+blz7r7f5JPqtYLXwbpV6EPD3GUZ3EjmsXbKr0=; b=BHILHLNI4vlnIbUp1qdqp+gwBq RYR+gdFhNYfYF9HSxQD9uP9qUL1TxJFiZCOc1r42fzA9NtouTMvbAXBhfUime6+Tg/bIdRSDw8zcx tT+oRCGOrD4SbziL5UxgPqnfaJQaBCk3rQOU0aVMJPdkIe+xBZ+6nQp2vhkfKIrCkKO2o9VqxR8+q KH1zdHrI4nzG/kZKrED31sgdUh5Zl6EnvqptE15HIF8KGVB2AQbbVDlCUp0LRodE77LsuKZUutx6Z 6Zf2S5rvSf+kYwXFE/fmdZmaQBpBHRVl4vf5D3aOK8awlLulEncOH1QcByq2YmSxJtC7zVGfu9NuT oVLyhhTA==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1qsyHM-002Fgi-2i; Wed, 18 Oct 2023 04:35:33 +0000 Date: Wed, 18 Oct 2023 05:35:32 +0100 From: Al Viro To: Paul Moore Cc: selinux@vger.kernel.org, linux-fsdevel@vger.kernel.org, Linus Torvalds , Christian Brauner , selinux-refpolicy@vger.kernel.org Subject: Re: [PATCH][RFC] selinuxfs: saner handling of policy reloads Message-ID: <20231018043532.GS800259@ZenIV> References: <20231016220835.GH800259@ZenIV> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 17 Oct 2023 21:35:41 -0700 (PDT) On Tue, Oct 17, 2023 at 04:28:53PM -0400, Paul Moore wrote: > Thanks Al. > > Giving this a very quick look, I like the code simplifications that > come out of this change and I'll trust you on the idea that this > approach is better from a VFS perspective. > > While the reject_all() permission hammer is good, I do want to make > sure we are covered from a file labeling perspective; even though the > DAC/reject_all() check hits first and avoids the LSM inode permission > hook, we still want to make sure the files are labeled properly. It > looks like given the current SELinux Reference Policy this shouldn't > be a problem, it will be labeled like most everything else in > selinuxfs via genfscon (SELinux policy construct). I expect those > with custom SELinux policies will have something similar in place with > a sane default that would cover the /sys/fs/selinux/.swapover > directory but I did add the selinux-refpol list to the CC line just in > case I'm being dumb and forgetting something important with respect to > policy. > > The next step is to actually boot up a kernel with this patch and make > sure it doesn't break anything. Simply booting up a SELinux system > and running 'load_policy' a handful of times should exercise the > policy (re)load path, and if you want a (relatively) simple SELinux > test suite you can find one here: > > * https://github.com/SELinuxProject/selinux-testsuite > > The README.md should have the instructions necessary to get it > running. If you can't do that, and no one else on the mailing list is > able to test this out, I'll give it a go but expect it to take a while > as I'm currently swamped with reviews and other stuff. It does survive repeated load_policy (as well as semodule -d/semodule -e, with expected effect on /booleans, AFAICS). As for the testsuite... No regressions compared to clean -rc5, but then there are (identical) failures on both - "Failed 8/76 test programs. 88/1046 subtests failed." Incomplete defconfig, at a guess...