Description of problem: NFSv3 server will update the mode of a symlink file. Kernel should igonre any mode updates on symlink, but it does't check the file type before update mode on the file. Version-Release number of selected component (if applicable): RHEL4U6 (kernel-2.6.9-67.EL) Additional info: To resolve this problem, I have made the patch for the kernel. If client tries to change the mode of symlink, kernel will igonre it. After the patch is applied, the problem can be resolved.
Created attachment 298339 [details] The patch for fs/nfsd/vfs.c of the kernel.
Patch looks reasonable. How are you reproducing this problem? We'll need to be able to give our QA team a way to verify that this patch actually fixes the problem.
Created attachment 298763 [details] Use the c program to reproduce this problem. Use the c program in attachment to reproduce this problem. Reproduce Environment : 1. server: RHEL4.6 192.168.0.21 server: /etc/exports: /tmp *(rw, insecure, no_root_squash) 2. client: 192.168.0.19 Steps to Reproduce : 1. server: service nfs restart 2. server: touch /tmp/tmpfile 3. server: ln -s /tmp/tmpfile /tmp/link 4. server: ll /tmp 5. client: gcc -g -o link_setattr link_setattr.c 6. client: ./link_setattr 192.168.0.21 /tmp 7. server: ll /tmp Actual Results: Step4: [root@RHEL4U6_NUT ~]# ll /tmp/ total 0 lrwxrwxrwx 1 root root 12 Mar 7 13:43 link -> /tmp/tmpfile -rwxrwxrwx 1 root root 0 Mar 7 12:59 tmpfile Step7: [root@RHEL4U6_NUT ~]# ll /tmp/ total 0 lr--r--r-- 1 root root 12 Mar 7 13:43 link -> /tmp/tmpfile -rwxrwxrwx 1 root root 0 Mar 7 12:59 tmpfile
Created attachment 302448 [details] upstream patch This is the upstream patch. It applies cleanly to RHEL4. It's the same as the proposed patch, except that it also eliminates a redundant check of ia_valid from earlier in the function (no point in checking it until after we possibly clear ATTR_MODE here).
Confirmed that patch works...
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.
Updating PM score.
Committed in 78.12.EL . RPMS are available at http://people.redhat.com/vgoyal/rhel4/
~~ Attention Partners! Snap 1 Released ~~ RHEL 4.8 Snapshot 1 has been released on partners.redhat.com. There should be a fix present, which addresses this bug. NOTE: there is only a short time left to test, please test and report back results on this bug at your earliest convenience. If you encounter any issues, please set the bug back to the ASSIGNED state and describe the issues you encountered. If you have found a NEW bug, clone this bug and describe the issues you encountered. Further questions can be directed to your Red Hat Partner Manager. If you have VERIFIED the bug fix. Please select your PartnerID from the Verified field above. Please leave a comment with your test results details. Include which arches tested, package version and any applicable logs. - Red Hat QE Partner Management
~~ Attention! Snap 4 Released ~~ RHEL 4.8 Snapshot 4 has been released on partners.redhat.com. There should be a fix present that addresses this bug. NOTE: there is only a short time left to test, please test and report back results on this bug ASAP. The latest kernel build can be obtained here: http://people.redhat.com/vgoyal/rhel4/ If you encounter any issues, please set the bug back to the ASSIGNED state and describe the issues you encountered. If you have found a NEW bug, clone this bug and describe the issues you encountered. Further questions can be directed to your Red Hat Partner Manager. If you have VERIFIED the bug fix. Please select your PartnerID from the Verified field above. Please leave a comment with your test results details. Include which arches tested, package version and any applicable logs.
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-2009-1024.html