Bug 120061 - make modules_install fails when calling depmod because of SELinux
Summary: make modules_install fails when calling depmod because of SELinux
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: policy
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-04-05 18:12 UTC by Albert Strasheim
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2004-04-07 14:41:43 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Albert Strasheim 2004-04-05 18:12:13 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040312

Description of problem:
I compile the kernel as root (root:sysadm_r:sysadm_t policy). The last
step of the kernel compilation is to run depmod like so:

/sbin/depmod -ae -F System.map 2.6.4-1.305custom

This produces the following error:

FATAL: Could not open 'System.map': Permission denied

The following message appears in /var/log/messages:

Apr  5 20:05:14 asok kernel: audit(1081188314.313:0): avc:  denied  {
search } for  pid=31859 exe=/sbin/depmod name=linux-2.6.4-1.305
dev=hda5 ino=33 scontext=root:sysadm_r:depmod_t
tcontext=system_u:object_r:src_t tclass=dir

With setenforce 0, everything works fine.

Version-Release number of selected component (if applicable):
kernel-source-2.6.4-1.305 

How reproducible:
Always

Steps to Reproduce:
1. Configure and compile custom kernel
2. make modules_install

Actual Results:  depmod fails

Expected Results:  depmod should work

Additional info:

Comment 1 Daniel Walsh 2004-04-05 19:37:52 UTC
Could you see if adding this

r_dir_file(depmod_t, src_t)

to 
/etc/security/selinux/src/policy/domains/program/modutile.te
and then do a 
make load
fixes the problem.


Comment 2 Albert Strasheim 2004-04-06 00:43:46 UTC
Yep, adding the line above to modutil.te included with
policy-sources-1.9.2-9 at line 46 fixes the problem.

Without the line, I would get the following error in /var/log/messages:

Apr  6 02:48:48 asok kernel: audit(1081212528.277:0): avc:  denied  {
search } for  pid=3040 exe=/sbin/depmod name=linux-2.6.4-1.305
dev=hda5 ino=33 scontext=root:sysadm_r:depmod_t
tcontext=system_u:object_r:src_t tclass=dir

Comment 3 Daniel Walsh 2004-04-06 03:06:42 UTC
Fixed in policy-1.9.2-12

Comment 4 Albert Strasheim 2004-04-07 14:15:26 UTC
Yep, works for me.


Note You need to log in before you can comment on or make changes to this bug.