Bug 120061

Summary: make modules_install fails when calling depmod because of SELinux
Product: [Fedora] Fedora Reporter: Albert Strasheim <13640887>
Component: policyAssignee: Daniel Walsh <dwalsh>
Status: CLOSED RAWHIDE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: pgraner
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-04-07 14:41:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.