Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1059853 - gfs2_grow changes mtab permissions to 600
Summary: gfs2_grow changes mtab permissions to 600
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: cluster
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Andrew Price
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks: 1073384
TreeView+ depends on / blocked
 
Reported: 2014-01-30 19:41 UTC by Ryan Crews
Modified: 2018-12-09 17:28 UTC (History)
10 users (show)

Fixed In Version: cluster-3.0.12.1-61.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1073384 (view as bug list)
Environment:
Last Closed: 2014-10-14 04:45:14 UTC


Attachments (Terms of Use)
Submitted patch (deleted)
2014-02-04 12:33 UTC, Andrew Price
no flags Details | Diff


Links
System ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 787743 None None None Never
Red Hat Product Errata RHBA-2014:1420 normal SHIPPED_LIVE cluster bug fix and enhancement update 2014-10-14 01:06:26 UTC

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


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