Gentoo Archives: gentoo-commits

From: Patrick McLean <chutzpah@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dns/dnsmasq/, net-dns/dnsmasq/files/
Date: Wed, 01 Apr 2020 17:21:07
Message-Id: 1585761561.5d2cde891f94eed8019bde4deb0612af08cb0d30.chutzpah@gentoo
1 commit: 5d2cde891f94eed8019bde4deb0612af08cb0d30
2 Author: Allen-Webb <allenwebb <AT> google <DOT> com>
3 AuthorDate: Wed Apr 1 14:44:02 2020 +0000
4 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
5 CommitDate: Wed Apr 1 17:19:21 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5d2cde89
7
8 net-dns/dnsmasq-2.80-r2: Revbump, fix CVE-2019-14834
9
10 Bug: https://bugs.gentoo.org/715764
11 Signed-off-by: Allen-Webb <allenwebb <AT> google.com>
12 Closes: https://github.com/gentoo/gentoo/pull/15197
13 Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
14
15 ...smasq-2.80-r1.ebuild => dnsmasq-2.80-r2.ebuild} | 1 +
16 .../files/dnsmasq-2.80-cve-2019-14834.patch | 39 ++++++++++++++++++++++
17 2 files changed, 40 insertions(+)
18
19 diff --git a/net-dns/dnsmasq/dnsmasq-2.80-r1.ebuild b/net-dns/dnsmasq/dnsmasq-2.80-r2.ebuild
20 similarity index 98%
21 rename from net-dns/dnsmasq/dnsmasq-2.80-r1.ebuild
22 rename to net-dns/dnsmasq/dnsmasq-2.80-r2.ebuild
23 index ba0e02d6731..42e58c51d0b 100644
24 --- a/net-dns/dnsmasq/dnsmasq-2.80-r1.ebuild
25 +++ b/net-dns/dnsmasq/dnsmasq-2.80-r2.ebuild
26 @@ -56,6 +56,7 @@ REQUIRED_USE="dhcp-tools? ( dhcp )
27 PATCHES=(
28 "${FILESDIR}/dnsmasq-2.80-nettle-3.5.patch"
29 "${FILESDIR}/dnsmasq-2.80-linux-headers-5.2.patch"
30 + "${FILESDIR}/dnsmasq-2.80-cve-2019-14834.patch"
31 )
32
33 use_have() {
34
35 diff --git a/net-dns/dnsmasq/files/dnsmasq-2.80-cve-2019-14834.patch b/net-dns/dnsmasq/files/dnsmasq-2.80-cve-2019-14834.patch
36 new file mode 100644
37 index 00000000000..a44ceabece7
38 --- /dev/null
39 +++ b/net-dns/dnsmasq/files/dnsmasq-2.80-cve-2019-14834.patch
40 @@ -0,0 +1,39 @@
41 +Fix memory leak in helper.c
42 +
43 +Thanks to Xu Mingjie <xumingjie1995@×××××××.com> for spotting this.
44 +
45 +author: Simon Kelley <simon@××××××××××××××.uk>
46 +commit-url: http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=69bc94779c2f035a9fffdb5327a54c3aeca73ed5
47 +diff --git a/src/helper.c b/src/helper.c
48 +index 33ba120..c392eec 100644 (file)
49 +--- a/src/helper.c
50 ++++ b/src/helper.c
51 +@@ -80,7 +80,8 @@ int create_helper(int event_fd, int err_fd, uid_t uid, gid_t gid, long max_fd)
52 + pid_t pid;
53 + int i, pipefd[2];
54 + struct sigaction sigact;
55 +-
56 ++ unsigned char *alloc_buff = NULL;
57 ++
58 + /* create the pipe through which the main program sends us commands,
59 + then fork our process. */
60 + if (pipe(pipefd) == -1 || !fix_fd(pipefd[1]) || (pid = fork()) == -1)
61 +@@ -186,11 +187,16 @@ int create_helper(int event_fd, int err_fd, uid_t uid, gid_t gid, long max_fd)
62 + struct script_data data;
63 + char *p, *action_str, *hostname = NULL, *domain = NULL;
64 + unsigned char *buf = (unsigned char *)daemon->namebuff;
65 +- unsigned char *end, *extradata, *alloc_buff = NULL;
66 ++ unsigned char *end, *extradata;
67 + int is6, err = 0;
68 + int pipeout[2];
69 +
70 +- free(alloc_buff);
71 ++ /* Free rarely-allocated memory from previous iteration. */
72 ++ if (alloc_buff)
73 ++ {
74 ++ free(alloc_buff);
75 ++ alloc_buff = NULL;
76 ++ }
77 +
78 + /* we read zero bytes when pipe closed: this is our signal to exit */
79 + if (!read_write(pipefd[0], (unsigned char *)&data, sizeof(data), 1))