From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jack Stone Subject: Re: [AppArmor 39/45] AppArmor: Profile loading and manipulation, pathname matching Date: Thu, 14 Jun 2007 20:16:13 +0100 Message-ID: <467193FD.3010803@hawkeye.stone.uk.eu.org> References: <20070514110607.549397248@suse.de> <200706042303.28785.agruen@suse.de> <1181136386.3699.70.camel@moss-spartans.epoch.ncsc.mil> <200706090003.57722.agruen@suse.de> <20070609001703.GA17644@kroah.com> <20070610083427.GA24808@elf.ucw.cz> <20070610210547.GC25138@elf.ucw.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: greg@kroah.com, agruen@suse.de, sds@tycho.nsa.gov, jjohansen@suse.de, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, pavel@ucw.cz To: david@lang.hm Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org david@lang.hm wrote: > On Sun, 10 Jun 2007, Pavel Machek wrote: >> But you have that regex in _user_ space, in a place where policy >> is loaded into kernel. > > then the kernel is going to have to call out to userspace every time a > file is created or renamed and the policy is going to be enforced > incorrectly until userspace finished labeling/relabeling whatever is > moved. building this sort of race condigion for security into the kernel > is highly questionable at best. > >> AA has regex parser in _kernel_ space, which is very wrong. > > see Linus' rants about why it's not automaticaly the best thing to move > functionality into userspace. > > remember that the files covered by an AA policy can change as files are > renamed. this isn't the case with SELinux so it doesn't have this sort > of problem. How about using the inotify interface on / to watch for file changes and updating the SELinux policies on the fly. This could be done from a userspace daemon and should require minimal SELinux changes. The only possible problems I can see are the (hopefully) small gap between the file change and updating the policy and the performance problems of watching the whole system for changes. Just my $0.02. Jack