Skip to contentSkip to conversation

Still problems with RedHat8.0

DISCUSSION [email protected] 3 participants 4 messages Nov 19, 2002 – Nov 20, 2002 SELinux security module

lore
Share & tools
lore
#0 lore raw

Hi guys,

I went out in a trip for some days and when I got back I tested your sugestions.
First I run selinux in enforcing mode and couldn't find out which script was trying to write to /etc/passwd. But after booting I tryed a make relabel a got the error message:

avc: denied { read } for pid=666 exe=/usr/local/selinux/bin/checkpolicy path=/usr/src/selinux/policy/Makefile dev=03:05 ino=882701 scontext=root:sysadm_r:checkpolicy_t tcontext=system_u:object_r:src_t tclass=file /usr/local/selinux/bin/setfiles file_contexts/file_contexts mount | awk '/(ext[23]|reiserfs)/{print $3}'
/usr/local/selinux/bin/setfiles: Running on a SELinux kernel, using new system
calls

avc: denied { read } for pid=667 exe=/usr/local/selinux/bin/setfiles path=/usr/src/selinux/policy/file_contexts/file_contexts dev=03:05 ino=883914 scontext=root:sysadm_r:setfiles_t tcontext=system_u:object_r:src_t tclass=file
file_contexts/file_contexts: Permission denied
make: *** [relabel] Error 1

Finally when I run dmesg I got a lot of error messages:
Aren't them too much?
I actually know how correct some errors by granting additional permissions to some domains but I have doubts about doing this or adding new domains and etc... I've already run newrule.pl on dmesg a got many alterations hints. What is the right approach?

avc: denied { write } for pid=109 exe=/bin/rm path=/halt dev=03:05 ino=571 scontext=system_u:system_r:initrc_t tcontext=system_u:object_r:file_t tclass=file

avc: denied { read } for pid=129 exe=/sbin/pam_console_apply path=/dev/video dev=03:05 ino=65803 scontext=system_u:system_r:initrc_t tcontext=system_u:object_r:v4l_device_t tclass=dir

avc: denied { setattr } for pid=129 exe=/sbin/pam_console_apply path=/dev/video0 dev=03:05 ino=40383 scontext=system_u:system_r:initrc_t tcontext=system_u:object_r:v4l_device_t tclass=chr_file

avc: denied { setattr } for pid=129 exe=/sbin/pam_console_apply path=/dev/video1 dev=03:05 ino=40384 scontext=system_u:system_r:initrc_t tcontext=system_u:object_r:v4l_device_t tclass=chr_file

avc: denied { setattr } for pid=129 exe=/sbin/pam_console_apply path=/dev/video1394 dev=03:05 ino=40385 scontext=system_u:system_r:initrc_t tcontext=system_u:object_r:v4l_device_t tclass=chr_file

avc: denied { setattr } for pid=129 exe=/sbin/pam_console_apply path=/dev/video2 dev=03:05 ino=40386 scontext=system_u:system_r:initrc_t tcontext=system_u:object_r:v4l_device_t tclass=chr_file

avc: denied { setattr } for pid=129 exe=/sbin/pam_console_apply path=/dev/video3 dev=03:05 ino=40387 scontext=system_u:system_r:initrc_t tcontext=system_u:object_r:v4l_device_t tclass=chr_file

avc: denied { read } for pid=129 exe=/sbin/pam_console_apply path=/dev/radio dev=03:05 ino=34957 scontext=system_u:system_r:initrc_t tcontext=system_u:object_r:v4l_device_t tclass=lnk_file

avc: denied { setattr } for pid=129 exe=/sbin/pam_console_apply path=/dev/radio0 dev=03:05 ino=34958 scontext=system_u:system_r:initrc_t tcontext=system_u:object_r:v4l_device_t tclass=chr_file

