Bug 1059853
| Summary: | gfs2_grow changes mtab permissions to 600 | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Ryan Crews <rcrews> | ||||
| Component: | cluster | Assignee: | Andrew Price <anprice> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Cluster QE <mspqa-list> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 6.4 | CC: | adeshmuk, ccaulfie, cluster-maint, jaeshin, james.radtke, mjuricek, rpeterso, sbradley, swhiteho, teigland | ||||
| Target Milestone: | rc | ||||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | cluster-3.0.12.1-61.el6 | Doc Type: | Bug Fix | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | |||||||
| : | 1073384 (view as bug list) | Environment: | |||||
| Last Closed: | 2014-10-14 04:45:14 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: | |||||||
| Bug Depends On: | |||||||
| Bug Blocks: | 1073384 | ||||||
| Attachments: |
|
||||||
It appears that we used an overly restrictive umask when we fixed a covscan defect where the umask wasn't being set before a mkstemp() in the last release: mask = umask(S_IXUSR | S_IRWXG | S_IRWXO); should be mask = umask(S_IXUSR | S_IWGRP | S_IXGRP | S_IWOTH | S_IXOTH ); The temporary file then gets renamed to /etc/mtab. This doesn't affect RHEL7 or upstream because /etc/mtab is a symlink to /proc/mounts Created attachment 859110 [details]
Submitted patch
I've submitted this patch for review. Still waiting on pm_ack+.
Pushed to cluster.git/RHEL6 This appears to affect RHEL 5 as well. [root@gfshost ~]# ls -l /etc/mtab -rw------- 1 root root 653 Mar 6 01:36 /etc/mtab [root@gfshost ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.10 (Tikanga) I unfortunately do not have the ability to reproduce at this time. (In reply to James Radtke from comment #5) > This appears to affect RHEL 5 as well. > [root@gfshost ~]# ls -l /etc/mtab > -rw------- 1 root root 653 Mar 6 01:36 /etc/mtab > > [root@gfshost ~]# cat /etc/redhat-release > Red Hat Enterprise Linux Server release 5.10 (Tikanga) > > I unfortunately do not have the ability to reproduce at this time. I have discovered that this bug also exists under "normal circumstances" not only when executing a gfs2_grow. We have a 2-node cluster with a GFS mount. When a node would be fenced, the surviving node would have the /etc/mtab permissions reset (discovered by enabling audit for mtab). (In reply to James Radtke from comment #7) > I have discovered that this bug also exists under "normal circumstances" not > only when executing a gfs2_grow. We have a 2-node cluster with a GFS mount. > When a node would be fenced, the surviving node would have the /etc/mtab > permissions reset (discovered by enabling audit for mtab). The bug is in code shared between several tools so it's possible that one of the other affected tools is being run, either directly or indirectly by another tool (we know that sos runs gfs2_tool to gather data and can hit this bug for instance). The gfs2 utilities which may cause /etc/mtab to be set 0600 due to this bug are: gfs2_grow, gfs2_tool, gfs2_jadd and gfs2_quota. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2014-1420.html |
Description of problem: Running gfs2_grow will change /etc/mtab permissions from 644 default to 600. Version-Release number of selected component (if applicable): gfs2-utils-3.0.12.1-59.el6_5.1.x86_64 gfs2-utils-3.0.12.1-49.el6_4.2.x86_64 How reproducible: 100% of time Steps to Reproduce: 1. Increase size of a gfs2 filesystem partition/LV. 2. Check permissions on /etc/mtab 3. Run gfs2_grow on gfs2 filesystem. 4. Check permissions on /etc/mtab Actual results: gfs2_grow complete. [root@luka uguu]# ll /etc/mtab -rw-------. 1 root root 532 Jan 30 14:23 /etc/mtab full details: [root@luka uguu]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_kaito-lv_root 5.5G 4.0G 1.3G 77% / tmpfs 499M 0 499M 0% /dev/shm /dev/vda1 485M 33M 427M 8% /boot /root/new-fs 243M 6.1M 224M 3% /mnt/newfs /dev/mapper/vg_kaito-gfs2 212M 150M 63M 71% /mnt/uguu [root@luka uguu]# ll /etc/mtab -rw-r--r--. 1 root root 532 Jan 30 14:21 /etc/mtab [root@luka uguu]# lvresize -l 60 /dev/vg_kaito/gfs2 Extending logical volume gfs2 to 240.00 MiB Logical volume gfs2 successfully resized [root@luka uguu]# gfs2_grow /dev/mapper/vg_kaito-gfs2 Error: The device has grown by less than one Resource Group (RG). The device grew by 28MB. One RG is 211MB for this file system. gfs2_grow complete. [root@luka uguu]# ll /etc/mtab -rw-------. 1 root root 532 Jan 30 14:23 /etc/mtab Expected results: -rw-r--r--. 1 root root 532 Jan 30 14:21 /etc/mtab Additional info: