Bug 907049

Summary: SELinux is preventing /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64/jre/bin/java from 'write' accesses on the file /home/marcos/.icedtea/cache/recently_used.
Product: [Fedora] Fedora Reporter: Marcos Martins da Silva <marcosmds>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:a106c072fe3e9a3c56f3abbab209f2388f34cb9962274ed5b290c0c5b7741201
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-04 11:25:12 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 Marcos Martins da Silva 2013-02-02 22:38:09 UTC
Description of problem:
I changed my default java to Icetea and got this alert, when acessing a secure applet 
SELinux is preventing /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64/jre/bin/java from 'write' accesses on the file /home/marcos/.icedtea/cache/recently_used.

*****  Plugin catchall (100. confidence) suggests  ***************************

If você acredita que o java deva ser permitido acesso de write em recently_used file  por default.
Then você precisa reportar este como um erro.
Você pode gerar um módulo de política local para permitir este acesso.
Do
permitir este acesso agora executando:
# grep java /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                unconfined_u:unconfined_r:mozilla_plugin_t:s0-s0:c
                              0.c1023
Target Context                unconfined_u:object_r:user_home_t:s0
Target Objects                /home/marcos/.icedtea/cache/recently_used [ file ]
Source                        java
Source Path                   /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64/jre
                              /bin/java
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           java-1.7.0-openjdk-1.7.0.9-2.3.4.fc18.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-73.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.7.4-204.fc18.x86_64 #1 SMP Wed
                              Jan 23 16:44:29 UTC 2013 x86_64 x86_64
Alert Count                   21
First Seen                    2013-02-02 20:31:58 BRST
Last Seen                     2013-02-02 20:33:08 BRST
Local ID                      a623d324-c6c0-4b00-9441-9ddcd2949b82

Raw Audit Messages
type=AVC msg=audit(1359844388.777:383): avc:  denied  { write } for  pid=7776 comm="java" name="recently_used" dev="dm-2" ino=134197 scontext=unconfined_u:unconfined_r:mozilla_plugin_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file


type=SYSCALL msg=audit(1359844388.777:383): arch=x86_64 syscall=open success=no exit=EACCES a0=7f518001e3a0 a1=241 a2=1b6 a3=2a items=0 ppid=7254 pid=7776 auid=1000 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 ses=2 tty=(none) comm=java exe=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64/jre/bin/java subj=unconfined_u:unconfined_r:mozilla_plugin_t:s0-s0:c0.c1023 key=(null)

Hash: java,mozilla_plugin_t,user_home_t,file,write

audit2allow

#============= mozilla_plugin_t ==============
#!!!! This avc is allowed in the current policy

allow mozilla_plugin_t user_home_t:file write;

audit2allow -R

#============= mozilla_plugin_t ==============
#!!!! This avc is allowed in the current policy

allow mozilla_plugin_t user_home_t:file write;


Additional info:
hashmarkername: setroubleshoot
kernel:         3.7.4-204.fc18.x86_64
type:           libreport

Comment 1 Miroslav Grepl 2013-02-04 11:25:12 UTC
I see you allowed it in the local policy. Better would be 

# setsebool -P unconfined_mozilla_plugin_transition 0

which will run "java" as unconfined.