[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1401554673-16311-1-git-send-email-manuel.schoelling@gmx.de>
Date: Sat, 31 May 2014 18:44:33 +0200
From: Manuel Schölling <manuel.schoelling@....de>
To: davem@...emloft.net
Cc: jeffrey.t.kirsher@...el.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
Manuel Schölling <manuel.schoelling@....de>
Subject: [PATCH] dns_resolver: Do not accept domain names longer than 255 chars
According to RFC1035 "[...] the total length of a domain name (i.e.,
label octets and label length octets) is restricted to 255 octets or
less."
Signed-off-by: Manuel Schölling <manuel.schoelling@....de>
---
net/dns_resolver/dns_query.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/dns_resolver/dns_query.c b/net/dns_resolver/dns_query.c
index e7b6d53..e0fde29 100644
--- a/net/dns_resolver/dns_query.c
+++ b/net/dns_resolver/dns_query.c
@@ -94,7 +94,7 @@ int dns_query(const char *type, const char *name, size_t namelen,
if (!namelen)
namelen = strlen(name);
- if (namelen < 3)
+ if (namelen < 3 || namelen > 255)
return -EINVAL;
desclen += namelen + 1;
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists