Linux NFS development
 help / color / mirror / Atom feed
From: Olaf Kirch <okir@suse.de>
To: nfs@lists.sourceforge.net
Subject: [PATCH] auth_domain_lookup in 2.6.8-rc2
Date: Fri, 8 Oct 2004 12:01:03 +0200	[thread overview]
Message-ID: <20041008100102.GA20142@suse.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 385 bytes --]

Hi,

2.6.8-rc2 open-codes auth_domain_lookup, and introduces a flaw that
may have security consequences. If we do not find any matching
domain, the routine always returns the last item looked at, no
matter what it was.

Olaf
-- 
Olaf Kirch     | Things that make Monday morning interesting, #1:
okir@suse.de   |        "I want to use NFS over AX25, can you help me?"
---------------+ 

[-- Attachment #2: sunrpc-authdomain-lookup --]
[-- Type: text/plain, Size: 829 bytes --]


This patch makes sure that auth_domain_lookup returns NULL when
it doesn't find a matching entry, rather than the last entry
in the hash chain.

Signed-off-by: Olaf Kirch <okir@suse.de>

Index: linux-2.6.8/net/sunrpc/svcauth.c
===================================================================
--- linux-2.6.8.orig/net/sunrpc/svcauth.c
+++ linux-2.6.8/net/sunrpc/svcauth.c
@@ -183,7 +183,7 @@ auth_domain_lookup(struct auth_domain *i
 	}
 	/* Didn't find anything */
 	if (!set)
-		goto out_noset;
+		goto out_nada;
 	auth_domain_cache.entries++;
 out_set:
 	set_bit(CACHE_HASHED, &item->h.flags);
@@ -193,6 +193,8 @@ out_set:
 	cache_fresh(&auth_domain_cache, &item->h, item->h.expiry_time);
 	cache_get(&item->h);
 	return item;
+out_nada:
+	tmp = NULL;
 out_noset:
 	read_unlock(&auth_domain_cache.hash_lock);
 	return tmp;

             reply	other threads:[~2004-10-08 10:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-08 10:01 Olaf Kirch [this message]
2004-10-08 19:43 ` [PATCH] auth_domain_lookup in 2.6.8-rc2 J. Bruce Fields

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=20041008100102.GA20142@suse.de \
    --to=okir@suse.de \
    --cc=nfs@lists.sourceforge.net \
    /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