Bug 967149

Summary: SELinux is preventing /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19/jre/bin/java from 'write' accesses on the file /home/rajuramvani/.icedtea/cache/recently_used.
Product: [Fedora] Fedora Reporter: rajuramvani <rajuramvani>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: dominick.grift, dwalsh, fran, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Unspecified   
Whiteboard: abrt_hash:a106c072fe3e9a3c56f3abbab209f2388f34cb9962274ed5b290c0c5b7741201
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-05-28 06:57:45 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 rajuramvani 2013-05-25 00:24:30 UTC
Description of problem:
SELinux is preventing /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19/jre/bin/java from 'write' accesses on the file /home/rajuramvani/.icedtea/cache/recently_used.

*****  Plugin mozplugger (99.1 confidence) suggests  *************************

If you want to use the plugin package
Then you must turn off SELinux controls on the Firefox plugins.
Do
# setsebool unconfined_mozilla_plugin_transition 0

*****  Plugin catchall (1.81 confidence) suggests  ***************************

If you believe that java should be allowed write access on the recently_used file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# 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/rajuramvani/.icedtea/cache/recently_used [
                              file ]
Source                        java
Source Path                   /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19/jre/bin/j
                              ava
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           java-1.7.0-openjdk-1.7.0.19-2.3.9.9.fc19.i686
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-44.fc19.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.9.3-301.fc19.i686.PAE #1 SMP Mon
                              May 20 13:05:20 UTC 2013 i686 i686
Alert Count                   85
First Seen                    2013-05-24 06:32:03 IST
Last Seen                     2013-05-25 05:52:35 IST
Local ID                      611f5b1d-abc6-4ad2-9fad-136fd52aac03

Raw Audit Messages
type=AVC msg=audit(1369441355.583:464): avc:  denied  { write } for  pid=2352 comm="java" name="recently_used" dev="dm-1" ino=523692 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(1369441355.583:464): arch=i386 syscall=open success=no exit=EACCES a0=89825b8 a1=8241 a2=1b6 a3=0 items=0 ppid=2311 pid=2352 auid=1000 uid=1000 gid=0 euid=1000 suid=1000 fsuid=1000 egid=0 sgid=0 fsgid=0 ses=1 tty=(none) comm=java exe=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19/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

Additional info:
reporter:       libreport-2.1.4
hashmarkername: setroubleshoot
kernel:         3.9.3-301.fc19.i686.PAE
type:           libreport

Potential duplicate: bug 907049

Comment 1 Miroslav Grepl 2013-05-28 06:57:45 UTC
Should be fixed in the latest policy.

# yum update selinux-policy-targeted

Comment 2 Francisco de la Peña 2013-06-09 18:18:38 UTC
Problem still persists with selinux-policy-3.12.1-48.fc19

Comment 3 Miroslav Grepl 2013-06-12 07:59:19 UTC
Are you getting the same AVC msg?

Comment 4 Francisco de la Peña 2013-06-18 06:51:28 UTC
SELinux is preventing /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.x86_64/jre/bin/java from write access on the file /home/fdelapena/.icedtea/cache/recently_used.

java-1.7.0-openjdk-1.7.0.19-2.3.9.12.fc19.x86_64

selinux-policy-3.12.1-52.fc19.noarch

type=AVC msg=audit(1371538151.155:456): avc:  denied  { write } for  pid=3274 comm="java" name="recently_used" dev="dm-2" ino=55975368 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(1371538151.155:456): arch=x86_64 syscall=open success=no exit=EACCES a0=7ffc6c0a4550 a1=241 a2=1b6 a3=7ffcea9ed6e0 items=0 ppid=2241 pid=3274 auid=1000 uid=1000 gid=0 euid=1000 suid=1000 fsuid=1000 egid=0 sgid=0 fsgid=0 ses=1 tty=(none) comm=java exe=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.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

Comment 5 Francisco de la Peña 2013-06-18 06:58:06 UTC
Another example:

SELinux is preventing /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.x86_64/jre/bin/java from write access on the file /home/fdelapena/.icedtea/cache/5/https/www.bnonline.fi.cr/wa/authmech/base/Web410.jar.

java-1.7.0-openjdk-1.7.0.19-2.3.9.12.fc19.x86_64

selinux-policy-3.12.1-52.fc19.noarch

type=AVC msg=audit(1371538509.771:492): avc:  denied  { write } for  pid=3422 comm="java" name="Web410.jar" dev="dm-2" ino=4981484 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(1371538509.771:492): arch=x86_64 syscall=open success=no exit=EACCES a0=7f8c600844c0 a1=241 a2=1b6 a3=7f8cea58c6e0 items=0 ppid=3371 pid=3422 auid=1000 uid=1000 gid=0 euid=1000 suid=1000 fsuid=1000 egid=0 sgid=0 fsgid=0 ses=1 tty=(none) comm=java exe=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.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

Comment 6 Miroslav Grepl 2013-06-18 07:31:32 UTC
What does

# matchpathcon /home/fdelapena/.icedtea

Comment 7 Francisco de la Peña 2013-06-19 00:15:57 UTC
# matchpathcon /home/fdelapena/.icedtea
/home/fdelapena/.icedtea	unconfined_u:object_r:mozilla_home_t:s0

Comment 8 Miroslav Grepl 2013-06-19 07:02:29 UTC
Please execute

# restorecon -R -v /home/fdelapena

Comment 9 Francisco de la Peña 2013-06-19 23:00:53 UTC
Output at https://bugzilla.redhat.com/show_bug.cgi?id=964653#c11
And AVC dissappeared for this too.