Skip to contentSkip to conversation

installing rh9 latest

PATCH jason anderssen 2 participants 2 messages Sep 10, 2003 – Sep 11, 2003 SELinux security module

lore
Share & tools
lore
#0 lore raw

Hi all,

I have decided to upgrade my old selinux to the latest. So I went with RH9.0 and downloaded the latest and greatest off of nsa.gov.

However, I am a little new to the initrd style of booting, and I have concerns with step 7 which is as follows:

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

7) Create an initrd with load_policy, the binary policy file, and a /linuxrc that will perform the initial policy load prior to mounting the root filesystem. For example, you might modify your mkinitrd script in a similar manner to this patch for the RH9 mkinitrd script:

sbin/mkinitrd 2003-08-05 08:45:46.000000000 -0400 renamed from sbin/mkinitrd- 2003-02-18 12:41:17.000000000 -0500 +4 -0
@@ -517,6 +517,12 @@
 inst /sbin/insmod.static "$MNTIMAGE/bin/insmod"
 ln -s /sbin/nash $MNTIMAGE/sbin/modprobe
 
+# Binary policy file and load_policy utility for loading it.
+mkdir -p $MNTIMAGE/selinux
+mkdir -p $MNTIMAGE/etc/security/selinux
+inst /etc/security/selinux/policy.15 

"$MNTIMAGE/etc/security/selinux/policy.15"
+inst /usr/sbin/load_policy "$MNTIMAGE/bin/load_policy" +
for MODULE in $MODULES; do
cp $verbose -a /lib/modules/$kernel/$MODULE $MNTIMAGE/lib
done
@@ -570,6 +576,11 @@
fi
done

+echo "echo Loading policy" >> $RCFILE
+echo "mount -t selinuxfs none /selinux" >> $RCFILE +echo "/bin/load_policy /etc/security/selinux/policy.15" >> $RCFILE +echo "umount /selinux" >> $RCFILE
+
echo "echo Mounting /proc filesystem" >> $RCFILE
echo "mount -t proc /proc /proc" >> $RCFILE

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

I find it a little confusing in the instructions, but all I think I need to understand is the following:

In the mkinitrd script supplied, which is the same as above, why does load_policy have two different paths, ie: /usr/sbin/load_policy > "$MNTIMAGE/bin/load_policy"?

what is a linuxrc?

Does anyone care to eleborate this step a bit more for me, this I would very much appreciates.

Anyways, to cut a long story short, I stuffed my installation, so re-installation has begun.

Cheers
Jason
Vasco Data Security
Brisbane Australia

--
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 23 lines · jason anderssen
sbin/mkinitrd 2003-08-05 08:45:46.000000000 -0400 renamed from sbin/mkinitrd- 2003-02-18 12:41:17.000000000 -0500 +4 -0
+# Binary policy file and load_policy utility for loading it.
+mkdir -p $MNTIMAGE/selinux
+mkdir -p $MNTIMAGE/etc/security/selinux
+inst /etc/security/selinux/policy.15

"$MNTIMAGE/etc/security/selinux/policy.15"

(quoted diff) +7 -0
+inst /usr/sbin/load_policy "$MNTIMAGE/bin/load_policy"
+
 for MODULE in $MODULES; do
     cp $verbose -a /lib/modules/$kernel/$MODULE $MNTIMAGE/lib
 done
@@ -570,6 +576,11 @@
     fi
 done
 
+echo "echo Loading policy" >> $RCFILE
+echo "mount -t selinuxfs none /selinux" >> $RCFILE
+echo "/bin/load_policy /etc/security/selinux/policy.15" >> $RCFILE
+echo "umount /selinux" >> $RCFILE
+
 

I find it a little confusing in the instructions, but all I think I need to understand is the following:

Quoted 3 lines

In the mkinitrd script supplied, which is the same as above, why does load_policy have two different paths, ie: /usr/sbin/load_policy > "$MNTIMAGE/bin/load_policy"?

$MNTIMAGE is the temporary directory used for creating the initrd. On Red Hat an initrd is in ext2 format, so a loopback mount is made of an Ext2 file system and the files are copied under it. So the files are copied to $MNTIMAGE (the ext2 file system) and then when the system is booted that file system is (temporarily) the root file system. As for /usr/sbin vs /bin, on an initrd you don't want to have lots of directories etc.

The decision to put load_policy under /usr for the main file system should probably be revised however, if you don't use an initrd (not recommended) then you need to run load_policy before running init.

Quoted 1 line

what is a linuxrc?

It's the script that the kernel runs after mounting the initrd.

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.