Bug 2073566 - SELinux is preventing bwrap from 'mount' accesses on the filesystem /dev/shm.
Summary: SELinux is preventing bwrap from 'mount' accesses on the filesystem /dev/shm.
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: flatpak
Version: 39
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Debarshi Ray
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:a346c013bcda7fd4858aadeece4...
Depends On:
Blocks: 2075937
TreeView+ depends on / blocked
 
Reported: 2022-04-08 20:26 UTC by Michael
Modified: 2023-08-16 07:05 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Michael 2022-04-08 20:26:06 UTC
Description of problem:
flatpak update
SELinux is preventing bwrap from 'mount' accesses on the filesystem /dev/shm.

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

If you believe that bwrap should be allowed mount access on the shm filesystem 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 'bwrap' --raw | audit2allow -M my-bwrap
# semodule -X 300 -i my-bwrap.pp

Additional Information:
Source Context                system_u:system_r:flatpak_helper_t:s0
Target Context                system_u:object_r:tmpfs_t:s0
Target Objects                /dev/shm [ filesystem ]
Source                        bwrap
Source Path                   bwrap
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-36.6-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-08 22:23:47 CEST
Last Seen                     2022-04-08 22:23:47 CEST
Local ID                      15da4876-394f-4647-b2fa-ee1a9b6bece4

Raw Audit Messages
type=AVC msg=audit(1649449427.691:1293): avc:  denied  { mount } for  pid=47214 comm="bwrap" name="/" dev="tmpfs" ino=1 scontext=system_u:system_r:flatpak_helper_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=filesystem permissive=1


Hash: bwrap,flatpak_helper_t,tmpfs_t,filesystem,mount

Version-Release number of selected component:
selinux-policy-targeted-36.6-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 Debarshi Ray 2022-04-12 19:12:51 UTC
This looks a lot like:
https://bugzilla.redhat.com/show_bug.cgi?id=2071259#c21

Hey Zdeněk!  Could you please tell me how to supress this SELinux denial?

Comment 2 Zdenek Pytela 2022-04-12 20:38:26 UTC
(In reply to Debarshi Ray from comment #1)
> This looks a lot like:
> https://bugzilla.redhat.com/show_bug.cgi?id=2071259#c21
> 
> Hey Zdeněk!  Could you please tell me how to supress this SELinux denial?

Supress the denial or allow the permissions?
There is this interface: fs_mount_tmpfs()
I just wonder why bwrap wants to mount /dev/shm while it should be mounted after boot.

Comment 3 Debarshi Ray 2022-04-12 21:48:03 UTC
> Supress the denial or allow the permissions?

Sorry, I meant "allow the permissions".  I should have probably said "avoid this SELinux denial", not "suppress".

Comment 4 Ben Cotton 2023-04-25 18:23:58 UTC
This message is a reminder that Fedora Linux 36 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 36 on 2023-05-16.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '36'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 36 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 5 Fedora Release Engineering 2023-08-16 07:05:31 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.


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