linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Steve Dickson <SteveD@redhat.com>
Cc: linux-nfs@vger.kernel.org, Chuck Lever <chuck.lever@oracle.com>
Subject: Re: [PATCH 2/3] krb5_util: don't give up on machine credential if hostname not available.
Date: Tue, 2 Jul 2013 07:56:50 +1000	[thread overview]
Message-ID: <20130702075650.63f72ca9@notabene.brown> (raw)
In-Reply-To: <51D1ACBE.7030608@RedHat.com>

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

On Mon, 01 Jul 2013 12:22:22 -0400 Steve Dickson <SteveD@redhat.com> wrote:

> Sorry for getting into so late... I did an extraordinary amount
> of travailing in June.... 
> 
> On 02/06/13 21:00, Neil Brown wrote:
> > krb5_util tries various different credential names in order to find
> > the machine credential, not all of them use the full host name of the
> > current host.
> > 
> > So if getting the full host name fails, don't give up completely,
> > still try the other options.
> > 
> > Signed-off-by: NeilBrown <neilb@suse.de>
> > ---
> >  utils/gssd/krb5_util.c |    8 ++++++--
> >  1 file changed, 6 insertions(+), 2 deletions(-)
> > 
> > diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c
> > index 9ef80f0..5e84481 100644
> > --- a/utils/gssd/krb5_util.c
> > +++ b/utils/gssd/krb5_util.c
> > @@ -825,8 +825,10 @@ find_keytab_entry(krb5_context context, krb5_keytab kt, const char *tgtname,
> >  	myhostad[i+1] = 0;
> >  
> >  	retval = get_full_hostname(myhostname, myhostname, sizeof(myhostname));
> > -	if (retval)
> > -		goto out;
> > +	if (retval) {
> > +		/* Don't use myhostname */
> > +		myhostname[0] = 0;
> > +	}
> >  
> >  	code = krb5_get_default_realm(context, &default_realm);
> >  	if (code) {
> > @@ -883,6 +885,8 @@ find_keytab_entry(krb5_context context, krb5_keytab kt, const char *tgtname,
> >  								myhostad,
> >  								NULL);
> >  			} else {
> > +				if (!myhostname[0])
> > +					continue;
> >  				snprintf(spn, sizeof(spn), "%s/%s@%s",
> >  					 svcnames[j], myhostname, realm);
> >  				code = krb5_build_principal_ext(context, &princ,
> > 
> > 
> At the end of day... This patch allows the machine cred to be used when
> there is no DNS or /etc/hosts is empty (aka getaddrinfo() fails via 
> the get_full_hostname() call).
> 
> I'm thinking this is a good idea, but I'm a gnawing feeling this would
> be open some type of security hole by using machine creds when they
> should not be or they were not expected to be used...
> 
> Am I being too paranoid???

Probably, but it is a good default position nonetheless.

This patch will only allow a machine credential to be used in the absence of
an easily detected "full hostname" if a wild card machine credential is
available.  And if such is available, it seems wrong not to use it.

If wildcard machine credentials were no expected to be used, it we seem
strange to have them included in the keytab file.

So I cannot see any hole.

Thanks,
NeilBrown


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  reply	other threads:[~2013-07-01 21:57 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-03  1:00 [PATCH 0/3] Various gssd fixes including machine-credential issue Neil Brown
2013-06-03  1:00 ` [PATCH 1/3] krb5_utils: remove redundant array size Neil Brown
2013-07-01 16:05   ` Steve Dickson
2013-06-03  1:00 ` [PATCH 3/3] gssd: add -N option to use root credentials as machine credentials Neil Brown
2013-07-01 16:23   ` Steve Dickson
2013-07-01 21:35     ` NeilBrown
2013-06-03  1:00 ` [PATCH 2/3] krb5_util: don't give up on machine credential if hostname not available Neil Brown
2013-07-01 16:22   ` Steve Dickson
2013-07-01 21:56     ` NeilBrown [this message]
2013-07-02 12:29       ` Steve Dickson
2013-07-02 12:29   ` Steve Dickson
2013-06-03  2:01 ` [PATCH 0/3] Various gssd fixes including machine-credential issue Chuck Lever
2013-06-03  2:23   ` NeilBrown
2013-06-03  2:45     ` Chuck Lever
2013-06-03  3:01       ` NeilBrown
2013-06-03  4:32         ` Chuck Lever
2013-06-03 23:30           ` NeilBrown
2013-06-04  1:13             ` Chuck Lever
2013-06-04 19:16               ` Chuck Lever
2013-06-05  1:26                 ` NeilBrown
2013-06-05 15:37                   ` Chuck Lever
2013-06-05 17:14                     ` Chuck Lever
2013-06-05 23:53                       ` NeilBrown
2013-06-05 23:43                     ` NeilBrown
2013-06-12  6:12                       ` NeilBrown
2013-06-12 16:01                         ` Chuck Lever

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=20130702075650.63f72ca9@notabene.brown \
    --to=neilb@suse.de \
    --cc=SteveD@redhat.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@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).