Bug 1378806

Summary: samba: can't mount cifs with kerberos keytab method in some vm machines.
Product: Red Hat Enterprise Linux 7 Reporter: xiaoli feng <xifeng>
Component: sambaAssignee: Andreas Schneider <asn>
Status: CLOSED NOTABUG QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: medium    
Version: 7.3CC: asn, eguan, gdeschner, jrivera, mkosek, rhack, sbose, sprabhu, xifeng
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-14 15:21:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1400961, 1472751    

Description xiaoli feng 2016-09-23 09:52:57 UTC
Description of problem:
In some kvm machines, can't mount cifs with kerberos keytab method. The client print the error:

[root@hp-dl380pg8-10 krb5]# mount.cifs //ibm-x3650m4-01-vm-06.lab.eng.bos.redhat.com/cifs /mnt/testarea/client -o sec=krb5
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
[root@hp-dl380pg8-10 krb5]# dmesg
[1321886.875290] CIFS VFS: Send error in SessSetup = -22
[1321886.900798] CIFS VFS: cifs_mount failed w/return code = -22


The server side in /var/log/message is:

Sep 23 04:19:29 ibm-x3650m4-01-vm-06 smbd[12082]: [2016/09/23 04:19:29.100859,  0] ../source3/librpc/crypto/gse.c:393(gse_init_server)
Sep 23 04:19:29 ibm-x3650m4-01-vm-06 smbd[12082]:  gss_krb5_import_cred failed with [Unspecified GSS failure.  Minor code may provide more information: Keytab MEMORY:cifs_srv_keytab is nonexistent or empty]


The reproduced server is ibm-x3650m4-01-vm-06.lab.eng.bos.redhat.com.

Version-Release number of selected component (if applicable):
samba-4.4.4-9.el7.x86_64
kernel-3.10.0-506.el7.x86_64


How reproducible:

100%
Steps to Reproduce:
1.smb.conf
[global]
    workgroup = RHTS
    realm = RHQE.COM
    security = ads
    server signing = auto
    kerberos method = system keytab

[cifs]
    path = /mnt/testarea/server
    writeable = yes


2.mount.cifs //$SERVER/cifs /mnt/testarea/client -o sec=krb5
3.

Actual results:
mount cifs return failed

Expected results:
mount cifs return successfully

Additional info:
Not sure why it happens on there vm machines.
But nfs doesn't have this issue.

Comment 8 Andreas Schneider 2017-08-14 15:21:29 UTC
According to comment #5 this seems to be a configuration issue. We do not have the krb5.conf and don't know the process how the machine was joined. However it sounds like that the wrong REALM was used during join so we have a keytab with invalid information.

You can recreate the keytab with 'net ads keytab create'.

If you have a reproducer you can describe in details please feel free to reopen.