!21 Synchronize some bugfix patches from upstream community
From: @zengwefeng Reviewed-by: @seuzw Signed-off-by: @seuzw
This commit is contained in:
commit
24afa00d93
@ -0,0 +1,71 @@
|
|||||||
|
From 824461192ca5098043f9ca4ddeba7df1f65b30ba Mon Sep 17 00:00:00 2001
|
||||||
|
From: Simon Kelley <simon@thekelleys.org.uk>
|
||||||
|
Date: Sun, 15 Nov 2020 22:13:25 +0000
|
||||||
|
Subject: [PATCH] Add missing check for NULL return from allocate_rfd().
|
||||||
|
|
||||||
|
Conflict:NA
|
||||||
|
Reference:https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=824461192ca5098043f9ca4ddeba7df1f65b30ba
|
||||||
|
---
|
||||||
|
src/forward.c | 18 ++++++++++--------
|
||||||
|
1 file changed, 10 insertions(+), 8 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/forward.c b/src/forward.c
|
||||||
|
index 4f9a963..50da095 100644
|
||||||
|
--- a/src/forward.c
|
||||||
|
+++ b/src/forward.c
|
||||||
|
@@ -823,7 +823,6 @@ void reply_query(int fd, int family, time_t now)
|
||||||
|
int is_sign;
|
||||||
|
|
||||||
|
#ifdef HAVE_DNSSEC
|
||||||
|
- /* For DNSSEC originated queries, just retry the query to the same server. */
|
||||||
|
if (forward->flags & (FREC_DNSKEY_QUERY | FREC_DS_QUERY))
|
||||||
|
{
|
||||||
|
struct server *start;
|
||||||
|
@@ -849,6 +848,8 @@ void reply_query(int fd, int family, time_t now)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
+ fd = -1;
|
||||||
|
+
|
||||||
|
if (start->sfd)
|
||||||
|
fd = start->sfd->fd;
|
||||||
|
else
|
||||||
|
@@ -856,19 +857,21 @@ void reply_query(int fd, int family, time_t now)
|
||||||
|
if (start->addr.sa.sa_family == AF_INET6)
|
||||||
|
{
|
||||||
|
/* may have changed family */
|
||||||
|
- if (!forward->rfd6)
|
||||||
|
- forward->rfd6 = allocate_rfd(AF_INET6);
|
||||||
|
- fd = forward->rfd6->fd;
|
||||||
|
+ if (forward->rfd6 || (forward->rfd6 = allocate_rfd(AF_INET6)))
|
||||||
|
+ fd = forward->rfd6->fd;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* may have changed family */
|
||||||
|
- if (!forward->rfd4)
|
||||||
|
- forward->rfd4 = allocate_rfd(AF_INET);
|
||||||
|
- fd = forward->rfd4->fd;
|
||||||
|
+ if (forward->rfd4 || (forward->rfd4 = allocate_rfd(AF_INET)))
|
||||||
|
+ fd = forward->rfd4->fd;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /* Can't get socket. */
|
||||||
|
+ if (fd == -1)
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
#ifdef HAVE_DUMPFILE
|
||||||
|
dump_packet(DUMP_SEC_QUERY, (void *)header, (size_t)plen, NULL, &start->addr);
|
||||||
|
#endif
|
||||||
|
@@ -2311,7 +2314,6 @@ struct frec *get_new_frec(time_t now, int *wait, struct frec *force)
|
||||||
|
return f; /* OK if malloc fails and this is NULL */
|
||||||
|
}
|
||||||
|
|
||||||
|
-/* crc is all-ones if not known. */
|
||||||
|
static struct frec *lookup_frec(unsigned short id, int fd, int family, void *hash)
|
||||||
|
{
|
||||||
|
struct frec *f;
|
||||||
|
--
|
||||||
|
2.23.0
|
||||||
|
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
From 1eb6cedb03cb335071fda22ee7c623b2298d3729 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Simon Kelley <simon@thekelleys.org.uk>
|
||||||
|
Date: Sat, 14 Nov 2020 15:29:34 +0000
|
||||||
|
Subject: [PATCH] Fix DNS reply when asking for DNSSEC and a validated CNAME is
|
||||||
|
already cached.
|
||||||
|
|
||||||
|
Conflict:NA
|
||||||
|
Reference:https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=1eb6cedb03cb335071fda22ee7c623b2298d3729
|
||||||
|
---
|
||||||
|
src/rfc1035.c | 2 ++
|
||||||
|
1 file changed, 2 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/rfc1035.c b/src/rfc1035.c
|
||||||
|
index a8cdc6e..79af53f 100644
|
||||||
|
--- a/src/rfc1035.c
|
||||||
|
+++ b/src/rfc1035.c
|
||||||
|
@@ -1359,6 +1359,8 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
+ else
|
||||||
|
+ return 0; /* give up if any cached CNAME in chain can't be used for DNSSEC reasons. */
|
||||||
|
|
||||||
|
strcpy(name, cname_target);
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.23.0
|
||||||
|
|
||||||
11
dnsmasq.spec
11
dnsmasq.spec
@ -1,6 +1,6 @@
|
|||||||
Name: dnsmasq
|
Name: dnsmasq
|
||||||
Version: 2.82
|
Version: 2.82
|
||||||
Release: 4
|
Release: 5
|
||||||
Summary: Dnsmasq provides network infrastructure for small networks
|
Summary: Dnsmasq provides network infrastructure for small networks
|
||||||
License: GPLv2 or GPLv3
|
License: GPLv2 or GPLv3
|
||||||
URL: http://www.thekelleys.org.uk/dnsmasq/
|
URL: http://www.thekelleys.org.uk/dnsmasq/
|
||||||
@ -19,6 +19,8 @@ Patch8: backport-CVE-2020-25685_2.patch
|
|||||||
Patch9: backport-CVE-2020-25686_1.patch
|
Patch9: backport-CVE-2020-25686_1.patch
|
||||||
Patch10: backport-CVE-2020-25686_2.patch
|
Patch10: backport-CVE-2020-25686_2.patch
|
||||||
Patch11: backport-fix-regression-in-s_config_in_context-method.patch
|
Patch11: backport-fix-regression-in-s_config_in_context-method.patch
|
||||||
|
Patch12: backport-Add-missing-check-for-NULL-return-from-allocate_rfd.patch
|
||||||
|
Patch13: backport-Fix-DNS-reply-when-asking-for-DNSSEC-and-a-validated.patch
|
||||||
|
|
||||||
BuildRequires: dbus-devel pkgconfig libidn2-devel nettle-devel systemd
|
BuildRequires: dbus-devel pkgconfig libidn2-devel nettle-devel systemd
|
||||||
Requires: nettle >= 3.4
|
Requires: nettle >= 3.4
|
||||||
@ -111,6 +113,13 @@ install -Dpm644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysusersdir}/dnsmasq.conf
|
|||||||
%{_mandir}/man8/dnsmasq*
|
%{_mandir}/man8/dnsmasq*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Feb 25 2021 zengwefeng <zwfeng@huawei.com> - 2.82-5
|
||||||
|
- Type:bugfix
|
||||||
|
- Id:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC:Add missing check for NULL return from allocate_rfd
|
||||||
|
Fix DNS reply when asking for DNSSEC
|
||||||
|
|
||||||
* Thu Jan 21 2021 zhujh <zhujunhao8@huawei.com> - 2.82-4
|
* Thu Jan 21 2021 zhujh <zhujunhao8@huawei.com> - 2.82-4
|
||||||
- Type:bugfix
|
- Type:bugfix
|
||||||
- Id:NA
|
- Id:NA
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user