Bug 2072243 - SELinux is preventing pool-/usr/libex from 'rmdir' accesses on the directory 80.
Summary: SELinux is preventing pool-/usr/libex from 'rmdir' accesses on the directory 80.
Keywords:
Status: CLOSED DUPLICATE of bug 2013407
Alias: None
Product: Fedora
Classification: Fedora
Component: flatpak
Version: 36
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Debarshi Ray
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:a5bd7771effea5819a65b145d6b...
Depends On:
Blocks: 2075937
TreeView+ depends on / blocked
 
Reported: 2022-04-05 21:46 UTC by Michael
Modified: 2022-07-08 17:12 UTC (History)
12 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2022-07-08 17:12:52 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Michael 2022-04-05 21:46:44 UTC
Description of problem:
SELinux is preventing pool-/usr/libex from 'rmdir' accesses on the directory 80.

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

If you believe that libex should be allowed rmdir access on the 80 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:
# ausearch -c 'pool-/usr/libex' --raw | audit2allow -M my-poolusrlibex
# semodule -X 300 -i my-poolusrlibex.pp

Additional Information:
Source Context                system_u:system_r:flatpak_helper_t:s0
Target Context                system_u:object_r:var_lib_t:s0
Target Objects                80 [ dir ]
Source                        pool-/usr/libex
Source Path                   pool-/usr/libex
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-36.5-1.fc36.noarch
Local Policy RPM              flatpak-selinux-1.12.7-1.fc36.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 5.16.16-200.fc35.x86_64 #1 SMP
                              PREEMPT Wed Mar 23 00:44:58 CET 2022 x86_64 x86_64
Alert Count                   1
First Seen                    2022-04-05 23:44:40 CEST
Last Seen                     2022-04-05 23:44:40 CEST
Local ID                      b2218539-6642-4871-8d03-39b68ecaf3b1

Raw Audit Messages
type=AVC msg=audit(1649195080.952:717): avc:  denied  { rmdir } for  pid=12473 comm="pool-/usr/libex" name="80" dev="nvme0n1p3" ino=5328800 scontext=system_u:system_r:flatpak_helper_t:s0 tcontext=system_u:object_r:var_lib_t:s0 tclass=dir permissive=1


Hash: pool-/usr/libex,flatpak_helper_t,var_lib_t,dir,rmdir

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

Additional info:
component:      flatpak
reporter:       libreport-2.17.1
hashmarkername: setroubleshoot
kernel:         5.16.16-200.fc35.x86_64
type:           libreport

Comment 1 Zdenek Pytela 2022-04-14 19:25:52 UTC
Needs to be resolved in flatpak-selinux.

Comment 2 Debarshi Ray 2022-04-20 00:52:54 UTC
What would be the right interface to allow 'rmdir' inside /var/lib/flatpak?  files_rmdir_all_dirs or files_manage_var_lib_dirs or files_rw_var_lib_dirs?

Comment 3 Zdenek Pytela 2022-04-27 09:12:15 UTC
flatpak should not be allowed to manage the whole /var/lib, so this is the time to confine /var/lib/flatpak.

Comment 4 Debarshi Ray 2022-05-05 22:52:02 UTC
(In reply to Zdenek Pytela from comment #3)
> flatpak should not be allowed to manage the whole /var/lib, so this is the
> time to confine /var/lib/flatpak.

Okay!  What does "confine /var/lib/flatpak" really mean?  I don't know enough about SELinux to understand that.  Could you please give me some pointers?

Comment 5 Zdenek Pytela 2022-06-30 09:40:21 UTC
(In reply to Debarshi Ray from comment #4)
> (In reply to Zdenek Pytela from comment #3)
> > flatpak should not be allowed to manage the whole /var/lib, so this is the
> > time to confine /var/lib/flatpak.
> 
> Okay!  What does "confine /var/lib/flatpak" really mean?  I don't know
> enough about SELinux to understand that.  Could you please give me some
> pointers?

It means assign a new type to this directory, e. g. flatpak_var_lib_t, and allow flatpak_t manage this file type. Unfortunately it probably also means allow read access to additional domains accessing /var/lib/flatpak.

Comment 6 Debarshi Ray 2022-07-08 17:10:47 UTC
(In reply to Zdenek Pytela from comment #5)
> (In reply to Debarshi Ray from comment #4)
> > (In reply to Zdenek Pytela from comment #3)
> > > flatpak should not be allowed to manage the whole /var/lib, so this is the
> > > time to confine /var/lib/flatpak.
> > 
> > Okay!  What does "confine /var/lib/flatpak" really mean?  I don't know
> > enough about SELinux to understand that.  Could you please give me some
> > pointers?
> 
> It means assign a new type to this directory, e. g. flatpak_var_lib_t, and
> allow flatpak_t manage this file type. Unfortunately it probably also means
> allow read access to additional domains accessing /var/lib/flatpak.

Okay!  Thanks for clarifying that, Zdeněk.

Comment 7 Debarshi Ray 2022-07-08 17:12:52 UTC

*** This bug has been marked as a duplicate of bug 2013407 ***


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