avc: denied { write } for pid=382 exe=/bin/bash path=/etc/passwd dev=03:05 ino=231078 scontext=system_u:system_r:initrc_t tcontext=system_u:object_r:etc_t tclass=file

avc: denied { write } for pid=500 exe=/bin/bash path=/etc/passwd dev=03:05 ino=231078 scontext=system_u:system_r:initrc_t tcontext=system_u:object_r:etc_t tclass=file

avc: denied { write } for pid=577 exe=/bin/rm path=/tmp/.font-unix/fs7100 dev=03:05 ino=180181 scontext=system_u:system_r:initrc_t tcontext=system_u:object_r:xfs_tmp_t tclass=sock_file

avc: denied { read } for pid=666 exe=/usr/local/selinux/bin/checkpolicy path=/usr/src/selinux/policy/Makefile dev=03:05 ino=882701 scontext=root:sysadm_r:checkpolicy_t tcontext=system_u:object_r:src_t tclass=file

avc: denied { read } for pid=667 exe=/usr/local/selinux/bin/setfiles path=/usr/src/selinux/policy/file_contexts/file_contexts dev=03:05 ino=883914 scontext=root:sysadm_r:setfiles_t tcontext=system_u:object_r:src_t tclass=file

avc: denied { read } for pid=674 exe=/usr/local/selinux/bin/checkpolicy path=/usr/src/selinux/policy/Makefile dev=03:05 ino=882701 scontext=root:sysadm_r:checkpolicy_t tcontext=system_u:object_r:src_t tclass=file

avc: denied { read } for pid=675 exe=/usr/local/selinux/bin/setfiles path=/usr/src/selinux/policy/file_contexts/file_contexts dev=03:05 ino=883914 scontext=root:sysadm_r:setfiles_t tcontext=system_u:object_r:src_t tclass=file

avc: denied { mknod } for pid=692 comm=X capability=27 scontext=root:sysadm_r:sysadm_xserver_t tcontext=root:sysadm_r:sysadm_xserver_t tclass=capability

avc: denied { write } for pid=695 exe=/sbin/insmod path=/sys/kernel/tainted dev=00:02 ino=4144 scontext=root:sysadm_r:sysadm_xserver_t tcontext=system_u:object_r:sysctl_kernel_t tclass=file

avc: denied { sys_module } for pid=695 comm=modprobe capability=16 scontext=root:sysadm_r:sysadm_xserver_t tcontext=root:sysadm_r:sysadm_xserver_t tclass=capability

avc: denied { write } for pid=696 exe=/sbin/insmod path=/sys/kernel/tainted dev=00:02 ino=4144 scontext=root:sysadm_r:sysadm_xserver_t tcontext=system_u:object_r:sysctl_kernel_t tclass=file

avc: denied { sys_module } for pid=696 comm=modprobe capability=16 scontext=root:sysadm_r:sysadm_xserver_t tcontext=root:sysadm_r:sysadm_xserver_t tclass=capability

avc: denied { read write } for pid=692 exe=/usr/X11R6/bin/XFree86 path=/dev/input/mice dev=03:05 ino=799982 scontext=root:sysadm_r:sysadm_xserver_t tcontext=system_u:object_r:device_t tclass=chr_file

avc: denied { search } for pid=692 exe=/usr/X11R6/bin/XFree86 path=/root/.gnome2 dev=03:05 ino=426603 scontext=root:sysadm_r:sysadm_xserver_t tcontext=system_u:object_r:sysadm_home_t tclass=dir

avc: denied { execute } for pid=742 exe=/sbin/insmod path=/bin/bash dev=03:05 ino=865019 scontext=system_u:system_r:insmod_t tcontext=system_u:object_r:shell_exec_t tclass=file Assertion failed! buffer != NULL,via82cxxx_audio.c,via_dsp_write,line=2308

avc: denied { read } for pid=745 exe=/usr/X11R6/bin/xscreensaver path=/etc/shadow dev=03:05 ino=230216 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:shadow_t tclass=file

