Bug 2169154 - SELinux is preventing check from 'mmap_zero' accesses on the memprotect labeled spc_t.
Summary: SELinux is preventing check from 'mmap_zero' accesses on the memprotect label...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: container-selinux
Version: 36
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:5c7c89f548c9328cf9181267c10...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-02-12 10:01 UTC by Sidney Sedlak
Modified: 2023-02-13 06:15 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2023-02-13 00:32:01 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Sidney Sedlak 2023-02-12 10:01:10 UTC
Description of problem:
SELinux is preventing check from 'mmap_zero' accesses on the memprotect labeled spc_t.

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

If you do not think check 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 allow mmap to low allowed
Then you must tell SELinux about this by enabling the 'mmap_low_allowed' boolean.

Do
setsebool -P mmap_low_allowed 1

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

If you believe that check should be allowed mmap_zero access on memprotect labeled spc_t 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:
# ausearch -c 'check' --raw | audit2allow -M my-check
# semodule -X 300 -i my-check.pp

Additional Information:
Source Context                system_u:system_r:spc_t:s0
Target Context                system_u:system_r:spc_t:s0
Target Objects                Unknown [ memprotect ]
Source                        check
Source Path                   check
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-36.17-1.fc36.noarch
Local Policy RPM              container-selinux-2.199.0-1.fc36.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 6.1.10-100.fc36.x86_64 #1 SMP
                              PREEMPT_DYNAMIC Mon Feb 6 19:58:39 UTC 2023 x86_64
                              x86_64
Alert Count                   60
First Seen                    2023-02-12 09:43:39 CET
Last Seen                     2023-02-12 09:43:39 CET
Local ID                      86fa66c1-d2f6-4455-96ba-649a2f1fe0d9

Raw Audit Messages
type=AVC msg=audit(1676191419.548:1027): avc:  denied  { mmap_zero } for  pid=7399 comm="check" scontext=system_u:system_r:spc_t:s0 tcontext=system_u:system_r:spc_t:s0 tclass=memprotect permissive=0


Hash: check,spc_t,spc_t,memprotect,mmap_zero

Version-Release number of selected component:
selinux-policy-targeted-36.17-1.fc36.noarch

Additional info:
component:      container-selinux
reporter:       libreport-2.17.4
hashmarkername: setroubleshoot
kernel:         6.1.10-100.fc36.x86_64
type:           libreport

Comment 1 Daniel Walsh 2023-02-13 00:32:01 UTC
mmap_zero is a dangerous Access.  If you want to allow this then turn on the boolean.  Most likely you are running a badly designed application in a container.
Or perhaps WINE?

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

If you want to allow mmap to low allowed
Then you must tell SELinux about this by enabling the 'mmap_low_allowed' boolean.

Do
setsebool -P mmap_low_allowed 1

Comment 2 Sidney Sedlak 2023-02-13 06:15:47 UTC
I don't want to allow it but I got it yesterday and I could not find which application fired this up. I did not use WINE and neither any container.

That's why I reported this bug.

Hmm I will dig deeper to see where it could come from...


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