diff --git a/fuzz/.gitignore b/fuzz/.gitignore index 78c8720ac4..2f9818c6ec 100644 --- a/fuzz/.gitignore +++ b/fuzz/.gitignore @@ -3,6 +3,7 @@ /dns_master_load /dns_message_parse /dns_name_fromtext_target +/dns_rdata_fromtext /dns_rdata_fromwire_text /isc_lex_getmastertoken /isc_lex_gettoken diff --git a/fuzz/Makefile.am b/fuzz/Makefile.am index 1088f2d7d7..d82f8c359b 100644 --- a/fuzz/Makefile.am +++ b/fuzz/Makefile.am @@ -22,6 +22,7 @@ check_PROGRAMS = \ dns_master_load \ dns_message_parse \ dns_name_fromtext_target \ + dns_rdata_fromtext \ dns_rdata_fromwire_text \ isc_lex_getmastertoken \ isc_lex_gettoken @@ -30,6 +31,7 @@ EXTRA_DIST = \ dns_master_load.in \ dns_message_parse.in \ dns_name_fromtext_target.in \ + dns_rdata_fromtext.in \ dns_rdata_fromwire_text.in \ isc_lex_getmastertoken.in \ isc_lex_gettoken.in diff --git a/fuzz/dns_name_fromtext_target.c b/fuzz/dns_name_fromtext_target.c index c4f32756ea..ba9c7ab2a2 100644 --- a/fuzz/dns_name_fromtext_target.c +++ b/fuzz/dns_name_fromtext_target.c @@ -24,13 +24,9 @@ bool debug = false; -static isc_mem_t *mctx = NULL; - int LLVMFuzzerInitialize(int *argc __attribute__((unused)), char ***argv __attribute__((unused))) { - isc_mem_create(&mctx); - RUNTIME_CHECK(dst_lib_init(mctx, NULL) == ISC_R_SUCCESS); return (0); } @@ -40,10 +36,6 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { isc_result_t result; dns_fixedname_t origin; - if (size < 5) { - return (0); - } - dns_fixedname_init(&origin); isc_buffer_constinit(&buf, data, size); @@ -52,6 +44,9 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { result = dns_name_fromtext(dns_fixedname_name(&origin), &buf, dns_rootname, 0, NULL); - UNUSED(result); + if (debug) { + fprintf(stderr, "dns_name_fromtext: %s\n", + isc_result_totext(result)); + } return (0); } diff --git a/fuzz/dns_rdata_fromtext.c b/fuzz/dns_rdata_fromtext.c new file mode 100644 index 0000000000..b52a18f276 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.c @@ -0,0 +1,151 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * SPDX-License-Identifier: MPL-2.0 + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, you can obtain one at https://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "fuzz.h" + +bool debug = false; + +int +LLVMFuzzerInitialize(int *argc, char ***argv) { + UNUSED(argc); + UNUSED(argv); + return (0); +} + +/* following code was copied from named-rrchecker */ +isc_lexspecials_t specials = { ['('] = 1, [')'] = 1, ['"'] = 1 }; + +int +LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { + isc_mem_t *mctx = NULL; + isc_mem_create(&mctx); + + isc_lex_t *lex = NULL; + isc_token_t token; + + isc_result_t result; + unsigned int options = 0; + dns_rdatatype_t rdtype; + dns_rdataclass_t rdclass; + + char wiredata[64 * 1024]; + isc_buffer_t wirebuf; + isc_buffer_init(&wirebuf, wiredata, sizeof(wiredata)); + + dns_rdata_t rdata = DNS_RDATA_INIT; + dns_name_t *name = NULL; + + isc_buffer_t inbuf; + isc_buffer_constinit(&inbuf, data, size); + isc_buffer_add(&inbuf, size); + isc_buffer_setactive(&inbuf, size); + + RUNTIME_CHECK(isc_lex_create(mctx, 256, &lex) == ISC_R_SUCCESS); + + /* + * Set up to lex DNS master file. + */ + isc_lex_setspecials(lex, specials); + options = ISC_LEXOPT_EOL; + isc_lex_setcomments(lex, ISC_LEXCOMMENT_DNSMASTERFILE); + + RUNTIME_CHECK(isc_lex_openbuffer(lex, &inbuf) == ISC_R_SUCCESS); + + result = isc_lex_gettoken(lex, options | ISC_LEXOPT_NUMBER, &token); + if (result != ISC_R_SUCCESS) { + goto cleanup; + } + if (token.type == isc_tokentype_eof) { + goto cleanup; + } + if (token.type == isc_tokentype_eol) { + goto cleanup; + } + /* + * Get class. + */ + if (token.type == isc_tokentype_number) { + if (token.value.as_ulong > 0xffff) { + goto cleanup; + } + rdclass = (dns_rdataclass_t)token.value.as_ulong; + } else if (token.type == isc_tokentype_string) { + result = dns_rdataclass_fromtext(&rdclass, + &token.value.as_textregion); + if (result != ISC_R_SUCCESS) { + goto cleanup; + } + } else { + goto cleanup; + } + result = isc_lex_gettoken(lex, options | ISC_LEXOPT_NUMBER, &token); + if (result != ISC_R_SUCCESS) { + goto cleanup; + } + if (token.type == isc_tokentype_eol) { + goto cleanup; + } + if (token.type == isc_tokentype_eof) { + goto cleanup; + } + + /* + * Get type. + */ + if (token.type == isc_tokentype_number) { + if (token.value.as_ulong > 0xffff) { + goto cleanup; + } + rdtype = (dns_rdatatype_t)token.value.as_ulong; + } else if (token.type == isc_tokentype_string) { + result = dns_rdatatype_fromtext(&rdtype, + &token.value.as_textregion); + if (result != ISC_R_SUCCESS) { + goto cleanup; + } + } else { + goto cleanup; + } + + result = dns_rdata_fromtext(&rdata, rdclass, rdtype, lex, name, 0, mctx, + &wirebuf, NULL); + if (debug) { + fprintf(stderr, "dns_rdata_fromtext: %s\n", + isc_result_totext(result)); + } + +cleanup: + isc_lex_close(lex); + isc_lex_destroy(&lex); + isc_mem_destroy(&mctx); + return (0); +} diff --git a/fuzz/dns_rdata_fromtext.in/afsdb b/fuzz/dns_rdata_fromtext.in/afsdb new file mode 100644 index 0000000000..8fec03d3d8 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/afsdb @@ -0,0 +1 @@ +IN AFSDB 0 hostname diff --git a/fuzz/dns_rdata_fromtext.in/amtrelay b/fuzz/dns_rdata_fromtext.in/amtrelay new file mode 100644 index 0000000000..d43121dfaf --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/amtrelay @@ -0,0 +1 @@ +IN AMTRELAY 0 0 3 example.net. diff --git a/fuzz/dns_rdata_fromtext.in/any_tsig b/fuzz/dns_rdata_fromtext.in/any_tsig new file mode 100644 index 0000000000..bcf7fae27d --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/any_tsig @@ -0,0 +1 @@ +ANY TSIG SAMPLE-ALG.EXAMPLE. 853804800 300 4 MTIzNA== 666 0 2 MDA= diff --git a/fuzz/dns_rdata_fromtext.in/avc b/fuzz/dns_rdata_fromtext.in/avc new file mode 100644 index 0000000000..362efcaee2 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/avc @@ -0,0 +1 @@ +IN AVC foo:bar diff --git a/fuzz/dns_rdata_fromtext.in/caa b/fuzz/dns_rdata_fromtext.in/caa new file mode 100644 index 0000000000..fa09a60ddd --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/caa @@ -0,0 +1 @@ +IN CAA 128 tbs "Unknown" diff --git a/fuzz/dns_rdata_fromtext.in/cdnskey b/fuzz/dns_rdata_fromtext.in/cdnskey new file mode 100644 index 0000000000..0f9fac7354 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/cdnskey @@ -0,0 +1 @@ +IN CDNSKEY 512 ( 255 1 AQMFD5raczCJHViKtLYhWGz8hMY 9UGRuniJDBzC7w0aRyzWZriO6i2odGWWQVucZqKV sENW91IOW4vqudngPZsY3GvQ/xVA8/7pyFj6b7Esg a60zyGW6LFe9r8n6paHrlG5ojqf0BaqHT+8= ) diff --git a/fuzz/dns_rdata_fromtext.in/cds b/fuzz/dns_rdata_fromtext.in/cds new file mode 100644 index 0000000000..88d6121c2e --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/cds @@ -0,0 +1 @@ +IN CDS 30795 1 1 ( 310D27F4D82C1FC2400704EA9939FE6E1CEA A3B9 ) diff --git a/fuzz/dns_rdata_fromtext.in/cert b/fuzz/dns_rdata_fromtext.in/cert new file mode 100644 index 0000000000..669ff44df4 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/cert @@ -0,0 +1 @@ +IN CERT 65534 65535 254 ( MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45I kskceFGgiWCn/GxHhai6VAuHAoNUz4YoU1t VfSCSqQYn6//11U6Nld80jEeC8aTrO+KKmCaY= ) diff --git a/fuzz/dns_rdata_fromtext.in/ch_a b/fuzz/dns_rdata_fromtext.in/ch_a new file mode 100644 index 0000000000..bbadbf37aa --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/ch_a @@ -0,0 +1 @@ +CH A hostname. 1234 diff --git a/fuzz/dns_rdata_fromtext.in/class1234_type65533 b/fuzz/dns_rdata_fromtext.in/class1234_type65533 new file mode 100644 index 0000000000..ed30fb31f3 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/class1234_type65533 @@ -0,0 +1 @@ +CLASS1234 TYPE65533 \# 6 010203040506 diff --git a/fuzz/dns_rdata_fromtext.in/cname b/fuzz/dns_rdata_fromtext.in/cname new file mode 100644 index 0000000000..c9e00bf15f --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/cname @@ -0,0 +1 @@ +IN CNAME cname-target diff --git a/fuzz/dns_rdata_fromtext.in/csync b/fuzz/dns_rdata_fromtext.in/csync new file mode 100644 index 0000000000..8d440f835a --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/csync @@ -0,0 +1 @@ +IN CSYNC 0 0 A NS AAAA diff --git a/fuzz/dns_rdata_fromtext.in/dlv b/fuzz/dns_rdata_fromtext.in/dlv new file mode 100644 index 0000000000..9e39e6f023 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/dlv @@ -0,0 +1 @@ +IN DLV 30795 1 1 ( 310D27F4D82C1FC2400704EA9939FE6E1CEA A3B9 ) diff --git a/fuzz/dns_rdata_fromtext.in/dname b/fuzz/dns_rdata_fromtext.in/dname new file mode 100644 index 0000000000..227404320b --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/dname @@ -0,0 +1 @@ +IN DNAME dname-target. diff --git a/fuzz/dns_rdata_fromtext.in/dnskey b/fuzz/dns_rdata_fromtext.in/dnskey new file mode 100644 index 0000000000..93e85c3081 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/dnskey @@ -0,0 +1 @@ +IN DNSKEY 512 ( 255 1 AQMFD5raczCJHViKtLYhWGz8hMY 9UGRuniJDBzC7w0aRyzWZriO6i2odGWWQVucZqKV sENW91IOW4vqudngPZsY3GvQ/xVA8/7pyFj6b7Esg a60zyGW6LFe9r8n6paHrlG5ojqf0BaqHT+8= ) diff --git a/fuzz/dns_rdata_fromtext.in/doa b/fuzz/dns_rdata_fromtext.in/doa new file mode 100644 index 0000000000..13b2b9b256 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/doa @@ -0,0 +1 @@ +IN DOA 0 1 2 "" aHR0cHM6Ly93d3cuaXNjLm9yZy8= diff --git a/fuzz/dns_rdata_fromtext.in/ds b/fuzz/dns_rdata_fromtext.in/ds new file mode 100644 index 0000000000..616ae14239 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/ds @@ -0,0 +1 @@ +IN DS 12892 5 1 7AA4A3F416C2F2391FB7AB0D434F762CD62D1390 diff --git a/fuzz/dns_rdata_fromtext.in/eui48 b/fuzz/dns_rdata_fromtext.in/eui48 new file mode 100644 index 0000000000..9a506bda6f --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/eui48 @@ -0,0 +1 @@ +IN EUI48 01-23-45-67-89-ab diff --git a/fuzz/dns_rdata_fromtext.in/eui64 b/fuzz/dns_rdata_fromtext.in/eui64 new file mode 100644 index 0000000000..ce06023f54 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/eui64 @@ -0,0 +1 @@ +IN EUI64 01-23-45-67-89-ab-cd-ef diff --git a/fuzz/dns_rdata_fromtext.in/gid b/fuzz/dns_rdata_fromtext.in/gid new file mode 100644 index 0000000000..c72ccf986f --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/gid @@ -0,0 +1 @@ +IN GID \# 1 03 diff --git a/fuzz/dns_rdata_fromtext.in/gpos b/fuzz/dns_rdata_fromtext.in/gpos new file mode 100644 index 0000000000..7c4c050dd4 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/gpos @@ -0,0 +1 @@ +IN GPOS -22.6882 116.8652 250.0 diff --git a/fuzz/dns_rdata_fromtext.in/hinfo b/fuzz/dns_rdata_fromtext.in/hinfo new file mode 100644 index 0000000000..c43de49ea3 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/hinfo @@ -0,0 +1 @@ +IN HINFO "Generic PC clone" "NetBSD-1.4" diff --git a/fuzz/dns_rdata_fromtext.in/hip b/fuzz/dns_rdata_fromtext.in/hip new file mode 100644 index 0000000000..385a522a2c --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/hip @@ -0,0 +1 @@ +IN HIP ( 2 200100107B1A74DF365639CC39F1D578 AwEAAbdxyhNuSutc5EMzxTs9LBPCIkOFH8cIvM4p9+LrV4e19WzK00+CI6zBCQTdtWsuxKbWIy87UOoJTwkUs7lBu+Upr1gsNrut79ryra+bSRGQb1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXdXF5D ) diff --git a/fuzz/dns_rdata_fromtext.in/hs_a b/fuzz/dns_rdata_fromtext.in/hs_a new file mode 100644 index 0000000000..4d9da2c438 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/hs_a @@ -0,0 +1 @@ +HS A 192.0.2.1 diff --git a/fuzz/dns_rdata_fromtext.in/in_a b/fuzz/dns_rdata_fromtext.in/in_a new file mode 100644 index 0000000000..f9ffd67355 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/in_a @@ -0,0 +1 @@ +IN A 255.255.255.255 diff --git a/fuzz/dns_rdata_fromtext.in/in_a6 b/fuzz/dns_rdata_fromtext.in/in_a6 new file mode 100644 index 0000000000..8e91e2a605 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/in_a6 @@ -0,0 +1 @@ +IN A6 127 ::1 foo. diff --git a/fuzz/dns_rdata_fromtext.in/in_aaaa b/fuzz/dns_rdata_fromtext.in/in_aaaa new file mode 100644 index 0000000000..2341d4f106 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/in_aaaa @@ -0,0 +1 @@ +IN AAAA fd92:7065:b8e:ffff::5 diff --git a/fuzz/dns_rdata_fromtext.in/in_apl b/fuzz/dns_rdata_fromtext.in/in_apl new file mode 100644 index 0000000000..dc32bd0a35 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/in_apl @@ -0,0 +1 @@ +IN APL !1:10.0.0.1/32 1:10.0.0.0/24 diff --git a/fuzz/dns_rdata_fromtext.in/in_atma b/fuzz/dns_rdata_fromtext.in/in_atma new file mode 100644 index 0000000000..1febbf4c6d --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/in_atma @@ -0,0 +1 @@ +IN ATMA +61.2.0000.0000 diff --git a/fuzz/dns_rdata_fromtext.in/in_dhcid b/fuzz/dns_rdata_fromtext.in/in_dhcid new file mode 100644 index 0000000000..0732152980 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/in_dhcid @@ -0,0 +1 @@ +IN DHCID ( AAABxLmlskllE0MVjd57zHcWmEH3pCQ6V ytcKD//7es/deY= ) diff --git a/fuzz/dns_rdata_fromtext.in/in_eid b/fuzz/dns_rdata_fromtext.in/in_eid new file mode 100644 index 0000000000..e18f225831 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/in_eid @@ -0,0 +1 @@ +IN EID 12 89 AB diff --git a/fuzz/dns_rdata_fromtext.in/in_kx b/fuzz/dns_rdata_fromtext.in/in_kx new file mode 100644 index 0000000000..48c0e155b9 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/in_kx @@ -0,0 +1 @@ +IN KX 10 kdc diff --git a/fuzz/dns_rdata_fromtext.in/in_nimloc b/fuzz/dns_rdata_fromtext.in/in_nimloc new file mode 100644 index 0000000000..41c6f7b502 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/in_nimloc @@ -0,0 +1 @@ +IN NIMLOC 12 89 AB diff --git a/fuzz/dns_rdata_fromtext.in/in_nsap b/fuzz/dns_rdata_fromtext.in/in_nsap new file mode 100644 index 0000000000..8a7a92705a --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/in_nsap @@ -0,0 +1 @@ +IN NSAP 0x47.0005.80.005a00.0000.0001.e133.ffffff000164.00 diff --git a/fuzz/dns_rdata_fromtext.in/in_nsap_ptr b/fuzz/dns_rdata_fromtext.in/in_nsap_ptr new file mode 100644 index 0000000000..dc683c7470 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/in_nsap_ptr @@ -0,0 +1 @@ +IN NSAP-PTR foo. diff --git a/fuzz/dns_rdata_fromtext.in/in_px b/fuzz/dns_rdata_fromtext.in/in_px new file mode 100644 index 0000000000..1e6c98b011 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/in_px @@ -0,0 +1 @@ +IN PX 65535 foo. bar. diff --git a/fuzz/dns_rdata_fromtext.in/in_srv b/fuzz/dns_rdata_fromtext.in/in_srv new file mode 100644 index 0000000000..ed3f929f0e --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/in_srv @@ -0,0 +1 @@ +IN SRV 65535 65535 65535 old-slow-box diff --git a/fuzz/dns_rdata_fromtext.in/in_wks b/fuzz/dns_rdata_fromtext.in/in_wks new file mode 100644 index 0000000000..a9c96580a7 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/in_wks @@ -0,0 +1 @@ +IN WKS 10.0.0.1 tcp telnet ftp 0 1 2 diff --git a/fuzz/dns_rdata_fromtext.in/ipseckey b/fuzz/dns_rdata_fromtext.in/ipseckey new file mode 100644 index 0000000000..14dbb7f442 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/ipseckey @@ -0,0 +1 @@ +IN IPSECKEY ( 10 3 2 mygateway.example.com. AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== ) diff --git a/fuzz/dns_rdata_fromtext.in/isdn b/fuzz/dns_rdata_fromtext.in/isdn new file mode 100644 index 0000000000..c3cc968c18 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/isdn @@ -0,0 +1 @@ +IN ISDN "isdn-address" "subaddress" diff --git a/fuzz/dns_rdata_fromtext.in/key b/fuzz/dns_rdata_fromtext.in/key new file mode 100644 index 0000000000..91323a8f77 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/key @@ -0,0 +1 @@ +IN KEY 512 ( 255 1 AQMFD5raczCJHViKtLYhWGz8hMY 9UGRuniJDBzC7w0aRyzWZriO6i2odGWWQVucZqKV sENW91IOW4vqudngPZsY3GvQ/xVA8/7pyFj6b7Esg a60zyGW6LFe9r8n6paHrlG5ojqf0BaqHT+8= ) diff --git a/fuzz/dns_rdata_fromtext.in/keydata b/fuzz/dns_rdata_fromtext.in/keydata new file mode 100644 index 0000000000..b67e3aa6a8 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/keydata @@ -0,0 +1 @@ +IN KEYDATA 20210101000000 20380101000000 20380101000000 KSK DNSSEC ED448 ZXh0cmE= diff --git a/fuzz/dns_rdata_fromtext.in/l32 b/fuzz/dns_rdata_fromtext.in/l32 new file mode 100644 index 0000000000..c315e9cea4 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/l32 @@ -0,0 +1 @@ +IN L32 10 1.2.3.4 diff --git a/fuzz/dns_rdata_fromtext.in/l64 b/fuzz/dns_rdata_fromtext.in/l64 new file mode 100644 index 0000000000..673f0a2d4a --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/l64 @@ -0,0 +1 @@ +IN L64 10 0014:4fff:ff20:ee64 diff --git a/fuzz/dns_rdata_fromtext.in/loc b/fuzz/dns_rdata_fromtext.in/loc new file mode 100644 index 0000000000..413a5a81d8 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/loc @@ -0,0 +1 @@ +IN LOC 60 09 00.000 N 24 39 00.000 E 10.00m 20.00m ( 2000.00m 20.00m ) diff --git a/fuzz/dns_rdata_fromtext.in/lp b/fuzz/dns_rdata_fromtext.in/lp new file mode 100644 index 0000000000..1b21752215 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/lp @@ -0,0 +1 @@ +IN LP 10 example.net. diff --git a/fuzz/dns_rdata_fromtext.in/mb b/fuzz/dns_rdata_fromtext.in/mb new file mode 100644 index 0000000000..adc9470a3b --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/mb @@ -0,0 +1 @@ +IN MB madname. diff --git a/fuzz/dns_rdata_fromtext.in/md b/fuzz/dns_rdata_fromtext.in/md new file mode 100644 index 0000000000..f6996e028a --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/md @@ -0,0 +1 @@ +IN MD madname diff --git a/fuzz/dns_rdata_fromtext.in/mf b/fuzz/dns_rdata_fromtext.in/mf new file mode 100644 index 0000000000..3dc3bc206e --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/mf @@ -0,0 +1 @@ +IN MF madname diff --git a/fuzz/dns_rdata_fromtext.in/mg b/fuzz/dns_rdata_fromtext.in/mg new file mode 100644 index 0000000000..83ff2bc2f2 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/mg @@ -0,0 +1 @@ +IN MG mgmname diff --git a/fuzz/dns_rdata_fromtext.in/minfo b/fuzz/dns_rdata_fromtext.in/minfo new file mode 100644 index 0000000000..e64d9253c0 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/minfo @@ -0,0 +1 @@ +IN MINFO rmailbx emailbx diff --git a/fuzz/dns_rdata_fromtext.in/mr b/fuzz/dns_rdata_fromtext.in/mr new file mode 100644 index 0000000000..ca058b8124 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/mr @@ -0,0 +1 @@ +IN MR mrname diff --git a/fuzz/dns_rdata_fromtext.in/mx b/fuzz/dns_rdata_fromtext.in/mx new file mode 100644 index 0000000000..3d1dcdbf7f --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/mx @@ -0,0 +1 @@ +IN MX 10 mail diff --git a/fuzz/dns_rdata_fromtext.in/naptr b/fuzz/dns_rdata_fromtext.in/naptr new file mode 100644 index 0000000000..248960098c --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/naptr @@ -0,0 +1 @@ +IN NAPTR 65535 65535 "blurgh" "blorf" "blllbb" foo. diff --git a/fuzz/dns_rdata_fromtext.in/nid b/fuzz/dns_rdata_fromtext.in/nid new file mode 100644 index 0000000000..f011125ae9 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/nid @@ -0,0 +1 @@ +IN NID 10 0014:4fff:ff20:ee64 diff --git a/fuzz/dns_rdata_fromtext.in/ninfo b/fuzz/dns_rdata_fromtext.in/ninfo new file mode 100644 index 0000000000..4d58d28a70 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/ninfo @@ -0,0 +1 @@ +IN NINFO "foo\032bar" diff --git a/fuzz/dns_rdata_fromtext.in/ns b/fuzz/dns_rdata_fromtext.in/ns new file mode 100644 index 0000000000..da0bca2d4f --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/ns @@ -0,0 +1 @@ +IN NS ns43 diff --git a/fuzz/dns_rdata_fromtext.in/nsec b/fuzz/dns_rdata_fromtext.in/nsec new file mode 100644 index 0000000000..8cbd1e8c34 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/nsec @@ -0,0 +1 @@ +IN NSEC a.secure.nil. ( NS SOA MX RRSIG DNSKEY LOC NSEC ) diff --git a/fuzz/dns_rdata_fromtext.in/nsec3 b/fuzz/dns_rdata_fromtext.in/nsec3 new file mode 100644 index 0000000000..bc615a115d --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/nsec3 @@ -0,0 +1 @@ +IN NSEC3 1 0 10 D2CF0294C020CE6C 8FPNS2UCT7FBS643THP2B77PEQ77K6IU A NS SOA MX AAAA RRSIG DNSKEY NSEC3PARAM diff --git a/fuzz/dns_rdata_fromtext.in/nsec3param b/fuzz/dns_rdata_fromtext.in/nsec3param new file mode 100644 index 0000000000..414f44ddf3 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/nsec3param @@ -0,0 +1 @@ +IN NSEC3PARAM 1 0 1 868BCF7ED4108929 diff --git a/fuzz/dns_rdata_fromtext.in/null b/fuzz/dns_rdata_fromtext.in/null new file mode 100644 index 0000000000..bebe069638 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/null @@ -0,0 +1 @@ +IN NULL diff --git a/fuzz/dns_rdata_fromtext.in/nxt b/fuzz/dns_rdata_fromtext.in/nxt new file mode 100644 index 0000000000..9f4d243a49 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/nxt @@ -0,0 +1 @@ +IN NXT a.secure.nil. ( NS SOA MX RRSIG KEY LOC NXT ) diff --git a/fuzz/dns_rdata_fromtext.in/openpgpkey b/fuzz/dns_rdata_fromtext.in/openpgpkey new file mode 100644 index 0000000000..4c99b65b72 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/openpgpkey @@ -0,0 +1 @@ +IN OPENPGPKEY ( AQMFD5raczCJHViKtLYhWGz8hMY 9UGRuniJDBzC7w0aRyzWZriO6i2odGWWQVucZqKV sENW91IOW4vqudngPZsY3GvQ/xVA8/7pyFj6b7Esg a60zyGW6LFe9r8n6paHrlG5ojqf0BaqHT+8= ) diff --git a/fuzz/dns_rdata_fromtext.in/opt b/fuzz/dns_rdata_fromtext.in/opt new file mode 100644 index 0000000000..b391304bda --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/opt @@ -0,0 +1 @@ +ANY OPT unsupported diff --git a/fuzz/dns_rdata_fromtext.in/ptr b/fuzz/dns_rdata_fromtext.in/ptr new file mode 100644 index 0000000000..040dc3b3bb --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/ptr @@ -0,0 +1 @@ +IN PTR @ diff --git a/fuzz/dns_rdata_fromtext.in/rkey b/fuzz/dns_rdata_fromtext.in/rkey new file mode 100644 index 0000000000..fc59f3ac7a --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/rkey @@ -0,0 +1 @@ +IN RKEY 0 ( 255 1 AQMFD5raczCJHViKtLYhWGz8hMY 9UGRuniJDBzC7w0aRyzWZriO6i2odGWWQVucZqKV sENW91IOW4vqudngPZsY3GvQ/xVA8/7pyFj6b7Esg a60zyGW6LFe9r8n6paHrlG5ojqf0BaqHT+8= ) diff --git a/fuzz/dns_rdata_fromtext.in/rp b/fuzz/dns_rdata_fromtext.in/rp new file mode 100644 index 0000000000..04e65c2f78 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/rp @@ -0,0 +1 @@ +IN RP mbox-dname txt-dname diff --git a/fuzz/dns_rdata_fromtext.in/rrsig b/fuzz/dns_rdata_fromtext.in/rrsig new file mode 100644 index 0000000000..53819d018e --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/rrsig @@ -0,0 +1 @@ +IN RRSIG NSEC 1 3 ( 3600 20000102030405 19961211100908 2143 foo.nil. MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45I kskceFGgiWCn/GxHhai6VAuHAoNUz4YoU1t VfSCSqQYn6//11U6Nld80jEeC8aTrO+KKmCaY= ) diff --git a/fuzz/dns_rdata_fromtext.in/rt b/fuzz/dns_rdata_fromtext.in/rt new file mode 100644 index 0000000000..32686381f7 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/rt @@ -0,0 +1 @@ +IN RT 0 intermediate-host diff --git a/fuzz/dns_rdata_fromtext.in/sig b/fuzz/dns_rdata_fromtext.in/sig new file mode 100644 index 0000000000..f92bd7083b --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/sig @@ -0,0 +1 @@ +IN SIG NXT 1 3 ( 3600 20000102030405 19961211100908 2143 foo.nil. MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45I kskceFGgiWCn/GxHhai6VAuHAoNUz4YoU1t VfSCSqQYn6//11U6Nld80jEeC8aTrO+KKmCaY= ) diff --git a/fuzz/dns_rdata_fromtext.in/sink b/fuzz/dns_rdata_fromtext.in/sink new file mode 100644 index 0000000000..a85cc45ea4 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/sink @@ -0,0 +1 @@ +IN SINK 8 0 2 l4ik diff --git a/fuzz/dns_rdata_fromtext.in/smimea b/fuzz/dns_rdata_fromtext.in/smimea new file mode 100644 index 0000000000..95107a1bcc --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/smimea @@ -0,0 +1 @@ +IN SMIMEA ( 1 1 2 92003ba34942dc74152e2f2c408d29ec a5a520e7f2e06bb944f4dca346baf63c 1b177615d466f6c4b71c216a50292bd5 8c9ebdd2f74e38fe51ffd48c43326cbc ) diff --git a/fuzz/dns_rdata_fromtext.in/soa b/fuzz/dns_rdata_fromtext.in/soa new file mode 100644 index 0000000000..d3a677c4b1 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/soa @@ -0,0 +1 @@ +IN SOA a.test. hostmaster.null. 1613723740 900 300 604800 900 diff --git a/fuzz/dns_rdata_fromtext.in/spf b/fuzz/dns_rdata_fromtext.in/spf new file mode 100644 index 0000000000..a15ca1616c --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/spf @@ -0,0 +1 @@ +IN SPF "v=spf1" " -all" diff --git a/fuzz/dns_rdata_fromtext.in/sshfp b/fuzz/dns_rdata_fromtext.in/sshfp new file mode 100644 index 0000000000..bc15aa464f --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/sshfp @@ -0,0 +1 @@ +IN SSHFP 4 2 C76D8329954DA2835751E371544E963EFDA099080D6C58DD2BFD9A31 6E162C83 diff --git a/fuzz/dns_rdata_fromtext.in/ta b/fuzz/dns_rdata_fromtext.in/ta new file mode 100644 index 0000000000..429d4263f3 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/ta @@ -0,0 +1 @@ +IN TA 30795 1 1 ( 310D27F4D82C1FC2400704EA9939FE6E1CEA A3B9 ) diff --git a/fuzz/dns_rdata_fromtext.in/talink b/fuzz/dns_rdata_fromtext.in/talink new file mode 100644 index 0000000000..1788a62283 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/talink @@ -0,0 +1 @@ +IN TALINK . talink1 diff --git a/fuzz/dns_rdata_fromtext.in/tkey b/fuzz/dns_rdata_fromtext.in/tkey new file mode 100644 index 0000000000..eb38e20181 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/tkey @@ -0,0 +1 @@ +IN TKEY algo.test. 0 0 0 0 2 MjI= 1 MQ== diff --git a/fuzz/dns_rdata_fromtext.in/tlsa b/fuzz/dns_rdata_fromtext.in/tlsa new file mode 100644 index 0000000000..0b65f21abe --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/tlsa @@ -0,0 +1 @@ +IN TLSA ( 0 0 1 d2abde240d7cd3ee6b4b28c54df034b9 7983a1d16e8a410e4561cb106618e971 ) diff --git a/fuzz/dns_rdata_fromtext.in/txt b/fuzz/dns_rdata_fromtext.in/txt new file mode 100644 index 0000000000..a20b12871a --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/txt @@ -0,0 +1 @@ +IN TXT "\"foo\010bar\"" diff --git a/fuzz/dns_rdata_fromtext.in/uid b/fuzz/dns_rdata_fromtext.in/uid new file mode 100644 index 0000000000..7f662f1bbc --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/uid @@ -0,0 +1 @@ +IN UID \# 1 02 diff --git a/fuzz/dns_rdata_fromtext.in/uinfo b/fuzz/dns_rdata_fromtext.in/uinfo new file mode 100644 index 0000000000..ec979be255 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/uinfo @@ -0,0 +1 @@ +IN UINFO \# 1 01 diff --git a/fuzz/dns_rdata_fromtext.in/unspec b/fuzz/dns_rdata_fromtext.in/unspec new file mode 100644 index 0000000000..579eea635a --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/unspec @@ -0,0 +1 @@ +IN UNSPEC \# 1 04 diff --git a/fuzz/dns_rdata_fromtext.in/uri b/fuzz/dns_rdata_fromtext.in/uri new file mode 100644 index 0000000000..94971091f0 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/uri @@ -0,0 +1 @@ +IN URI 10 20 "https://www.isc.org/" diff --git a/fuzz/dns_rdata_fromtext.in/x25 b/fuzz/dns_rdata_fromtext.in/x25 new file mode 100644 index 0000000000..1a60ed7155 --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/x25 @@ -0,0 +1 @@ +IN X25 "123456789" diff --git a/fuzz/dns_rdata_fromtext.in/zonemd b/fuzz/dns_rdata_fromtext.in/zonemd new file mode 100644 index 0000000000..539bb5ef4e --- /dev/null +++ b/fuzz/dns_rdata_fromtext.in/zonemd @@ -0,0 +1 @@ +IN ZONEMD 2019020700 1 0 ( C220B8A6ED5728A971902F7E3D4FD93A DEEA88B0453C2E8E8C863D465AB06CF3 4EB95B266398C98B59124FA239CB7EEB ) diff --git a/fuzz/dns_rdata_fromwire_text.c b/fuzz/dns_rdata_fromwire_text.c index f3b8d50aa0..f05ddd4be5 100644 --- a/fuzz/dns_rdata_fromwire_text.c +++ b/fuzz/dns_rdata_fromwire_text.c @@ -47,7 +47,6 @@ LLVMFuzzerInitialize(int *argc __attribute__((unused)), isc_lexspecials_t specials; isc_mem_create(&mctx); - RUNTIME_CHECK(dst_lib_init(mctx, NULL) == ISC_R_SUCCESS); CHECK(isc_lex_create(mctx, 64, &lex)); memset(specials, 0, sizeof(specials));