diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2019-11-04 18:08:54 +0100 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2019-11-04 18:12:25 +0100 |
commit | 32c99203aee1205312ffa8febca171556b559370 (patch) | |
tree | a6d2d94bf135700bda91a7ee719dac3a5459d21f /main/opensmtpd | |
parent | cac4506ff02b575c4dae4f780b6639e470bbca78 (diff) | |
download | aports-32c99203aee1205312ffa8febca171556b559370.tar.bz2 aports-32c99203aee1205312ffa8febca171556b559370.tar.xz |
main/opensmtpd: fix random crashes due to freeaddrinfo()
See https://github.com/OpenSMTPD/OpenSMTPD/issues/929#issuecomment-549420229
Diffstat (limited to 'main/opensmtpd')
-rw-r--r-- | main/opensmtpd/APKBUILD | 6 | ||||
-rw-r--r-- | main/opensmtpd/musl-compat-freeaddrinfo.patch | 71 |
2 files changed, 75 insertions, 2 deletions
diff --git a/main/opensmtpd/APKBUILD b/main/opensmtpd/APKBUILD index 02bde24083..3d032ad131 100644 --- a/main/opensmtpd/APKBUILD +++ b/main/opensmtpd/APKBUILD @@ -4,7 +4,7 @@ # Maintainer: Jakub Jirutka <jakub@jirutka.cz> pkgname=opensmtpd pkgver=6.4.2p1 -pkgrel=1 +pkgrel=2 pkgdesc="Secure, reliable, lean, and easy-to configure SMTP server" url="http://www.opensmtpd.org" arch="all" @@ -19,6 +19,7 @@ source="https://www.opensmtpd.org/archives/$pkgname-$pkgver.tar.gz aliases autoconf-decl-checks.patch smtpd.conf.patch + musl-compat-freeaddrinfo.patch " options="suid !check" @@ -60,4 +61,5 @@ sha512sums="45b071523a46c441fd436acee44ea841a88ebe93f6b76284ef948fc97535cf73a296 a53c9854f71e55011566d3c96ce6321e11d00706c4180eb8ec4358b38c97d63cb7fcf3bb3c0b69365a8568a385bdb3ec1bc700d5f4463f8d6695a3d46b283c1d smtpd.initd 51d47b34eb3d728daa45f29d6434cc75db28dfa69b6fb3ecd873121df85b296a2d2c81016d765a07778aa26a496e4b29c09a30b82678cf42596a536734b5deca aliases 37104cc605569f142ceffa902f200e8a7e9e1114ebe5394ed1eac0ed6ce25454e1610270921c45246de8396eee04b7c8ab5a112a231036a6ef14e7e229b264e3 autoconf-decl-checks.patch -14ff3d4f56aee3a31551ea535c4a5bf9b760f0f11bc269225d7b176d5031294716133cbf4555a92e76cc6e33de89454435562672ddaf1ab365e61085eb1e4d53 smtpd.conf.patch" +14ff3d4f56aee3a31551ea535c4a5bf9b760f0f11bc269225d7b176d5031294716133cbf4555a92e76cc6e33de89454435562672ddaf1ab365e61085eb1e4d53 smtpd.conf.patch +074009ab96caea082c5c39dd548659d46399ece20717313f240be3941ae5c5a7130bccf0de6fd13be3c7253782c5477f631d73124218eecf1ebec747d0318f6d musl-compat-freeaddrinfo.patch" diff --git a/main/opensmtpd/musl-compat-freeaddrinfo.patch b/main/opensmtpd/musl-compat-freeaddrinfo.patch new file mode 100644 index 0000000000..da05e19a3e --- /dev/null +++ b/main/opensmtpd/musl-compat-freeaddrinfo.patch @@ -0,0 +1,71 @@ +Gilles Chehade: + A recent change in musl's freeaddrinfo() causes it to no longer be + NULL-safe and segv when passed a NULL pointer. + For the next release, I think the only solution for Alpine is to ship a + patch in their package to NULL-protect all freeaddrinfo() calls until + we sort out if this is going to stay or be reverted, or at the very + least until the next major release if we decide to NULL-protect + upstream. + +See https://github.com/OpenSMTPD/OpenSMTPD/issues/929#issuecomment-549420229 + +--- a/smtpd/dns.c ++++ b/smtpd/dns.c +@@ -115,7 +115,8 @@ + *sl = res->ai_addrlen; + } + +- freeaddrinfo(res); ++ if (res) ++ freeaddrinfo(res); + return (1); + } + +--- a/smtpd/mail.lmtp.c ++++ b/smtpd/mail.lmtp.c +@@ -168,7 +168,8 @@ + break; + } + +- freeaddrinfo(res0); ++ if (res0) ++ freeaddrinfo(res0); + if (s == -1) + errx(EX_TEMPFAIL, "%s", cause); + +--- a/smtpd/parse.y ++++ b/smtpd/parse.y +@@ -2397,7 +2397,8 @@ + cnt++; + } + +- freeaddrinfo(res0); ++ if (res0) ++ freeaddrinfo(res0); + return (cnt); + } + +--- a/smtpd/resolver.c ++++ b/smtpd/resolver.c +@@ -334,7 +334,8 @@ + m_add_int(s->proc, ar->ar_errno); + m_close(s->proc); + +- freeaddrinfo(ar->ar_addrinfo); ++ if (ar->ar_addrinfo) ++ freeaddrinfo(ar->ar_addrinfo); + free(s); + } + +--- a/smtpd/util.c ++++ b/smtpd/util.c +@@ -782,7 +782,8 @@ + return -1; + } + +- freeaddrinfo(res); ++ if (res) ++ freeaddrinfo(res); + return 0; + } + |