Skip to contentSkip to conversation

Moving target -- kernel version.

DISCUSSION Roger Brunell 2 participants 2 messages May 24, 2005 SELinux security module

lore
Share & tools
lore
#0 lore raw
Quoted 29 lines · --- Stephen Smalley
Quoted 10 lines · Roger Brunell

I am starting to feel a rising wave of frustration with producing a reproducible script for installing selinux.

To do the install the kernel must be patched and rebuild. To patch and build the source must be present But which source???
? apt-get kernel-source-2.6.11 (version = 2.6.11-3)
? Distro version is not documented
? Kernel.org patches applied not documented ? Distro patches applied -- not documented

First, you can use a vanilla kernel.org kernel or your favorite distro kernel unchanged, as long it is a 2.6 kernel and SELinux support was enabled in the kernel configuration, since SELinux is in the mainline kernel. For some distro kernels like Debian or SuSE, this means you need to boot with selinux=1 on the kernel commandline because they compiled in SELinux support but set the default to disable at boot time. You only need to patch and build your own kernel if you want the latest SELinux changes and they aren't already included in your kernel. Note that a superset of the SELinux changes from the patch on nsa.gov are included in 2.6.12-rc4, so that is actually more up-to-date with the latest SELinux changes than the 2.6.11-based patch on nsa.gov.

Second, http://www.nsa.gov/selinux/code/download5.cfm clearly states that the SELinux kernel patch available there is relative to the 2.6.11 sources from The Linux Kernel Archives aka kernel.org. It applies cleanly to that kernel.

Quoted 6 lines
Quoted 2 lines

? /nsa/linux-2.6/ is what? Virgin kernel.org sourec ??
nope, it changed since last CVS download a week ago (changes =

2168)

Did you read the nsa/README file? The vendor branch of that tree tracks the official nsa.gov SELinux releases, and interim updates between

?? to selinux ??

Quoted 1 line

releases are committed on the head. Hence, it is presently 2.6.11 with

^^^^^^??
with what patches?

Quoted 1 line

the 2.6.11-selinux1.patch applied plus some subsequent updates to

                                         ------------------????
Quoted 1 line

reflect changes made since the release. I don't believe that it has

                                 ^^ of 2.6.11 or NewSelinux
Quoted 1 line

changed recently; looks like the last update was April 28th.

OK; after posting, I continued to dig. I really want to be sure that any
distro changes aren't removed that the distro depends upon. Along the way, I downloaded the pkg labeled:

       kernel-patch-dedebian.6.11

I open this up and found all the kernel.org patches up through #10 as well as the Debian unique ones. So it looks like the kernel-source-2.6.11 pkg should be good. I confirm that by verifying the first code modification in p10 is in the source:
---------
diff -Naur linux-2.6.11/arch/ia64/kernel/fsys.S linux-2.6.11.10/arch/ia64/kernel/fsys.S
--- linux-2.6.11/arch/ia64/kernel/fsys.S 2005-03-01 23:38:34.000000000
-0800
+++ linux-2.6.11.10/arch/ia64/kernel/fsys.S 2005-05-16 10:50:30.000000000
-0700
@@ -611,8 +611,10 @@
movl r2=ia64_ret_from_syscall
;;
mov rp=r2 // set the real return addr
- tbit.z p8,p0=r3,TIF_SYSCALL_TRACE
+ and r3=_TIF_SYSCALL_TRACEAUDIT,r3

        ;;

-------

And sure enough, my /usr/src/kernel-source-2.6.11/arch/ia64/kernel/fsfsys says

------

    611         movl r2=ia64_ret_from_syscall
    612         ;;
    613         mov rp=r2                               // set the real return
    613 addr
    614         and r3=_TIF_SYSCALL_TRACEAUDIT,r3
    615         ;;

------

But the CVCVS downloaded this morning says:

------

    611         movl r2=ia64_ret_from_syscall
    612         ;;
    613         mov rp=r2                               // set the real return
    613 addr
    614         tbit.z p8,p0=r3,TIF_SYSCALL_TRACE
    615         ;;

-------
I think this means that the sourceforge CVS is less than p10? I haven't
tracked back to what level it is. I now have a better understanding of some of the patching, and how to track them down. It appears the Debian source is keeping up with the Kernel.org plus any distro uniqueisms.

Quoted 4 lines
Quoted 2 lines

Right now I am diffing the /nsa/linux-2.6 and the apt-get kernel source.

Bad idea. That will end up reverting all the patches applied to the

I didn't say unpatching, just looking at the diffs.

Quoted 4 lines

Debian kernel, since nsa/linux-2.6 is just vanilla 2.6.11 plus SELinux changes. Either just use the Debian kernel as is (boot with selinux=1) or try applying the 2.6.11-selinux1.patch to it if you truly need those changes.

^^^^^^^ ^^^^^
I have no idea what "those changes" are, you are speaking of. Do you mean
those found in the SElinux patch on the NSA site may already be in 2.6.11.10 kernel as delivered?
Nope, I just looked at the security.h file included with the distro
(/usr/src/kernel-headers-2.6.11) and the selinux-patch changes are not yet present.
So I still have to apply that patch a do a kernel build.

Quoted 5 lines
Signature · 3 lines
-- 
Stephen Smalley
National Security Agency

Roger Brunell

Infosec Engineer (retired)
"Born 20 years too early"

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

--
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.

#1 lore raw
Quoted 4 lines · Roger Brunell
Quoted 2 lines · --- Stephen Smalley

Did you read the nsa/README file? The vendor branch of that tree tracks the official nsa.gov SELinux releases, and interim updates between

?? to selinux ??

Yes.

Quoted 3 lines
Quoted 1 line

releases are committed on the head. Hence, it is presently 2.6.11 with

^^^^^^??
with what patches?

None, other than what I mentioned below.

Quoted 4 lines
Quoted 1 line

the 2.6.11-selinux1.patch applied plus some subsequent updates to

                                         ------------------????
Quoted 1 line

reflect changes made since the release. I don't believe that it has

                                 ^^ of 2.6.11 or NewSelinux

Updates made to SELinux since 2.6.11-selinux1 was released.

Quoted 2 lines

I think this means that the sourceforge CVS is less than p10? I haven't
tracked back to what level it is.

Linux 2.6.11, no other patches. Patch level 0 if you prefer.

Quoted 4 lines
Quoted 4 lines

Debian kernel, since nsa/linux-2.6 is just vanilla 2.6.11 plus SELinux changes. Either just use the Debian kernel as is (boot with selinux=1) or try applying the 2.6.11-selinux1.patch to it if you truly need those changes.

Quoted 8 lines

^^^^^^^ ^^^^^
I have no idea what "those changes" are, you are speaking of. Do you mean
those found in the SElinux patch on the NSA site may already be in 2.6.11.10 kernel as delivered?
Nope, I just looked at the security.h file included with the distro
(/usr/src/kernel-headers-2.6.11) and the selinux-patch changes are not yet present.
So I still have to apply that patch a do a kernel build.

You don't need to build a kernel at all, unless you truly need the latest bleeding edge development for SELinux. You can just enable SELinux support in the Debian-provided kernel. The mainline kernel includes a working version of SELinux; you only need the patch from the NSA site or the cvs tree from sourceforge if you are doing SELinux development yourself and need to work against the latest code.

Signature · 8 lines
Stephen Smalley
National Security Agency


--
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.