Bug 1284632 - SELinux is preventing abrt-hook-ccpp from 'read' accesses on the directory coredumps.
Summary: SELinux is preventing abrt-hook-ccpp from 'read' accesses on the directory co...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: abrt
Version: 22
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: abrt
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:2fbde1924b386a9c6cf83cc09a0...
: 1284633 1285047 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-23 17:15 UTC by Harshal
Modified: 2016-03-15 18:11 UTC (History)
13 users (show)

Fixed In Version: selinux-policy-3.13.1-128.28.fc22
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-03-15 18:11:08 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Harshal 2015-11-23 17:15:36 UTC
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 14:43:52 UTC
What is a path to user coredumps?

Comment 2 Jakub Filak 2016-02-08 08:07:16 UTC
(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 08:09:19 UTC
*** Bug 1284633 has been marked as a duplicate of this bug. ***

Comment 4 Jakub Filak 2016-02-08 08:22:14 UTC
*** Bug 1285047 has been marked as a duplicate of this bug. ***

Comment 5 Lukas Vrabec 2016-02-08 10:26:01 UTC
(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 09:18:01 UTC
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 18:11:08 UTC
And also in F22.


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