From: Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
To: Chad William Seys <cwseys-JAjqph6Yjy/rea2nFwT0Kw@public.gmane.org>
Cc: linux-cifs <linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: problem when testing recent cifs.upcall
Date: Thu, 23 Feb 2017 07:45:02 -0500 [thread overview]
Message-ID: <1487853902.7731.21.camel@samba.org> (raw)
In-Reply-To: <d29a36ca-693d-e3c6-9428-90b1ee9bce10-JAjqph6Yjy/rea2nFwT0Kw@public.gmane.org>
On Wed, 2017-02-22 at 11:32 -0600, Chad William Seys wrote:
> Hi Jeff,
> I'm testing the most recent cifs.upcall (most recent commit
> "cifs.upcall: trim even more capabilities") .
> I copied cifs.upcall over the one provided in Debian package of
> cifs-utils 6.6
> While testing, one of the things I did was destroy my kerberos ticket
> and then try to enter a directory in which the user did not have a
> listing in the ACL, except through membership in a group. I wasn't able
> to ls the directory (fine). However, kinit failed. ls-ing shows that
> the credential cache kinit tries to create already exists, but is owned
> by root. Uh oh. :)
> Looks like root must go create a credential cache file with same name
> instead of just looking for an existing one.
> The steps are below:
>
> cwseys:
> # kdestroy
> # cd /
>
> root:
> # umount /smb
> # umount /smb # to be sure!
>
> cwseys:
> # kinit
> Password for cwseys-8oz4Nevp0l1cSxESns1TRQ@public.gmane.org:
> # ls /tmp/krb5cc_* -al
> -rw------- 1 cwseys cwseys 939 Feb 22 11:06 /tmp/krb5cc_1494_sM11PG
>
> root:
> # mount -t cifs //smb.physics.wisc.edu/smb /smb
> -osec=krb5,multiuser,username=smbadmin-8oz4Nevp0l1cSxESns1TRQ@public.gmane.org,cruid='0',uid=0
> --verbose
>
> cwseys:
> # cd /smb
> # kdestroy
> # ls /tmp/krb5cc_* -al
> [user's credential cache not listed]
> # cd to a directory on which cwseys not listed directly in ACLs (but
> # indirectly as part of a group)
> # cd obs-cos
> # ls
> ls: reading directory '.': Permission denied
> # kerberos cache file created with root owner/group !
> # The file has bytes in it, but not matching the size above. Wonder
> # what's in it... ?
> # ls /tmp/krb5cc_* -al
> -rw------- 1 root root 1050 Feb 22 11:09 /tmp/krb5cc_1494_sM11PG
> # now cannot kinit
> # kinit
> Password for cwseys-8oz4Nevp0l1cSxESns1TRQ@public.gmane.org:
> kinit: Failed to store credentials: Internal credentials cache error
> (filename: /tmp/krb5cc_1494_sM11PG) while getting initial credentials
>
> root:
> # lets look in the credential cache that was created by root.
> # looks like credentials used by root to mount /smb:
> # klist -c /tmp/krb5cc_1494_sM11PG
> Ticket cache: FILE:/tmp/krb5cc_1494_sM11PG
> Default principal: smbadmin-8oz4Nevp0l1cSxESns1TRQ@public.gmane.org
>
> Valid starting Expires Service principal
> 02/22/2017 11:27:41 03/04/2017 11:27:41
> krbtgt/PHYSICS.WISC.EDU-8oz4Nevp0l1cSxESns1TRQ@public.gmane.org
> 02/22/2017 11:27:41 03/04/2017 11:27:41
> cifs/smb02.physics.wisc.edu-8oz4Nevp0l1cSxESns1TRQ@public.gmane.org
>
Let's take this to the linux-cifs mailing list...
To be clear...I assume that you have a keytab set up someplace that has
the smbadmin@ credentials in it, correct? That's the only way that
cifs.upcall would instantiate a new credcache.
It sounds like you're walking into the DFS mount in a task that is
running as root, but that has inherited a KRB5CCNAME environment
variable from a cwseys@ login session.
It might be nice to see the debug level output from syslog, so we can
tell what's actually happening in the upcall. Can you provide that?
Thanks,
--
Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
next prev parent reply other threads:[~2017-02-23 12:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-15 16:15 [cifs-utils PATCH v3 0/4] cifs.upcall: allow cifs.upcall to scrape cache location initiating task's environment Jeff Layton
[not found] ` <20170215161522.17063-1-jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2017-02-15 16:15 ` [cifs-utils PATCH v4 1/4] cifs.upcall: convert two flags from int to bool Jeff Layton
2017-02-15 16:15 ` [cifs-utils PATCH v4 2/4] cifs.upcall: switch group IDs when handling an upcall Jeff Layton
[not found] ` <d29a36ca-693d-e3c6-9428-90b1ee9bce10@physics.wisc.edu>
[not found] ` <d29a36ca-693d-e3c6-9428-90b1ee9bce10-JAjqph6Yjy/rea2nFwT0Kw@public.gmane.org>
2017-02-23 12:45 ` Jeff Layton [this message]
[not found] ` <1487853902.7731.21.camel-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2017-02-23 20:18 ` problem when testing recent cifs.upcall Chad William Seys
[not found] ` <f922a603-0095-b86a-27a0-c7a6064e93d3-JAjqph6Yjy/rea2nFwT0Kw@public.gmane.org>
2017-02-23 21:10 ` Jeff Layton
[not found] ` <1487884245.3448.15.camel-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2017-02-23 21:30 ` Jeff Layton
[not found] ` <1487885407.3448.17.camel-vpEMnDpepFuMZCB2o+C8xQ@public.gmane.org>
2017-02-23 21:42 ` Jeff Layton
[not found] ` <1487886136.10904.1.camel-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2017-02-23 23:46 ` Simo Sorce
2017-02-24 0:35 ` Jeff Layton
[not found] ` <1487896552.14855.1.camel-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
2017-02-24 1:14 ` Simo Sorce
2017-02-15 16:15 ` [cifs-utils PATCH v4 3/4] cifs.upcall: drop capabilities early in program Jeff Layton
2017-02-15 16:15 ` [cifs-utils PATCH v4 4/4] cifs.upcall: allow scraping of KRB5CCNAME out of initiating task's /proc/<pid>/environ file Jeff Layton
2017-02-16 13:59 ` [cifs-utils PATCH v3 0/4] cifs.upcall: allow cifs.upcall to scrape cache location initiating task's environment Simo Sorce
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=1487853902.7731.21.camel@samba.org \
--to=jlayton-eunubhrolfbytjvyw6ydsg@public.gmane.org \
--cc=cwseys-JAjqph6Yjy/rea2nFwT0Kw@public.gmane.org \
--cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.