From: John Haxby <john.haxby@oracle.com>
To: netfilter-devel@vger.kernel.org
Subject: [RESEND] [PATCH] Fix a couple of problems with xt_SYSRQ
Date: Fri, 25 Jun 2010 10:38:03 +0100 [thread overview]
Message-ID: <4C2478FB.5080602@oracle.com> (raw)
The first problem is that the error response from crypto_alloc_hash()
should be extracted from the pointer before setting the pointer to NULL.
The second error is that only the first half of the password hash is
checked which slightly weakens the password checking.
Signed-off-by: John Haxby <john.haxby@oracle.com>
---
extensions/xt_SYSRQ.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/extensions/xt_SYSRQ.c b/extensions/xt_SYSRQ.c
index e0b6aa0..30fc112 100644
--- a/extensions/xt_SYSRQ.c
+++ b/extensions/xt_SYSRQ.c
@@ -135,13 +135,13 @@ static unsigned int sysrq_tg(const void *pdata,
uint16_t len)
"0123456789abcdef"[sysrq_digest[i] & 0xf];
}
sysrq_hexdigest[2*sysrq_digest_size] = '\0';
- if (len - n < sysrq_digest_size) {
+ if (len - n < sysrq_digest_size*2) {
if (sysrq_debug)
printk(KERN_INFO KBUILD_MODNAME ": Short digest,"
" expected %s\n", sysrq_hexdigest);
return NF_DROP;
}
- if (strncmp(data + n, sysrq_hexdigest, sysrq_digest_size) != 0) {
+ if (strncmp(data + n, sysrq_hexdigest, sysrq_digest_size*2) != 0) {
if (sysrq_debug)
printk(KERN_INFO KBUILD_MODNAME ": Bad digest,"
" expected %s\n", sysrq_hexdigest);
@@ -324,8 +324,8 @@ static int __init sysrq_crypto_init(void)
printk(KERN_WARNING KBUILD_MODNAME
": Error: Could not find or load %s hash\n",
sysrq_hash);
- sysrq_tfm = NULL;
ret = PTR_ERR(sysrq_tfm);
+ sysrq_tfm = NULL;
goto fail;
}
sysrq_digest_size = crypto_hash_digestsize(sysrq_tfm);
--
1.7.0.1
next reply other threads:[~2010-06-25 9:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-25 9:38 John Haxby [this message]
2010-06-25 9:57 ` [RESEND] [PATCH] Fix a couple of problems with xt_SYSRQ John Haxby
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=4C2478FB.5080602@oracle.com \
--to=john.haxby@oracle.com \
--cc=netfilter-devel@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).