kernel warning
While compiling the kernel, 2.4.19, with the latest lsm-SE Linux patches from Russell (I am not sure how to double check this; but it is POLICYDB_VERSION 12), I happened to glance at my screen when this was displayed:
gcc -D__KERNEL__ -I/home/bam/tmp/woody/selinux/kernel-image/kernel-image-2.4.19-i386-2.4.19/build-k6/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=k6 -Iinclude -nostdinc -I /usr/lib/gcc-lib/i386-linux/2.95.4/include -DKBUILD_BASENAME=hooks -c -o hooks.o hooks.c
hooks.c:66: warning: #warning "SELinux: The separate SELinux kernel patch has not been applied. Using SELinux without this patch is not recommended."
Looking at the code I see:
#ifndef _SELINUX_KERNEL_PATCH_
#warning "SELinux: The separate SELinux kernel patch has not been applied. Using SELinux without this patch is not recommended." #endif
Further down I see:
#ifdef _SELINUX_KERNEL_PATCH_
[...]
#else
printk(KERN_WARNING "SELinux: The separate SELinux kernel patch was not applied. Using SELinux without this patch is not recommended.\n");[...]
#endif
However, _SELINUX_KERNEL_PATCH_ is only used, and never defined, in this file.
I have also checked this against Russell's patch, it appears to be the same.
Have I made a mistake somewhere in patching the kernel, or maybe this code is obsolete? Or perhaps Russell's patch is not intended to be used standalone anymore but must be used in conjection with another patch?
What is this "seperate kernel patch"?
Signature · 6 lines
Brian May <[email protected]> -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 7 lines · Brian May
While compiling the kernel, 2.4.19, with the latest lsm-SE Linux patches from Russell (I am not sure how to double check this; but it is
POLICYDB_VERSION12), I happened to glance at my screen when this was displayed:gcc -D__KERNEL__ -I/home/bam/tmp/woody/selinux/kernel-image/kernel-image-2.4.19-i386-2.4.19/build-k6/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=k6 -Iinclude -nostdinc -I
/usr/lib/gcc-lib/i386-linux/2.95.4/include-DKBUILD_BASENAME=hooks -c -o hooks.ohooks.c
hooks.c:66: warning: #warning "SELinux: The separate SELinux kernel patch has not been applied. Using SELinux without this patch is not recommended."
<snip>
Quoted 5 lines
Have I made a mistake somewhere in patching the kernel, or maybe this code is obsolete? Or perhaps Russell's patch is not intended to be used standalone anymore but must be used in conjection with another patch?
What is this "seperate kernel patch"?
SELinux has always included a separate SELinux-specific kernel patch to be applied on top of the LSM patch, although the precise purpose of the patch has varied over time. In the current release, the patch is available in the SELinux archive in selinux/module/selinux-2.4.patch or directly from
http://www.nsa.gov/selinux/patches/selinux-2.4-2002102211.patch.gz. In the latest release, the dependence of the SELinux module on this patch has increased due to the elimination of precondition functions. Some of the changes in this patch may find their way back into the mainstream LSM patch in a more general form in the future (they have all been discussed on the LSM mailing list), but some changes are likely to remain SELinux-specific.
As a side note, please be aware that the lsm-2.4 tree and LSM patch that is provided on the NSA SELinux web site is also different from the old 2.4.19-lsm1 snapshot patch from WireX. It is consistent with the head of the LSM BitKeeper tree, so it includes many changes that have been committed since that snapshot patch.
--
Stephen D. Smalley, NAI Labs
[email protected]
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 12 lines · Stephen Smalley
SELinux has always included a separate SELinux-specific kernel patch to be applied on top of the LSM patch, although the precise purpose of the patch has varied over time. In the current release, the patch is available in the SELinux archive in
selinux/module/selinux-2.4.patchor directly from
http://www.nsa.gov/selinux/patches/selinux-2.4-2002102211.patch.gz. In the latest release, the dependence of the SELinux module on this patch has increased due to the elimination of precondition functions. Some of the changes in this patch may find their way back into the mainstream LSM patch in a more general form in the future (they have all been discussed on the LSM mailing list), but some changes are likely to remain SELinux-specific.
Quoted 5 lines
As a side note, please be aware that the lsm-2.4 tree and LSM patch that is provided on the NSA SELinux web site is also different from the old 2.4.19-lsm1 snapshot patch from WireX. It is consistent with the head of the LSM BitKeeper tree, so it includes many changes that have been committed since that snapshot patch.
Russell,
Do you have any plans to include this patch, which currently appears to be missing into your Debian package kernel-patch-2.4-lsm?
When I next get the chance I will patch my kernel source image available online my website with this extra patch.
--
Brian May <[email protected]>
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 5 lines · Brian May
Do you have any plans to include this patch, which currently appears to be missing into your Debian package kernel-patch-2.4-lsm?
When I next get the chance I will patch my kernel source image available online my website with this extra patch.
Yes, I'll do it now.
Signature · 10 lines
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 11 lines · Stephen Smalley
SELinux has always included a separate SELinux-specific kernel patch to be applied on top of the LSM patch, although the precise purpose of the patch has varied over time. In the current release, the patch is available in the SELinux archive in
selinux/module/selinux-2.4.patchor directly from
http://www.nsa.gov/selinux/patches/selinux-2.4-2002102211.patch.gz. In the latest release, the dependence of the SELinux module on this patch has increased due to the elimination of precondition functions. Some of the changes in this patch may find their way back into the mainstream LSM patch in a more general form in the future (they have all been discussed on the LSM mailing list), but some changes are likely to remain SELinux-specific.
It appears that with this patch, it is no longer possible to compile the patched kernel without SE-LINUX support.
Maybe the call to selinux_init() in main.c needs to be wrapped with #ifdef CONFIG_SECURITY_SELINUX?
Signature · 6 lines
Brian May <[email protected]> -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 5 lines · Brian May
It appears that with this patch, it is no longer possible to compile the patched kernel without SE-LINUX support.
Maybe the call to
selinux_init()inmain.cneeds to be wrapped with #ifdefCONFIG_SECURITY_SELINUX?
You would only apply this patch if you intend to use SELinux, so it is implicit that SELinux is going to be enabled. We could #ifdef it, but I'm not sure what the point is. Now, if a generalized form of early initialization is added to the LSM patch, then this would go away and the SELinux-specific code would be hidden.
--
Stephen D. Smalley, NAI Labs
[email protected]
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 11 lines · Stephen Smalley
Quoted 5 lines
It appears that with this patch, it is no longer possible to compile the patched kernel without SE-LINUX support.
Maybe the call to
selinux_init()inmain.cneeds to be wrapped with #ifdefCONFIG_SECURITY_SELINUX?You would only apply this patch if you intend to use SELinux, so it is implicit that SELinux is going to be enabled. We could #ifdef it, but I'm not sure what the point is. Now, if a generalized form of early initialization is added to the LSM patch, then this would go away and the SELinux-specific code would be hidden.
This means that I can't produce a single kernel-patch package that can be used by SE Linux, LIDS, and DTE users...
Signature · 10 lines
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 2 lines · Russell Coker
This means that I can't produce a single kernel-patch package that can be used by SE Linux, LIDS, and DTE users...
That isn't new; in prior releases, the SELinux-specific patch set the SELinux option defaults in defconfig and set EXTRAVERSION to -selinux in the top-level Makefile, so it wasn't appropriate for LIDS or DTE users anyway. [Are LIDS users now using the LSM kernel patch package, or are they still using the separate LIDS package? Are there any DTE users?] For the separate SELinux patch to work for LIDS and DTE users, you would need to drop those changes as well as #ifdef the initialization call. You would also need to add stub hook functions for inode_init to the LIDS and DTE modules.
--
Stephen D. Smalley, NAI Labs
[email protected]
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 4 lines · Stephen Smalley
For the separate SELinux patch to work for LIDS and DTE users, you would need to drop those changes as well as #ifdef the initialization call. You would also need to add stub hook functions for
inode_initto the LIDS and DTE modules.
What parts of the seperate SELinux patch would break LIDS and DTE users? --
Brian May <[email protected]>
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 7 lines · Brian May
Quoted 4 lines · Stephen Smalley
For the separate SELinux patch to work for LIDS and DTE users, you would need to drop those changes as well as #ifdef the initialization call. You would also need to add stub hook functions for
inode_initto the LIDS and DTE modules.What parts of the seperate SELinux patch would break LIDS and DTE users?
As I said, you would need to drop the Makefile and defconfig diffs entirely, wrap the init/main.c diff with an #ifdef, and add inode_init stub hook functions to LIDS and DTE. I don't plan on dropping the Makefile and defconfig diffs from our patch, but I'm willing to fix up the other issues in our patch.
--
Stephen D. Smalley, NAI Labs
[email protected]
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 7 lines · Brian May
Quoted 4 lines · Stephen Smalley
For the separate SELinux patch to work for LIDS and DTE users, you would need to drop those changes as well as #ifdef the initialization call. You would also need to add stub hook functions for
inode_initto the LIDS and DTE modules.What parts of the seperate SELinux patch would break LIDS and DTE users?
I'm not sure. It was my understanding of the conversation between you and Steve that some parts of SE Linux will be unconditionally enabled if you apply the second patch. So in my latest kernel patch package I put a bunch of extra #ifdef's in...
Signature · 10 lines
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 4 lines · Russell Coker
I'm not sure. It was my understanding of the conversation between you and Steve that some parts of SE Linux will be unconditionally enabled if you apply the second patch. So in my latest kernel patch package I put a bunch of extra #ifdef's in...
Yes, this works. An alternative to #ifdef'ing the inode_init hook is to simply add trivial stub foo_inode_init hook functions to the DTE and LIDS modules, like the other hooks that are not truly used by those modules.
--
Stephen D. Smalley, NAI Labs
[email protected]
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 2 lines · Stephen Smalley
You would only apply this patch if you intend to use SELinux, so it is implicit that SELinux is going to be enabled. We could #ifdef it, but I'm
I find it considerably easier to maintain my kernel sources, if I only need to maintain one kernel source tree for all systems.
This means I don't have the situation in several months time "I have to compile this 3rd party closed source driver[1], but I can't remember how I created the original kernel source." (This did happen to me recently too, I thought I had the kernel tree safe, but I must have accidently modified it somehow...) In comparision, keeping track of the config files is very easy, Debian kernel packages do this automatically.
So I use the same kernel source now for all my systems. It has been patched with not only SE-Linux, but also ISDN DOV[2], ISDN Voice, and Freeswan. Sometime in the future I may also investigate adding the EVMS patch (assuming it doesn't conflict in any way with any of the other patches).
This doesn't mean that I want to use all of these features on all systems (for instance I am not ready to install SE-Linux on all my systems just yet), it just makes it easier to maintain.
So for now, I have patched my kernel source to make that init call optional.
Another option I might consider is creating a extremely simply policy, maybe with only one domain and give that domain access to everything. That way I can install SE-Linux kernels on computers where I am not yet ready to install a full blown SE-Linux policy, but at the same time not flood the console with lots of warnings, or risk DOS attacks.
Notes:
[1] Unfortunately, sometimes as much as we all hate to use closed source drivers, it is the only choice, for instance with a certain brand (or maybe even any brand) of satellite cards.
[2] The DOV patch will be obsolete as of 2.4.20, it has been intergrated into the main kernel.
--
Brian May <[email protected]>
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
The 'Everything in one Part' download at
http://www.nsa.gov/selinux/archives/lsm-2.4-selinux-2002102211.tgz doesn't seem to have this patch included, and the NSA site isn't very clear that the patch is required. Could we please have the patch added to the next all-in-one snapshot?
Kerry
Quoted 14 lines · Stephen Smalley
SELinux has always included a separate SELinux-specific kernel patch to be applied on top of the LSM patch, although the precise purpose of the patch has varied over time. In the current release, the patch is available in the SELinux archive in
selinux/module/selinux-2.4.patchor directly from
http://www.nsa.gov/selinux/patches/selinux-2.4-2002102211.patch.gz. In the latest release, the dependence of the SELinux module on this patch has increased due to the elimination of precondition functions. Some of the changes in this patch may find their way back into the mainstream LSM patch in a more general form in the future (they have all been discussed on the LSM mailing list), but some changes are likely to remain
SELinux-specific.
Signature · 11 lines
Kerry Thompson, CCNA CISSP Information Systems Security Consultant http://www.crypt.gen.nz [email protected] -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 5 lines · Kerry Thompson
The 'Everything in one Part' download at
http://www.nsa.gov/selinux/archives/lsm-2.4-selinux-2002102211.tgz doesn't seem to have this patch included, and the NSA site isn't very clear that the patch is required. Could we please have the patch added to the next all-in-one snapshot?
The separate SELinux-specific patch is in that archive. If you expand the archive, you'll find it in selinux/module/selinux-2.4.patch. If you follow the installation instructions in selinux/README, that patch will be applied to the lsm-2.4 tree prior to building the kernel. The only change from the prior release with regard to this issue was that the patch file was renamed from lsm-2.4.patch to selinux-2.4.patch for clarity and the set of changes within the patch have increased.
--
Stephen D. Smalley, NAI Labs
[email protected]
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.