Bug 2216876 - SELinux is preventing sendmail from 'create' accesses on the file sendmail.pid.
Summary: SELinux is preventing sendmail from 'create' accesses on the file sendmail.pid.
Keywords:
Status: CLOSED DUPLICATE of bug 2216060
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 38
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:07fdf4efae53bb507fc5beee08e...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-06-23 00:55 UTC by James Davidson
Modified: 2023-06-26 21:34 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-06-26 21:34:11 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: description (1.89 KB, text/plain)
2023-06-23 00:55 UTC, James Davidson
no flags Details
File: os_info (734 bytes, text/plain)
2023-06-23 00:55 UTC, James Davidson
no flags Details

Description James Davidson 2023-06-23 00:55:47 UTC
Description of problem:
Upgraded from Fedora 37 to Fedoara 38 and sendmail now failes to start with this SELinux Alert.
SELinux is preventing sendmail from 'create' accesses on the file sendmail.pid.

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

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

Additional Information:
Source Context                system_u:system_r:sendmail_t:s0
Target Context                system_u:object_r:sendmail_var_run_t:s0
Target Objects                sendmail.pid [ file ]
Source                        sendmail
Source Path                   sendmail
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-38.17-1.fc38.noarch
Local Policy RPM              selinux-policy-targeted-38.17-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                   4
First Seen                    2023-06-22 17:36:50 PDT
Last Seen                     2023-06-22 17:40:15 PDT
Local ID                      a307e526-14b1-46b5-bc6a-9b2983870948

Raw Audit Messages
type=AVC msg=audit(1687480815.586:277): avc:  denied  { create } for  pid=11664 comm="sendmail" name="sendmail.pid" scontext=system_u:system_r:sendmail_t:s0 tcontext=system_u:object_r:sendmail_var_run_t:s0 tclass=file permissive=0


Hash: sendmail,sendmail_t,sendmail_var_run_t,file,create

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

Additional info:
reporter:       libreport-2.17.10
component:      selinux-policy
comment:        Upgraded from Fedora 37 to Fedoara 38 and sendmail now failes to start with this SELinux Alert.
type:           libreport
package:        selinux-policy-targeted-38.17-1.fc38.noarch
hashmarkername: setroubleshoot
reason:         SELinux is preventing sendmail from 'create' accesses on the file sendmail.pid.
kernel:         6.3.8-200.fc38.x86_64
component:      selinux-policy

Comment 1 James Davidson 2023-06-23 00:55:50 UTC
Created attachment 1972175 [details]
File: description

Comment 2 James Davidson 2023-06-23 00:55:51 UTC
Created attachment 1972176 [details]
File: os_info

Comment 3 Toby Ovod-Everett 2023-06-23 05:45:52 UTC
I downgraded selinux-policy and selinux-policy-targeted to 38.8-2 on my system as a workaround to get sendmail running again.  I can confirm that the issue with sendmail was not present in selinux-policy 38.15-1, but that wasn't easily available for downgrade, so I just went back to 38.8-2 because that was easier.

Comment 4 Piergiorgio Sartor 2023-06-24 07:33:42 UTC
This was the module created after two or three iterations of search & allow:

---- cut here ---- cut here ---- 

module my-sendmail 1.0;

require {
	type sendmail_var_run_t;
	type sendmail_t;
	class file { create getattr lock open unlink write };
}

#============= sendmail_t ==============

#!!!! This avc is allowed in the current policy
allow sendmail_t sendmail_var_run_t:file { create getattr lock open unlink write };

---- cut here ---- cut here ----

Apparently, "sendmail" requires "create", "getattr", etc. for files in /var/run (meaning /run).

Hope this helps,

bye,

pg

Comment 5 Eiríkur Hjartarson 2023-06-24 14:42:58 UTC
Confirming that downgrading selinux-policy-targeted-38.17-1.fc38 to selinux-policy-targeted-38.15-1.fc38 fixed this for me.

Comment 6 Zdenek Pytela 2023-06-26 21:34:11 UTC

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


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