aboutsummaryrefslogtreecommitdiffstats
path: root/toolchain/uClibc/patches-0.9.31/000-upstream-fix_usage_of_uninitialized_DNS_parameters.patch
diff options
context:
space:
mode:
authorAlexandros C. Couloumbis <alex@ozo.com>2010-11-18 14:58:37 +0000
committerAlexandros C. Couloumbis <alex@ozo.com>2010-11-18 14:58:37 +0000
commit2c24f3ae2f026b5dba248985f0efc80cadcf43f6 (patch)
tree36f98cb56900b7d8514ec4b0a198abe243dc1f90 /toolchain/uClibc/patches-0.9.31/000-upstream-fix_usage_of_uninitialized_DNS_parameters.patch
parent123048f3caaa6f0b3b7d49cb018516926f97ed23 (diff)
downloadupstream-2c24f3ae2f026b5dba248985f0efc80cadcf43f6.tar.gz
upstream-2c24f3ae2f026b5dba248985f0efc80cadcf43f6.tar.bz2
upstream-2c24f3ae2f026b5dba248985f0efc80cadcf43f6.zip
toolchain/uClibc: push some upstream patches for uClibc-0.9.31. should resolve isses of #8269
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@24029 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'toolchain/uClibc/patches-0.9.31/000-upstream-fix_usage_of_uninitialized_DNS_parameters.patch')
-rw-r--r--toolchain/uClibc/patches-0.9.31/000-upstream-fix_usage_of_uninitialized_DNS_parameters.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/toolchain/uClibc/patches-0.9.31/000-upstream-fix_usage_of_uninitialized_DNS_parameters.patch b/toolchain/uClibc/patches-0.9.31/000-upstream-fix_usage_of_uninitialized_DNS_parameters.patch
new file mode 100644
index 0000000000..c33614afd7
--- /dev/null
+++ b/toolchain/uClibc/patches-0.9.31/000-upstream-fix_usage_of_uninitialized_DNS_parameters.patch
@@ -0,0 +1,40 @@
+From c602079e5b7ba998d1dd6cae4a305af80e6cba52 Mon Sep 17 00:00:00 2001
+From: Gabor Juhos <juhosg@openwrt.org>
+Date: Tue, 23 Mar 2010 08:35:27 +0100
+Subject: [PATCH] Fix use-after-free bug in __dns_lookup.
+
+If the type of the first answer does not match with the requested type,
+then the dotted name will be freed. If there are no further answers in
+the DNS reply, this pointer will be used later on in the same function.
+Additionally it is passed to the caller, and may cause strange behaviour.
+
+For example, the following busybox commands are triggering a segmentation
+fault with uClibc 0.9.30.x
+
+ - nslookup ipv6.google.com
+ - ping ipv6.google.com
+ - wget http//ipv6.google.com/
+
+Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
+
+---
+
+See https://dev.openwrt.org/ticket/6886 for a testcase
+---
+ libc/inet/resolv.c | 4 +---
+ 1 files changed, 1 insertions(+), 3 deletions(-)
+
+--- a/libc/inet/resolv.c
++++ b/libc/inet/resolv.c
+@@ -1517,10 +1517,8 @@ int attribute_hidden __dns_lookup(const
+ memcpy(a, &ma, sizeof(ma));
+ if (a->atype != T_SIG && (NULL == a->buf || (type != T_A && type != T_AAAA)))
+ break;
+- if (a->atype != type) {
+- free(a->dotted);
++ if (a->atype != type)
+ continue;
+- }
+ a->add_count = h.ancount - j - 1;
+ if ((a->rdlength + sizeof(struct in_addr*)) * a->add_count > a->buflen)
+ break;