Bug 1030728

Summary: [] When export dir with sec=krb5; Client mount success, but ls fail with permission, and ls -l return invalid argument
Product: Red Hat Enterprise Linux 5 Reporter: JianHong Yin <jiyin>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED NOTABUG QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: high Docs Contact:
Priority: unspecified    
Version: 5.11CC: jlayton
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-02-10 13:32:48 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:
Embargoed:

Description JianHong Yin 2013-11-15 03:00:09 UTC
Description of problem:
When export dir with sec=krb5; Client mount success, but ls fail with permission, and ls -l return invalid argument.

Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1. In server, krb5 config and add keytab file
   start rpcsvcgssd
   export "/usr/share *(ro,sec=krb5)"
   start nfs server
2. In client, krb5 config and add keytab file
   start rpcgssd
   mount $server:/usr/share  /nfsmp
   ls -l /nfsmp
   ls /nfsmp
3.

Actual results:
================================================================================
[21:09:35 root@ /mnt/tests/CoreOS/nfs-utils/krb5-test/base]# showmount -e $SERVER_nfs
Export list for hp-sl390s-01.rhts.eng.bos.redhat.com:
/usr/share       *
/usr/local/share *
--------------------------------------------------------------------------------

================================================================================
[21:09:36 root@ /mnt/tests/CoreOS/nfs-utils/krb5-test/base]# mount $SERVER_nfs:/usr/share  /nfs-mp
--------------------------------------------------------------------------------

================================================================================
[21:09:36 root@ /mnt/tests/CoreOS/nfs-utils/krb5-test/base]# mount | grep "$SERVER_nfs:/usr/share"
hp-sl390s-01.rhts.eng.bos.redhat.com:/usr/share on /nfs-mp type nfs (rw,addr=10.16.67.67)
--------------------------------------------------------------------------------

================================================================================
[21:09:36 root@ /mnt/tests/CoreOS/nfs-utils/krb5-test/base]# ls -d /nfs-mp
/nfs-mp
--------------------------------------------------------------------------------

================================================================================
[21:09:36 root@ /mnt/tests/CoreOS/nfs-utils/krb5-test/base]# ls -l /nfs-mp | tail
ls: /nfs-mp: Invalid argument  <<<--- when use ls -l, get Invalid argument err.
ls: /nfs-mp: Permission denied
--------------------------------------------------------------------------------

================================================================================
[21:09:36 root@ /mnt/tests/CoreOS/nfs-utils/krb5-test/base]# ls    /nfs-mp | tail
ls: /nfs-mp: Permission denied
--------------------------------------------------------------------------------

Expected results:


Additional info:
  test in RHEL6 RHEL7 PASS.

Comment 1 RHEL Program Management 2014-01-29 10:33:52 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 2 Steve Dickson 2014-02-10 13:32:48 UTC
(In reply to Yin.JianHong from comment #0)
> Description of problem:
> When export dir with sec=krb5; Client mount success, but ls fail with
> permission, and ls -l return invalid argument.
> 
> Steps to Reproduce:
> 1. In server, krb5 config and add keytab file
>    start rpcsvcgssd
>    export "/usr/share *(ro,sec=krb5)"
>    start nfs server
> 2. In client, krb5 config and add keytab file
>    start rpcgssd
>    mount $server:/usr/share  /nfsmp
>    ls -l /nfsmp
>    ls /nfsmp

The EINVAL is coming from how the 
   getxattr("/mnt/home", "system.posix_acl_access", 0x0, 0)
system fails.

When the mount is mounted using the -o sec=krb5 flag the
system call fails with ENODATA which is not printed to sdterr
but when -o sec=krb5 flag is not used the system call fails 
with a EINVAL which is written to stderr by the ls command.

This is simply a function of how ls works in RHEL5