2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

Merge branch 'marka-fuzz-fixes' into 'main'

Add issues found by dns_rdata_fromwiretext fuzzer.

See merge request isc-projects/bind9!3953
This commit is contained in:
Mark Andrews
2020-08-13 14:08:50 +00:00
160 changed files with 80 additions and 15 deletions

2
.gitattributes vendored
View File

@@ -1,6 +1,8 @@
*.sln.in eol=crlf
*.vcxproj.* eol=crlf
/fuzz/dns_rdata_fromwire_text.in/input-* -text
.gitignore export-ignore
/conftools export-ignore
/doc/design export-ignore

View File

@@ -1,3 +1,11 @@
5489. [bug] Named failed to reject some invalid records resulting
in records that, after being printed, could not be
loaded or would result in DNSSEC validation failures
when re-read from zone files as the wire format
differed. The covered records records are: CERT,
IPSECKEY, NSEC3, NSEC3PARAM, NXT, SIG, TLSA, WKS, and
X25. [GL !3953]
5488. [bug] nta needed to have a weak reference on view to prevent
the view being deleted while nta tests are being
performed. [GL #2067]

View File

@@ -59,13 +59,21 @@ LLVMFuzzerInitialize(int *argc __attribute__((unused)),
static void
nullmsg(dns_rdatacallbacks_t *cb, const char *fmt, ...) {
va_list args;
UNUSED(cb);
UNUSED(fmt);
if (debug) {
va_start(args, fmt);
vfprintf(stderr, fmt, args);
fprintf(stderr, "\n");
va_end(args);
}
}
int
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
char totext[1024];
char totext[64 * 1044 * 4];
dns_compress_t cctx;
dns_decompress_t dctx;
dns_rdatatype_t rdtype;
@@ -113,10 +121,15 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
rdclass = classlist[(*data++) % classes];
size--;
if (debug) {
fprintf(stderr, "type=%u, class=%u\n", rdtype, rdclass);
}
dns_rdatacallbacks_init(&callbacks);
callbacks.warn = callbacks.error = nullmsg;
dns_decompress_init(&dctx, -1, DNS_DECOMPRESS_ANY);
/* Disallow decompression as we are reading a packet */
dns_decompress_init(&dctx, -1, DNS_DECOMPRESS_NONE);
isc_buffer_constinit(&source, data, size);
isc_buffer_add(&source, size);
@@ -129,14 +142,20 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
*/
CHECK(dns_rdata_fromwire(&rdata1, rdclass, rdtype, &source, &dctx, 0,
&target));
assert(rdata1.length == size);
/*
* Convert to text from wire.
*/
isc_buffer_init(&target, totext, sizeof(totext));
isc_buffer_init(&target, totext, sizeof(totext) - 1);
result = dns_rdata_totext(&rdata1, NULL, &target);
assert(result == ISC_R_SUCCESS);
/*
* Make debugging easier by NUL terminating.
*/
totext[isc_buffer_usedlength(&target)] = 0;
/*
* Convert to wire from text.
*/

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1 @@
d$3<><33>

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1 @@
d<EFBFBD>#<23><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><10>Į<EFBFBD><C4AE><EFBFBD><EFBFBD>d<EFBFBD><64><EFBFBD><EFBFBD><EFBFBD>d

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1 @@
4A-<2D>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1 @@
d<06><>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1 @@


Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1 @@
<EFBFBD>˛<EFBFBD>

View File

@@ -0,0 +1 @@
<EFBFBD>|8<><38><EFBFBD>|<7C>|8<>|<7C>|8

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1 @@
<13>(

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More