2
0
mirror of https://codeberg.org/kiss-community/repo synced 2024-12-22 07:10:16 -07:00

busybox: CVE-2022-28391 patch

This commit is contained in:
Owen Rafferty 2022-05-12 23:01:50 -05:00
parent ce0d101b7d
commit a9c29b8514
No known key found for this signature in database
GPG Key ID: A68B10E2554DEBCB
4 changed files with 77 additions and 1 deletions

View File

@ -1,4 +1,5 @@
611344ae01258592e84f6d85c917394dec1f21cd03a5075a62c3c012a368d15c
1939646eddbd250c295aafc125ef19d5f916a143482bbb07764888ecbfa0ba26
09c2f601fec4e5c10664c22f787dafb9424efe219bf826727c356da90dfd60d5
8d84b1719dca2a751c09072c20cd782a3c47f119a68d35316f89d851daf67b88
0f54301a73af461e8066bc805b48d991cfed513d08a2f036e015b19f97cb424a

View File

@ -0,0 +1,74 @@
diff --git a/libbb/xconnect.c b/libbb/xconnect.c
index 0e0b247b8..02c061e67 100644
--- a/libbb/xconnect.c
+++ b/libbb/xconnect.c
@@ -497,8 +497,9 @@ static char* FAST_FUNC sockaddr2str(const struct sockaddr *sa, int flags)
);
if (rc)
return NULL;
+ /* ensure host contains only printable characters */
if (flags & IGNORE_PORT)
- return xstrdup(host);
+ return xstrdup(printable_string(host));
#if ENABLE_FEATURE_IPV6
if (sa->sa_family == AF_INET6) {
if (strchr(host, ':')) /* heh, it's not a resolved hostname */
@@ -509,7 +510,7 @@ static char* FAST_FUNC sockaddr2str(const struct sockaddr *sa, int flags)
#endif
/* For now we don't support anything else, so it has to be INET */
/*if (sa->sa_family == AF_INET)*/
- return xasprintf("%s:%s", host, serv);
+ return xasprintf("%s:%s", printable_string(host), serv);
/*return xstrdup(host);*/
}
diff --git a/networking/nslookup.c b/networking/nslookup.c
index 6da97baf4..4bdcde1b8 100644
--- a/networking/nslookup.c
+++ b/networking/nslookup.c
@@ -407,7 +407,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len)
//printf("Unable to uncompress domain: %s\n", strerror(errno));
return -1;
}
- printf(format, ns_rr_name(rr), dname);
+ printf(format, ns_rr_name(rr), printable_string(dname));
break;
case ns_t_mx:
@@ -422,7 +422,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len)
//printf("Cannot uncompress MX domain: %s\n", strerror(errno));
return -1;
}
- printf("%s\tmail exchanger = %d %s\n", ns_rr_name(rr), n, dname);
+ printf("%s\tmail exchanger = %d %s\n", ns_rr_name(rr), n, printable_string(dname));
break;
case ns_t_txt:
@@ -434,7 +434,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len)
if (n > 0) {
memset(dname, 0, sizeof(dname));
memcpy(dname, ns_rr_rdata(rr) + 1, n);
- printf("%s\ttext = \"%s\"\n", ns_rr_name(rr), dname);
+ printf("%s\ttext = \"%s\"\n", ns_rr_name(rr), printable_string(dname));
}
break;
@@ -454,7 +454,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len)
}
printf("%s\tservice = %u %u %u %s\n", ns_rr_name(rr),
- ns_get16(cp), ns_get16(cp + 2), ns_get16(cp + 4), dname);
+ ns_get16(cp), ns_get16(cp + 2), ns_get16(cp + 4), printable_string(dname));
break;
case ns_t_soa:
@@ -483,7 +483,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len)
return -1;
}
- printf("\tmail addr = %s\n", dname);
+ printf("\tmail addr = %s\n", printable_string(dname));
cp += n;
printf("\tserial = %lu\n", ns_get32(cp));

View File

@ -1,4 +1,5 @@
https://git.busybox.net/busybox/snapshot/busybox-MAJOR_MINOR_PATCH.tar.bz2
patches/CVE-2022-28391.patch patch
patches/adduser-no-setgid.patch patch
patches/fsck-resolve-uuid.patch patch
patches/modprobe-kernel-version.patch patch

View File

@ -1 +1 @@
1.35.0 2
1.35.0 3