netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dns_resolver: Do not accept domain names longer than 255 chars
@ 2014-05-31 16:44 Manuel Schölling
  2014-05-31 21:37 ` [PATCH v2] " Manuel Schölling
  2014-06-05  7:06 ` [PATCH] " David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Manuel Schölling @ 2014-05-31 16:44 UTC (permalink / raw)
  To: davem; +Cc: jeffrey.t.kirsher, netdev, linux-kernel, Manuel Schölling

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@gmx.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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-06-05  7:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-31 16:44 [PATCH] dns_resolver: Do not accept domain names longer than 255 chars Manuel Schölling
2014-05-31 21:37 ` [PATCH v2] " Manuel Schölling
2014-06-05  7:06 ` [PATCH] " David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).