From: "Manuel Schölling" <manuel.schoelling@gmx.de>
To: davem@davemloft.net
Cc: jeffrey.t.kirsher@intel.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
"Manuel Schölling" <manuel.schoelling@gmx.de>
Subject: [PATCH] dns_resolver: Do not accept domain names longer than 255 chars
Date: Sat, 31 May 2014 18:44:33 +0200 [thread overview]
Message-ID: <1401554673-16311-1-git-send-email-manuel.schoelling@gmx.de> (raw)
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
next reply other threads:[~2014-05-31 16:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-31 16:44 Manuel Schölling [this message]
2014-05-31 21:37 ` [PATCH v2] dns_resolver: Do not accept domain names longer than 255 chars Manuel Schölling
2014-06-05 7:06 ` [PATCH] " David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1401554673-16311-1-git-send-email-manuel.schoelling@gmx.de \
--to=manuel.schoelling@gmx.de \
--cc=davem@davemloft.net \
--cc=jeffrey.t.kirsher@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).