Bug 665505

Summary: SELinux instructions not functional
Product: [Fedora] Fedora Reporter: Richard Burton <richard_s_burton>
Component: setroubleshoot-pluginsAssignee: Daniel Walsh <dwalsh>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 14CC: bugs.michael, dwalsh, jdennis, mgrepl, pereira.vitor.manuel, rom1dep
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: setroubleshoot-plugins-3.0.9-1.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-13 18:01:31 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 Richard Burton 2010-12-24 05:19:10 UTC
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.6.13-1.fc14 Firefox/3.6.13

Running crossover-standard (wine). Causes SELinux exception.
SELinux provides following instruction

You should report this as a bug.
You can generate a local policy module to allow this access.
Allow this access for now by executing:
# grep /opt/cxoffice/bin/wine-preloader /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

ran su - 
and then the grep line. Resulted in the following:
[root@rsb ~]# grep /opt/cxoffice/bin/wine-preloader /var/log/audit/audit.log | audit2allow -M mypol
compilation failed:
mypol.te:6:ERROR 'syntax error' at token '' on line 6:


What do I do to update local policy? Too bad there is not a button for this....


Reproducible: Always

Steps to Reproduce:
1. Run application under crossover (wine)
2. follow SELinux instructions
3.


Expected Results:  
Local policy updated with no errors. Better yet, a button to execute these commands from within SELinux.

Comment 1 Daniel Walsh 2010-12-28 20:17:57 UTC
If you grep for wine-preloader in /var/log/audit/audit.log do you get data?

We do not want to make this a button because we would like you to try to analyze what the policy allows.

In this case you probably do not want to necessarily allow what it is asking for.


Please attach the output of 

ausearch -m avc -ts recent

Comment 2 Richard Burton 2010-12-29 00:24:44 UTC
The grep results in
[root@rsb ~]# grep /opt/cxoffice/bin/wine-preloader /var/log/audit/audit.log |
> audit2allow -M mypol
compilation failed:
mypol.te:6:ERROR 'syntax error' at token '' on line 6:


/usr/bin/checkmodule:  error(s) encountered while parsing configuration
/usr/bin/checkmodule:  loading policy configuration from mypol.te




Here is the output from ausearch. I assume pwd directory does not matter?
[root@rsb ~]# ausearch -m avc -ts recent
<no matches>

Comment 3 Miroslav Grepl 2011-01-03 11:34:25 UTC
Dan,
I think we should just change the following line in the catchall.py plugin


# grep $SOURCE_PATH /var/log/audit/audit.log | audit2allow -M mypol

to 

# grep $SOURCE /var/log/audit/audit.log | audit2allow -M mypol

The problem is $SOURCE_PATH is located on new line in the "audit.log" log file.

Comment 4 Miroslav Grepl 2011-01-03 11:34:54 UTC
*** Bug 666179 has been marked as a duplicate of this bug. ***

Comment 5 Miroslav Grepl 2011-01-03 16:52:10 UTC
*** Bug 666739 has been marked as a duplicate of this bug. ***

Comment 6 Fedora Update System 2011-01-03 21:12:26 UTC
setroubleshoot-plugins-3.0.9-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/setroubleshoot-plugins-3.0.9-1.fc14

Comment 7 Fedora Update System 2011-01-04 20:53:26 UTC
setroubleshoot-plugins-3.0.9-1.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update setroubleshoot-plugins'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/setroubleshoot-plugins-3.0.9-1.fc14

Comment 8 Vitor 2011-01-07 00:33:25 UTC
(In reply to comment #7)

Problem persists after the upgrade. Details below.

[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.35.10-74.fc14.x86_64 #1 SMP Thu Dec 23 16:04:50 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux

[root@localhost ~]# rpm -q setroubleshoot-plugins
setroubleshoot-plugins-3.0.9-1.fc14.noarch

[root@localhost ~]# grep /usr/local/Wolfram/Mathematica/7.0/SystemFiles/FrontEnd/Binaries/Linux-x86-64/gltest /var/log/audit/audit.log 
type=SYSCALL msg=audit(1294358863.627:79): arch=c000003e syscall=10 success=no exit=-13 a0=7fff364af000 a1=1000 a2=1000007 a3=33cd421000 items=0 ppid=7634 pid=7635 auid=500 uid=500 gid=100 euid=500 suid=500 fsuid=500 egid=100 sgid=100 fsgid=100 tty=(none) ses=6 comm="gltest" exe="/usr/local/Wolfram/Mathematica/7.0/SystemFiles/FrontEnd/Binaries/Linux-x86-64/gltest" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)

[root@localhost ~]# grep /usr/local/Wolfram/Mathematica/7.0/SystemFiles/FrontEnd/Binaries/Linux-x86-64/gltest /var/log/audit/audit.log | audit2allow -M mypol
compilation failed:
mypol.te:6:ERROR 'syntax error' at token '' on line 6:


/usr/bin/checkmodule:  error(s) encountered while parsing configuration
/usr/bin/checkmodule:  loading policy configuration from mypol.te

Comment 9 Daniel Walsh 2011-01-07 17:01:30 UTC
Please look at the alert again.  It should tell you to 

grep gltest /var/log/audit/audit.log 

Now.  Jut the base name not the full path.

Comment 10 Vitor 2011-01-08 02:12:48 UTC
(In reply to comment #9)
> Now.  Jut the base name not the full path.

You're absolutely right. Problem solved.

Apologies for the noise...

Comment 11 Fedora Update System 2011-01-13 18:01:25 UTC
setroubleshoot-plugins-3.0.9-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.