aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDermot Bradley <dermot_bradley@yahoo.com>2023-10-05 16:47:30 +0100
committerptrcnull <git@ptrcnull.me>2023-10-06 11:30:53 +0200
commitd82f20546c93252a8c94b262f7100bc8b74d6050 (patch)
tree8b11534514cb1facd2ce313b2529572fc92d2c1d
parent73f8c73a59feee4678c033fb78e86c820645636b (diff)
main/musl: handle DNS responses with 64+ IP address records
This was discussed on the #musl IRC channel. A legacy check returns an error when more than 63 IP addresses are returned in a DNS response. This patch removes that check & error. Fixes #15320
-rw-r--r--main/musl/APKBUILD4
-rw-r--r--main/musl/remove-dns-63-records-limit.patch27
2 files changed, 30 insertions, 1 deletions
diff --git a/main/musl/APKBUILD b/main/musl/APKBUILD
index f18f0b6ae18..c59bf388972 100644
--- a/main/musl/APKBUILD
+++ b/main/musl/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=musl
pkgver=1.2.4
-pkgrel=1
+pkgrel=2
pkgdesc="the musl c library (libc) implementation"
url="https://musl.libc.org/"
arch="all"
@@ -31,6 +31,7 @@ source="musl-$_commit.tar.gz::https://git.musl-libc.org/cgit/musl/snapshot/$_com
4-printf-buffer.patch
5-dns-size.patch
6-dns-pointer.patch
+ remove-dns-63-records-limit.patch
ldconfig
__stack_chk_fail_local.c
@@ -188,6 +189,7 @@ a76f79b801497ad994746cf82bb6eaf86f9e1ae646e6819fbae8532a7f4eee53a96ac1d4e789ec8f
61471bf46cb04e24334cc6fec84f52f30eb72e5a804d9e812100b18c57326ec7bd9abf3651b7565841c9fe624a0c1788ceb86b27911f4067c930416a6881b3f5 4-printf-buffer.patch
43ae7af80cbeba88489279e925cd88ab33999b60f75b84f91d6d753fb59473d455ba32480c6b6bbb9d8c3c303a2149b055c0bdb605c62fed8f1049987a21973f 5-dns-size.patch
c8e51e1db30e15cf7822b8ae5af3a0bdcf9ae86f086fc07e4f49b642fcc530eeb8b9c263c84e9f9c5bd1e93badf81697bf18591c0ba5b3dfb95a83ccd5861860 6-dns-pointer.patch
+088620aeeea1a407a103728f839d21c10c830820e1dae970edd70282534758d7fdb6d1d2d2761ccecac7a3e56ffb79c7b7085f3fe80a01d324d7bc0d94bb15f7 remove-dns-63-records-limit.patch
8d3a2d5315fc56fee7da9abb8b89bb38c6046c33d154c10d168fb35bfde6b0cf9f13042a3bceee34daf091bc409d699223735dcf19f382eeee1f6be34154f26f ldconfig
062bb49fa54839010acd4af113e20f7263dde1c8a2ca359b5fb2661ef9ed9d84a0f7c3bc10c25dcfa10bb3c5a4874588dff636ac43d5dbb3d748d75400756d0b __stack_chk_fail_local.c
0d80f37b34a35e3d14b012257c50862dfeb9d2c81139ea2dfa101d981d093b009b9fa450ba27a708ac59377a48626971dfc58e20a3799084a65777a0c32cbc7d getconf.c
diff --git a/main/musl/remove-dns-63-records-limit.patch b/main/musl/remove-dns-63-records-limit.patch
new file mode 100644
index 00000000000..610672c0b41
--- /dev/null
+++ b/main/musl/remove-dns-63-records-limit.patch
@@ -0,0 +1,27 @@
+Date: Wed, 4 Oct 2023 21:29:43 +0200
+From: Quentin Rameau <quinq@fifth.space>
+To: musl@lists.openwall.com
+Subject: [PATCH] Remove arbitrary limit from NS resolution
+
+The name resolution would abort when getting more than 63 records per
+request, due to what seems to be a left-over from the original code.
+
+Somehow reported by Daniel Stefanik[0].
+
+[0] https://gitlab.alpinelinux.org/alpine/aports/-/issues/15320
+---
+ src/network/dns_parse.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/network/dns_parse.c b/src/network/dns_parse.c
+index ea1ec126..09813112 100644
+--- a/src/network/dns_parse.c
++++ b/src/network/dns_parse.c
+@@ -12,7 +12,6 @@ int __dns_parse(const unsigned char *r, int rlen, int (*callback)(void *, int, c
+ p = r+12;
+ qdcount = r[4]*256 + r[5];
+ ancount = r[6]*256 + r[7];
+- if (qdcount+ancount > 64) return -1;
+ while (qdcount--) {
+ while (p-r < rlen && *p-1U < 127) p++;
+ if (p>r+rlen-6)