Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1059853

Summary: gfs2_grow changes mtab permissions to 600
Product: Red Hat Enterprise Linux 6 Reporter: Ryan Crews <rcrews>
Component: clusterAssignee: Andrew Price <anprice>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.4CC: 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:
Description Flags
Submitted patch none

Description Ryan Crews 2014-01-30 19:41:42 UTC
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:

Comment 2 Andrew Price 2014-01-31 10:50:39 UTC
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

Comment 3 Andrew Price 2014-02-04 12:33:05 UTC
Created attachment 859110 [details]
Submitted patch

I've submitted this patch for review. Still waiting on pm_ack+.

Comment 4 Andrew Price 2014-02-04 12:41:55 UTC
Pushed to cluster.git/RHEL6

Comment 5 James Radtke 2014-03-06 07:04:35 UTC
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.

Comment 7 James Radtke 2014-04-11 16:39:52 UTC
(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).

Comment 8 Andrew Price 2014-04-12 20:45:09 UTC
(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.

Comment 12 errata-xmlrpc 2014-10-14 04:45:14 UTC
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