Bug 510184 - NFSD returns NFS4_OK(0) when OPEN with access==read/write on a read-denied/write-denied file
NFSD returns NFS4_OK(0) when OPEN with access==read/write on a read-denied/wr...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
4.8
All Linux
medium Severity medium
: rc
: 4.9
Assigned To: Jeff Layton
yanfu,wang
:
Depends On:
Blocks: 1023271
  Show dependency treegraph
 
Reported: 2009-07-08 04:05 EDT by Harshula Jayasuriya
Modified: 2013-10-25 01:30 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1023271 (view as bug list)
Environment:
Last Closed: 2011-02-16 11:00:02 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Testcase from Fujitsu (9.93 KB, text/x-csrc)
2009-07-08 04:06 EDT, Harshula Jayasuriya
no flags Details
Patch from Fujitsu (untested) (1.93 KB, patch)
2009-07-08 04:10 EDT, Harshula Jayasuriya
no flags Details | Diff

  None (edit)
Description Harshula Jayasuriya 2009-07-08 04:05:42 EDT
Details from Fujitsu:
------------------------------------------------------------
Description of Problem:

    According to RFC3530, the checking of share reservations on OPEN is done with no
    exception for an existing OPEN for the same open_owner, but the RHEL4.8GA doesn't
    check the share reservations when it finds an existing OPEN for the same open_owner.
    
    So when open with access == read/write on a read-denied/write-denied file should return
    NFS4ERR_SHARE_DENIED(10015), instead got NFS4_OK(0).

Version-Release number of selected component:

 Red Hat Enterprise Linux Version Number: RHEL4
 Release Number:    4.8 GA
 Architecture:       x86_64
 Kernel Version:    kernel-2.6.9-89.EL
 Related Package Version:    none
 Related Middleware / Application:    none

Drivers or hardware or architecture dependency:

 None

How reproducible:

 Every time

Step to Reproduce:

 I prepared a reproduction program.
 Please execute this program according to the following procedure.
 
Server :
  Step1
       # cat /etc/exports
          /mnt *(rw,insecure,fsid=0,no_root_squash)
   Step2
        # service nfs start
     
 Client :
      Step1: # mount -t nfs4 SERVERADDR:/ /mnt

      Step2: create a temporary directory for test
     # mkdir /mnt/tmp

      Step3: # gcc -o open_share_deny open_share_deny.c

      Step4: # ./open_share_deny SERVERADDR

      Step5: clean up the test file
             # rm -rf /mnt/tmp
             
Actual Results:

  Kernel return NFS4_OK(0).

  Reproduction program log.
  # ./open 10.167.141.170
    ==================== FAIL ===========================
      OPEN with access==read on a read-denied file should
      return NFS4ERR_SHARE_DENIED, instead got NFS4_OK

Expected Results:

 Kernel return NFS4ERR_SHARE_DENIED(10015)
 
  Reproduction program log.
  # ./open 10.167.141.170
      ==================== PASS===========================
       OPEN with access==read on a read-denied file
       return NFS4ERR_SHARE_DENIED
       
Summary of actions taken to resolve issue:

 None

Location of diagnostic data:

 None

Hardware configuration:

 Model:        PRIMERGY TX150 S5
 CPU Info:     Intel(R) Xeon(R) CPU   3040  @ 1.86GHz
 Memory Info:  6GB

Business Impact:

 Target Release: 4.9

 Errata Request: No

 Hotfix Request: No

Additional Info:

 Patch file :
   NFSD-check-open.patch

 Reproduction program :
   open_share_deny.c
------------------------------------------------------------

* The aforementioned patch appears to be based on:
  - http://marc.info/?l=linux-nfs&m=109600225123868&w=2
  - http://marc.info/?l=linux-nfs&m=111147024324636&w=2
* RHEL 5 kernel contains the code that is referred to in these patches.
Comment 1 Harshula Jayasuriya 2009-07-08 04:06:46 EDT
Created attachment 350904 [details]
Testcase from Fujitsu
Comment 2 Harshula Jayasuriya 2009-07-08 04:10:14 EDT
Created attachment 350905 [details]
Patch from Fujitsu (untested)
Comment 3 Jeff Layton 2009-08-12 14:42:30 EDT
I went ahead and added these patches to my test kernels:

http://people.redhat.com/jlayton

If you're able to test them and confirm that it fixes the problem for you, then that would also be helpful.
Comment 7 RHEL Product and Program Management 2010-07-19 06:59:08 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 9 Vivek Goyal 2010-09-17 13:51:36 EDT
Committed in 89.36.EL . RPMS are available at http://people.redhat.com/vgoyal/rhel4/
Comment 14 errata-xmlrpc 2011-02-16 11:00:02 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0263.html

Note You need to log in before you can comment on or make changes to this bug.