On Wed, Oct 18, 2023 at 12:35 AM Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote: > > 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... All tests passed for me using the defconfig fragment from the selinux-testsuite.