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.
Created attachment 350904 [details] Testcase from Fujitsu
Created attachment 350905 [details] Patch from Fujitsu (untested)
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.
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.
Committed in 89.36.EL . RPMS are available at http://people.redhat.com/vgoyal/rhel4/
Manual test in i386 and x86_64 arch, results passed. Create rhts testcase for it, job links shown as below. run against RHEL4-U8, results failed: https://beaker.engineering.redhat.com/jobs/41753 https://beaker.engineering.redhat.com/jobs/41764 https://beaker.engineering.redhat.com/jobs/41765 https://beaker.engineering.redhat.com/jobs/41766 https://beaker.engineering.redhat.com/jobs/41767 https://beaker.engineering.redhat.com/jobs/41768 run against kernel 2.6.9-94.EL, results passed, pls ignore avc error: https://beaker.engineering.redhat.com/jobs/41755 https://beaker.engineering.redhat.com/jobs/41769 https://beaker.engineering.redhat.com/jobs/41770 https://beaker.engineering.redhat.com/jobs/41771 https://beaker.engineering.redhat.com/jobs/41772 https://beaker.engineering.redhat.com/jobs/41773
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