Re: [syzbot] [net?] KASAN: slab-out-of-bounds Read in dns_resolver_preparse

syzbot
2023-12-14T14:18:38Z

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.

***

Subject: [net?] KASAN: slab-out-of-bounds Read in dns_resolver_preparse
Author: eadavis@qq.com

please test slab-out-of-bounds Read in dns_resolver_preparse

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 48e8992e33ab
diff --git a/net/dns_resolver/dns_key.c b/net/dns_resolver/dns_key.c
index 3233f4f25fed..15f19521021c 100644
--- a/net/dns_resolver/dns_key.c
+++ b/net/dns_resolver/dns_key.c
@@ -104,7 +104,7 @@ dns_resolver_preparse(struct key_preparsed_payload *prep)

if (data[0] == 0) {
/* It may be a server list. */
- if (datalen <= sizeof(*bin))
+ if (datalen <= sizeof(*v1))
return -EINVAL;

bin = (const struct dns_payload_header *)data;