Bug 279780 - [patch] mail/opendmarc fix crash on FreeBSD >= 14.1
Summary: [patch] mail/opendmarc fix crash on FreeBSD >= 14.1
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Norikatsu Shigemura
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-16 07:44 UTC by Yasuhito FUTATSUKI
Modified: 2024-08-08 05:11 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (freebsd)


Attachments
a patch to add files/patch-libopendmarc_opendmarc__dns.c to mail/opendmarc port (956 bytes, patch)
2024-06-16 07:44 UTC, Yasuhito FUTATSUKI
leres: maintainer-approval? (freebsd)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yasuhito FUTATSUKI 2024-06-16 07:44:36 UTC
Created attachment 251493 [details]
a patch to add files/patch-libopendmarc_opendmarc__dns.c to mail/opendmarc port

After I upgraded FreeBSD from 14.0 to 14.1, opendmarc milter come to crash on every times when the MTA pass the message to the opendmarc milter.

[[[
Jun 13 02:36:40 mkii opendmarc[2179]: 45CHaefM002265: ignoring invalid ARC-Authentication-Results header "i=1;  mx1.freebsd.org;        none"
Jun 13 02:36:40 mkii opendmarc[2179]: 45CHaefM002265: SPF(mailfrom): FreeBSD.org fail
Jun 13 02:36:40 mkii opendmarc[2179]: OpenDMARC Filter: poll() returned exception for socket, abort
Jun 13 02:36:40 mkii kernel: pid 2179 (opendmarc), jid 0, uid 26: exited on signal 6 (no core dump - bad address
]]]

It seems it was caused by the Github's issue #245 (https://github.com/trusteddomainproject/OpenDMARC/issues/245).

Before FreeBSD 14.1, it was not triggered because configure script cannot find res_ninit() because of another issue #257 (https://github.com/trusteddomainproject/OpenDMARC/issues/257), thus the code was not active.

The patch brought from the issue #245 seems to work for me.
Comment 1 Norikatsu Shigemura freebsd_committer freebsd_triage 2024-06-23 12:51:30 UTC
Hi Dan Mahoney! How about it?
Comment 2 Craig Leres freebsd_committer freebsd_triage 2024-06-29 00:38:30 UTC
The patch tests good for me with 14.1-RELEASE-p1. This is a huge improvement over my previous solution (restart opendmarc from a loop in a /bin/sh script...)
Comment 3 Yasuhito FUTATSUKI 2024-06-29 10:58:41 UTC
(In reply to Craig Leres from comment #2)
> ... This is a huge improvement over my previous solution (restart opendmarc from a loop in a /bin/sh script...)

It is off topic, but "AutoRestart true" in opendmarc.conf may help such situation.
I've set the configuration paramter for this issue, but I still keep it to prepare unwilling crash of opedmarc milter for the issue #183 on GitHub (https://github.com/trusteddomainproject/OpenDMARC/issues/183) or other reasons(, although I locally applied the patch addressed to #183).
Comment 4 Craig Leres freebsd_committer freebsd_triage 2024-06-29 15:56:21 UTC
(In reply to Yasuhito FUTATSUKI from comment #3)
I noticed the auto restart feature but given that it was crashing ever 5-10 minutes I was worried it would get into a hard loop and hurt something; the loop script I wrote had a "sleep 30" in it.
Comment 5 John R 2024-07-24 15:18:04 UTC
Patch works great, thanks for posting, would be great to have this pushed forward.
Comment 6 Craig Leres freebsd_committer freebsd_triage 2024-07-24 15:59:42 UTC
(In reply to John R from comment #5)
I agree, I've been running with it for 4+ weeks with no issues.
Comment 7 John R 2024-08-03 17:46:25 UTC
I believe the importance and impact of this bug needs elevated as it actually affects everyone using DMARC on a 14.1-RELEASE system not just an individual. Maybe explains why is has received no traction from the maintainer so far.
Comment 8 Craig Leres freebsd_committer freebsd_triage 2024-08-03 20:11:56 UTC
Comment on attachment 251493 [details]
a patch to add files/patch-libopendmarc_opendmarc__dns.c to mail/opendmarc port

Request maintainer approval on the patchset so it may be applied via maintainer timeout if there is no response within the next two weeks.
Comment 9 commit-hook freebsd_committer freebsd_triage 2024-08-08 05:06:59 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e6b99be61e8c429e9a2e1e20b6da40e643889630

commit e6b99be61e8c429e9a2e1e20b6da40e643889630
Author:     Yasuhito FUTATSUKI <freebsd-bug-report-yf@yf.bsdclub.org>
AuthorDate: 2024-08-08 05:05:22 +0000
Commit:     Norikatsu Shigemura <nork@FreeBSD.org>
CommitDate: 2024-08-08 05:05:22 +0000

    mail/opendmarc: Fix crash on FreeBSD >= 14.1

    PR:             279780
    Obtained from:  https://github.com/trusteddomainproject/OpenDMARC/issues/245
    Tested by:      leres, John R <gamer@ryppn.com>
    Approved by:    hrs (mentor), maintainer timeout (6 weeks)

 mail/opendmarc/Makefile                                        |  2 +-
 mail/opendmarc/files/patch-libopendmarc_opendmarc__dns.c (new) | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)
Comment 10 Norikatsu Shigemura freebsd_committer freebsd_triage 2024-08-08 05:11:05 UTC
Sorry, too late.  I committed, thanks!