Bug 909554 - SELinux is preventing /usr/lib/opera/opera from 'mmap_zero' accesses on the memprotect .
Summary: SELinux is preventing /usr/lib/opera/opera from 'mmap_zero' accesses on the m...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 18
Hardware: i686
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:9d3a65b4e0b5775d1bb9daf498e...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-02-09 10:59 UTC by Mikhail
Modified: 2013-02-20 13:57 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-02-12 19:22:41 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
htop screenshot (269.23 KB, image/png)
2013-02-09 11:01 UTC, Mikhail
no flags Details

Description Mikhail 2013-02-09 10:59:33 UTC
Description of problem:
I see this bug every time when application try allocate huge amount memory.
So it is not a application problem. It is kernel or SELinux problem!
SELinux is preventing /usr/lib/opera/opera from 'mmap_zero' accesses on the memprotect .

*****  Plugin mmap_zero (53.1 confidence) suggests  **************************

If you do not think /usr/lib/opera/opera should need to mmap low memory in the kernel.
Then you may be under attack by a hacker, this is a very dangerous access.
Do
contact your security administrator and report this issue.

*****  Plugin catchall_boolean (42.6 confidence) suggests  *******************

If you want to control the ability to mmap a low area of the address space, as configured by /proc/sys/kernel/mmap_min_addr.
Then you must tell SELinux about this by enabling the 'mmap_low_allowed' boolean.
You can read 'unconfined_selinux' man page for more details.
Do
setsebool -P mmap_low_allowed 1

*****  Plugin catchall (5.76 confidence) suggests  ***************************

If you believe that opera should be allowed mmap_zero access on the  memprotect 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 opera /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1
                              023
Target Context                unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1
                              023
Target Objects                 [ memprotect ]
Source                        opera
Source Path                   /usr/lib/opera/opera
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           opera-12.14-1737.i386
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-76.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.7.6-201.fc18.i686.PAE #1 SMP Mon
                              Feb 4 16:05:44 UTC 2013 i686 i686
Alert Count                   688
First Seen                    2013-02-09 16:50:58 YEKT
Last Seen                     2013-02-09 16:56:14 YEKT
Local ID                      48b42a65-16d5-433a-9dea-64eca7711b98

Raw Audit Messages
type=AVC msg=audit(1360407374.499:296212): avc:  denied  { mmap_zero } for  pid=506 comm="opera" scontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=memprotect


type=SYSCALL msg=audit(1360407374.499:296212): arch=i386 syscall=mmap2 per=400000 success=no exit=EACCES a0=0 a1=954e4 a2=1 a3=1 items=0 ppid=1681 pid=506 auid=1000 uid=1000 gid=1000 euid=1000 suid=1000 fsuid=1000 egid=1000 sgid=1000 fsgid=1000 ses=2 tty=(none) comm=opera exe=/usr/lib/opera/opera subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key=(null)

Hash: opera,unconfined_t,unconfined_t,memprotect,mmap_zero

audit2allow

#============= unconfined_t ==============
#!!!! This avc can be allowed using the boolean 'mmap_low_allowed'

allow unconfined_t self:memprotect mmap_zero;

audit2allow -R

#============= unconfined_t ==============
#!!!! This avc can be allowed using the boolean 'mmap_low_allowed'

allow unconfined_t self:memprotect mmap_zero;


Additional info:
hashmarkername: setroubleshoot
kernel:         3.7.6-201.fc18.i686.PAE
type:           libreport

Comment 1 Mikhail 2013-02-09 11:00:12 UTC
I see this bug every time when application try allocate huge amount memory.
So it is not a application problem. It is kernel or SELinux problem!

Comment 2 Mikhail 2013-02-09 11:01:02 UTC
Created attachment 695414 [details]
htop screenshot

Comment 3 Mikhail 2013-02-09 11:34:09 UTC
Description of problem:
I see this bug every time when application try allocate huge amount memory.
So it is not a application problem. It is kernel or SELinux problem!

Additional info:
hashmarkername: setroubleshoot
kernel:         3.7.6-201.fc18.i686.PAE
type:           libreport

Comment 4 Mikhail 2013-02-09 11:39:09 UTC
Demonstration memory hell: https://docs.google.com/file/d/0B0nwzlfiB4aQUnd2QXZTTlBCcTA/edit?usp=sharing

Comment 5 Daniel Walsh 2013-02-12 19:22:41 UTC
mmap_zero is considered a dangerous access, but if you are willing to take the risk, then turn the boolean on.

# setsebool -P mmap_low_allowed 1

More information on mmap_zero

http://eparis.livejournal.com/

Eric why do we see this bug if DAC would have blocked it?

Comment 6 Mikhail 2013-02-20 13:57:01 UTC
Same with Opera https://bugzilla.redhat.com/show_bug.cgi?id=909554


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