Bug 1284632 - SELinux is preventing abrt-hook-ccpp from 'read' accesses on the directory coredumps.
SELinux is preventing abrt-hook-ccpp from 'read' accesses on the directory co...
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: abrt (Show other bugs)
22
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: abrt
Fedora Extras Quality Assurance
abrt_hash:2fbde1924b386a9c6cf83cc09a0...
:
: 1284633 1285047 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-23 12:15 EST by Harshal
Modified: 2016-03-15 14:11 EDT (History)
13 users (show)

See Also:
Fixed In Version: selinux-policy-3.13.1-128.28.fc22
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-03-15 14:11:08 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Harshal 2015-11-23 12:15:36 EST
Description of problem:
SELinux is preventing abrt-hook-ccpp from 'read' accesses on the directory coredumps.

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

If you believe that abrt-hook-ccpp should be allowed read access on the coredumps directory 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 abrt-hook-ccpp /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:abrt_dump_oops_t:s0
Target Context                unconfined_u:object_r:user_home_t:s0
Target Objects                coredumps [ dir ]
Source                        abrt-hook-ccpp
Source Path                   abrt-hook-ccpp
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-128.18.fc22.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.2.5-201.fc22.x86_64 #1 SMP Wed
                              Oct 28 20:00:23 UTC 2015 x86_64 x86_64
Alert Count                   1
First Seen                    2015-11-23 22:24:34 IST
Last Seen                     2015-11-23 22:24:34 IST
Local ID                      07bd50a1-ce9f-4c04-8600-8e8591940087

Raw Audit Messages
type=AVC msg=audit(1448297674.406:287): avc:  denied  { read } for  pid=9915 comm="abrt-hook-ccpp" name="coredumps" dev="dm-2" ino=15732481 scontext=system_u:system_r:abrt_dump_oops_t:s0 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=dir permissive=0


Hash: abrt-hook-ccpp,abrt_dump_oops_t,user_home_t,dir,read

Version-Release number of selected component:
selinux-policy-3.13.1-128.18.fc22.noarch

Additional info:
reporter:       libreport-2.6.3
hashmarkername: setroubleshoot
kernel:         4.2.5-201.fc22.x86_64
type:           libreport
Comment 1 Miroslav Grepl 2016-01-21 09:43:52 EST
What is a path to user coredumps?
Comment 2 Jakub Filak 2016-02-08 03:07:16 EST
(In reply to Miroslav Grepl from comment #1)
> What is a path to user coredumps?

If 'ulimit -c' is not 0 and MakeCompatCore=yes in the /etc/abrt/plugins/CCpp.conf file, then abrt-hook-ccpp creates the core dump file in the same way as kernel does (man 5 core) using the old core_pattern saved in the /var/run/abrt/saved_core_pattern file (if the old core pattern begins with "|", then the string "core" is used instead). Hence, there isn't a fixed path to the user coredump directory.

If I remember it correctly, we (you and me) have decided to allow abrt-hook-ccpp to write to any sub-directory of "/home", "/tmp", "/var/tmp", "/usr/local" and "/opt".

Is the policy in use?
Comment 3 Jakub Filak 2016-02-08 03:09:19 EST
*** Bug 1284633 has been marked as a duplicate of this bug. ***
Comment 4 Jakub Filak 2016-02-08 03:22:14 EST
*** Bug 1285047 has been marked as a duplicate of this bug. ***
Comment 5 Lukas Vrabec 2016-02-08 05:26:01 EST
(In reply to Jakub Filak from comment #2)
> (In reply to Miroslav Grepl from comment #1)
> > What is a path to user coredumps?
> 
> If 'ulimit -c' is not 0 and MakeCompatCore=yes in the
> /etc/abrt/plugins/CCpp.conf file, then abrt-hook-ccpp creates the core dump
> file in the same way as kernel does (man 5 core) using the old core_pattern
> saved in the /var/run/abrt/saved_core_pattern file (if the old core pattern
> begins with "|", then the string "core" is used instead). Hence, there isn't
> a fixed path to the user coredump directory.
> 
> If I remember it correctly, we (you and me) have decided to allow
> abrt-hook-ccpp to write to any sub-directory of "/home", "/tmp", "/var/tmp",
> "/usr/local" and "/opt".
> 

Mirek, 
Are you fine with that? 

> Is the policy in use?

No this is not allowed in SELinux distro policy.
Comment 6 Miroslav Grepl 2016-03-14 05:18:01 EDT
We have

files_manage_non_security_dirs(abrt_dump_oops_t)
files_manage_non_security_files(abrt_dump_oops_t)

in F23+.
Comment 7 Lukas Vrabec 2016-03-15 14:11:08 EDT
And also in F22.

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