Bug 2322523 - SELinux change removes label for OpenDKIM
Summary: SELinux change removes label for OpenDKIM
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 41
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-10-29 18:45 UTC by Anthony Messina
Modified: 2025-08-01 01:55 UTC (History)
18 users (show)

Fixed In Version: selinux-policy-41.46-1.fc41
Clone Of:
Environment:
Last Closed: 2025-08-01 01:55:26 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github fedora-selinux selinux-policy pull 2739 0 None open Label /run/opendkim with dkim_milter_data_t 2025-06-23 14:59:16 UTC
Red Hat Bugzilla 2323522 0 unspecified CLOSED SELinux prevents opendkim to run in its default configuration 2025-12-09 16:16:03 UTC

Internal Links: 2323522

Description Anthony Messina 2024-10-29 18:45:22 UTC
After upgrading to Fedora 41 with selinux-policy-41.24-1.fc41, I noticed that OpenDKIM/Postfix aren't working properly and that the /run/opendkim directory is labeled var_run_t when it should be dkim_milter_data_t.

Upstream https://github.com/fedora-selinux/selinux-policy/commit/eaa8cf1d7f187819a4c82c1fa52704a669ec780b also removed the entry:

/run/opendkim(/.*)?         gen_context(system_u:object_r:dkim_milter_data_t,s0)

which should probably be put back and a new policy package released.

Comment 1 Steve 2024-11-01 18:25:13 UTC
I am not an selinux maintainer, but I noticed that the commit message says:

"Remove a few lines duplicated between {dkim,milter}.fc"

However, this is present in both files:

/var/spool/opendkim(/.*)?	gen_context(system_u:object_r:dkim_milter_data_t,s0)

More to the point, there don't seem to be any file contexts from dkim.fc in selinux-policy-targeted-41.24-1.fc41.noarch:

$ sudo semanage fcontext -l | fgrep dkim
/etc/mail/dkim-milter/keys(/.*)?                   all files          system_u:object_r:dkim_milter_private_key_t:s0 
/run/opendmarc(/.*)?                               all files          system_u:object_r:dkim_milter_data_t:s0 
/usr/bin/dkim-filter                               regular file       system_u:object_r:dkim_milter_exec_t:s0 
/usr/bin/opendkim                                  regular file       system_u:object_r:dkim_milter_exec_t:s0 
/usr/bin/opendmarc                                 regular file       system_u:object_r:dkim_milter_exec_t:s0 
/var/spool/opendkim(/.*)?                          all files          system_u:object_r:dkim_milter_data_t:s0 
/var/spool/opendmarc(/.*)?                         all files          system_u:object_r:dkim_milter_data_t:s0 

The problem appears to be that the dkim module is missing:

$ sudo semodule --list-modules=full | fgrep 'dkim'

In contrast:

$ sudo semodule --list-modules=full | fgrep 'milter'
100 milter               pp

Comment 2 Steve 2024-11-01 19:46:55 UTC
From https://github.com/fedora-selinux/selinux-policy/archive/refs/tags/v41.24.zip:

$ egrep -n 'dkim|milter' ./selinux-policy-41.24/dist/targeted/modules.conf
1377:# Module: milter
1381:milter = module

Comment 3 Anthony Messina 2024-11-02 14:43:21 UTC
(In reply to Steve from comment #1)
> I am not an selinux maintainer, but I noticed that the commit message says:
> 
> "Remove a few lines duplicated between {dkim,milter}.fc"
> 
> However, this is present in both files:
> 
> /var/spool/opendkim(/.*)?
> gen_context(system_u:object_r:dkim_milter_data_t,s0)
> 
> More to the point, there don't seem to be any file contexts from dkim.fc in
> selinux-policy-targeted-41.24-1.fc41.noarch:
> 
> $ sudo semanage fcontext -l | fgrep dkim
> /etc/mail/dkim-milter/keys(/.*)?                   all files         
> system_u:object_r:dkim_milter_private_key_t:s0 
> /run/opendmarc(/.*)?                               all files         
> system_u:object_r:dkim_milter_data_t:s0 
> /usr/bin/dkim-filter                               regular file      
> system_u:object_r:dkim_milter_exec_t:s0 
> /usr/bin/opendkim                                  regular file      
> system_u:object_r:dkim_milter_exec_t:s0 
> /usr/bin/opendmarc                                 regular file      
> system_u:object_r:dkim_milter_exec_t:s0 
> /var/spool/opendkim(/.*)?                          all files         
> system_u:object_r:dkim_milter_data_t:s0 
> /var/spool/opendmarc(/.*)?                         all files         
> system_u:object_r:dkim_milter_data_t:s0 
> 
> The problem appears to be that the dkim module is missing:
> 
> $ sudo semodule --list-modules=full | fgrep 'dkim'
> 
> In contrast:
> 
> $ sudo semodule --list-modules=full | fgrep 'milter'
> 100 milter               pp

That is also correct.  The entry for /run/opendkim(/.*)? is missing from the install and either updating milter.fc or ensuring the dkim policy is included could resolve the issue.

Comment 4 Anthony Messina 2025-01-11 16:36:16 UTC
Still present in selinux-policy-41.28-1.fc41.noarch

Please re-add the following to milter.fc, since it appears dkim isn't built in Fedora targeted policy

/run/opendkim(/.*)?         gen_context(system_u:object_r:dkim_milter_data_t,s0)

Comment 5 Anthony Messina 2025-02-11 17:46:11 UTC
This upstream pull request would resolve the issue: https://github.com/fedora-selinux/selinux-policy/pull/2447

Comment 6 Fedora Update System 2025-07-16 08:01:27 UTC
FEDORA-2025-37c20d2140 (selinux-policy-41.46-1.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-37c20d2140

Comment 7 Fedora Update System 2025-07-17 01:07:27 UTC
FEDORA-2025-37c20d2140 has been pushed to the Fedora 41 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-37c20d2140`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-37c20d2140

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Anthony Messina 2025-07-17 11:53:49 UTC
Will there be a Fedora 42 release with the same fix?

Comment 9 Anthony Messina 2025-07-17 12:08:43 UTC
(In reply to Anthony Messina from comment #8)
> Will there be a Fedora 42 release with the same fix?

Nevermind. It looks updated in F42.

Comment 10 Fedora Update System 2025-08-01 01:55:26 UTC
FEDORA-2025-37c20d2140 (selinux-policy-41.46-1.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.


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