avc: denied { read } for pid=745 exe=/usr/X11R6/bin/xscreensaver path=/etc/shadow dev=03:05 ino=230216 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:shadow_t tclass=file

avc: denied { read } for pid=751 exe=/usr/bin/magicdev path=/dev/hdd dev=03:05 ino=33539 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:fixed_disk_device_t tclass=blk_file

avc: denied { execute } for pid=755 exe=/usr/bin/gnome-session path=/usr/share/rhn/rhn_applet/applet.py dev=03:05 ino=833120 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:usr_t tclass=file

avc: denied { read write } for pid=767 exe=/usr/bin/gnome-terminal path=/dev/ptyp0 dev=03:05 ino=34775 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file

avc: denied { read write } for pid=767 exe=/usr/bin/gnome-terminal path=/dev/ptyp1 dev=03:05 ino=34776 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file

Thank you.

Mathematics Department UFSC
Campus Universitário Prof. Aldrovando Azeredo

-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/

--
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 · On Tue, 19 Nov 2002 17:15, [email protected] wrote:

avc: denied { read } for pid=666 exe=/usr/local/selinux/bin/checkpolicy path=/usr/src/selinux/policy/Makefile dev=03:05 ino=882701 scontext=root:sysadm_r:checkpolicy_t tcontext=system_u:object_r:src_t tclass=file /usr/local/selinux/bin/setfiles file_contexts/file_contexts

/etc/selinux(/.*)? system_u:object_r:policy_src_t
/etc/security/selinux/src(/.*)? system_u:object_r:policy_src_t
/usr/lib/selinux(/.*)? system_u:object_r:policy_src_t
/usr/share/selinux(/.*)? system_u:object_r:policy_src_t

file_contexts/file_context in the default policy has the above entries for policy source. Move your policy source into one of those four directories and do a "make relabel" and things will be fine.

Quoted 3 lines

avc: denied { write } for pid=109 exe=/bin/rm path=/halt dev=03:05 ino=571 scontext=system_u:system_r:initrc_t tcontext=system_u:object_r:file_t tclass=file

Why is the rm program trying to write to the file?

Quoted 3 lines

avc: denied { read } for pid=129 exe=/sbin/pam_console_apply path=/dev/video dev=03:05 ino=65803 scontext=system_u:system_r:initrc_t tcontext=system_u:object_r:v4l_device_t tclass=dir

If you want to chown device nodes for local users then that would require some changes to the policy. If done right they shouldn't be that significant, just allow login_t to chown the device nodes and then either create a new domain for pam_console_apply when run from initrc_t or grant initrc_t setattr access (dangerous).

Also the entry for /dev/(radio|video|vbi|vtx).* in file_contexts/types.fc should have "-c" to specify that it's for character devices only so that the directory /dev/video doesn't get assigned that type.

I'm not sure that v4l_device_t is appropriate for /dev/video/* entries anyway, but that's a separate issue.

Quoted 4 lines

avc: denied { write } for pid=577 exe=/bin/rm path=/tmp/.font-unix/fs7100 dev=03:05 ino=180181 scontext=system_u:system_r:initrc_t tcontext=system_u:object_r:xfs_tmp_t tclass=sock_file

This rm process should be in the tmpreaper_t domain, then it would be able to do that rm.

Quoted 3 lines

avc: denied { mknod } for pid=692 comm=X capability=27 scontext=root:sysadm_r:sysadm_xserver_t tcontext=root:sysadm_r:sysadm_xserver_t tclass=capability

Why does the X server want to create a device node?

Quoted 4 lines

avc: denied { write } for pid=695 exe=/sbin/insmod path=/sys/kernel/tainted dev=00:02 ino=4144 scontext=root:sysadm_r:sysadm_xserver_t tcontext=system_u:object_r:sysctl_kernel_t tclass=file

Why does the X server want to run insmod/modprobe?

