Bug 2219426 - SELinux is preventing snapd from 'write' accesses on the file core22.lock.
Summary: SELinux is preventing snapd from 'write' accesses on the file core22.lock.
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: snapd
Version: 38
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Zygmunt Krynicki
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:e36cb8c911f89aa866635f693d4...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-03 15:27 UTC by Ahmed Salama
Modified: 2023-07-03 15:27 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: ---
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)
File: os_info (699 bytes, text/plain)
2023-07-03 15:27 UTC, Ahmed Salama
no flags Details
File: description (2.22 KB, text/plain)
2023-07-03 15:27 UTC, Ahmed Salama
no flags Details

Description Ahmed Salama 2023-07-03 15:27:30 UTC
Description of problem:
SELinux is preventing snapd from 'write' accesses on the file core22.lock.

*****  Plugin restorecon (99.5 confidence) suggests   ************************

If you want to fix the label. 
core22.lock default label should be snappy_var_run_t.
Then you can run restorecon. The access attempt may have been stopped due to insufficient permissions to access a parent directory in which case try to change the following command accordingly.
Do
# /sbin/restorecon -v core22.lock

*****  Plugin catchall (1.49 confidence) suggests   **************************

If you believe that snapd should be allowed write access on the core22.lock file 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 'snapd' --raw | audit2allow -M my-snapd
# semodule -X 300 -i my-snapd.pp

Additional Information:
Source Context                system_u:system_r:snappy_t:s0
Target Context                system_u:object_r:var_run_t:s0
Target Objects                core22.lock [ file ]
Source                        snapd
Source Path                   snapd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-38.17-1.fc38.noarch
Local Policy RPM              snapd-selinux-2.58.3-1.fc38.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 6.3.8-200.fc38.x86_64 #1 SMP
                              PREEMPT_DYNAMIC Thu Jun 15 02:15:40 UTC 2023
                              x86_64
Alert Count                   8
First Seen                    2023-06-07 19:03:40 +04
Last Seen                     2023-06-22 03:31:55 +04
Local ID                      56f60104-0d9a-4add-8b31-1544e5b91652

Raw Audit Messages
type=AVC msg=audit(1687390315.387:733): avc:  denied  { write } for  pid=3962 comm="snapd" name="core22.lock" dev="tmpfs" ino=4272 scontext=system_u:system_r:snappy_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=file permissive=1


Hash: snapd,snappy_t,var_run_t,file,write

Version-Release number of selected component:
selinux-policy-targeted-38.17-1.fc38.noarch

Additional info:
reporter:       libreport-2.17.10
component:      snapd
package:        selinux-policy-targeted-38.17-1.fc38.noarch
hashmarkername: setroubleshoot
reason:         SELinux is preventing snapd from 'write' accesses on the file core22.lock.
kernel:         6.3.8-200.fc38.x86_64
type:           libreport
component:      snapd



Potential duplicate: bug 2117568

Comment 1 Ahmed Salama 2023-07-03 15:27:33 UTC
Created attachment 1973889 [details]
File: os_info

Comment 2 Ahmed Salama 2023-07-03 15:27:34 UTC
Created attachment 1973890 [details]
File: description


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