Quoted 4 lines

avc: denied { read write } for pid=692 exe=/usr/X11R6/bin/XFree86 path=/dev/input/mice dev=03:05 ino=799982 scontext=root:sysadm_r:sysadm_xserver_t tcontext=system_u:object_r:device_t tclass=chr_file

Add the following line to file_contexts/types.fc:
/dev/input/mice system_u:object_r:mouse_device_t

Quoted 4 lines

avc: denied { search } for pid=692 exe=/usr/X11R6/bin/XFree86 path=/root/.gnome2 dev=03:05 ino=426603 scontext=root:sysadm_r:sysadm_xserver_t tcontext=system_u:object_r:sysadm_home_t tclass=dir

That's the X server trying to search for custom fonts under the .gnome2 directory, don't worry about it.

Quoted 3 lines

avc: denied { read } for pid=745 exe=/usr/X11R6/bin/xscreensaver path=/etc/shadow dev=03:05 ino=230216 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:shadow_t tclass=file

I created a separate domain for the KDE screen saver, kcheckpass. Please try configuring xscreensaver to use that and see what happens.

Quoted 3 lines

avc: denied { read } for pid=751 exe=/usr/bin/magicdev path=/dev/hdd dev=03:05 ino=33539 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:fixed_disk_device_t tclass=blk_file

What is magicdev?

Quoted 4 lines

avc: denied { execute } for pid=755 exe=/usr/bin/gnome-session path=/usr/share/rhn/rhn_applet/applet.py dev=03:05 ino=833120 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:usr_t tclass=file

What is rhn?

Maybe all files under rhn_applet should be labeled bin_t?

Quoted 3 lines

avc: denied { read write } for pid=767 exe=/usr/bin/gnome-terminal path=/dev/ptyp0 dev=03:05 ino=34775 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:device_t tclass=chr_file

Compile your kernel for unix98 PTY's and make sure that /dev/pts is mounted. Then make sure that the application tries unix98 first. Unix98 works well and lots of people use it, I'm not sure that the old style pty's work at all.

One thing to be certain of, the pseudo-tty device node should NOT be labelled as device_t at the time the terminal program tries to access it.

PS Why use SE Linux if you are going to run Gnome as sysadm_r?

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.
#2 lore raw
Quoted 5 lines · Russell Coker
Quoted 3 lines

avc: denied { read } for pid=751 exe=/usr/bin/magicdev path=/dev/hdd dev=03:05 ino=33539 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:fixed_disk_device_t tclass=blk_file

What is magicdev?

According to <URL:http://www.ccs.neu.edu/home/bchafy/magicdev.html>, it is "an automount/autoplay package for CD's and floppy's under linux redhat 6.1".

Quoted 6 lines
Quoted 4 lines

avc: denied { execute } for pid=755 exe=/usr/bin/gnome-session path=/usr/share/rhn/rhn_applet/applet.py dev=03:05 ino=833120 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:usr_t tclass=file

What is rhn?

A gnome panel applet somehow related to the "Red Hat Network" ????

Just guessing here, I also saw rhn here:
<URL:http://rhn.redhat.com/>.

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.
#3 lore raw
Quoted 10 lines · Brian May
Quoted 5 lines · Russell Coker
Quoted 3 lines

avc: denied { read } for pid=751 exe=/usr/bin/magicdev path=/dev/hdd dev=03:05 ino=33539 scontext=root:sysadm_r:sysadm_t tcontext=system_u:object_r:fixed_disk_device_t tclass=blk_file

What is magicdev?

According to <URL:http://www.ccs.neu.edu/home/bchafy/magicdev.html>, it is "an automount/autoplay package for CD's and floppy's under linux redhat 6.1".

OK, that will require it's own policy if it's to work. However I suspect that anyone who wants security does not want such "features"...

The autorun feature of inserting CDs in Windows has been the cause of quite a few security issues.

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.