Bug 236848 - mount/fstab.c:lock_mtab() should open with proper permissions
mount/fstab.c:lock_mtab() should open with proper permissions
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: util-linux (Show other bugs)
4.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Karel Zak
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-17 19:11 EDT by Kevin Graham
Modified: 2010-10-22 10:25 EDT (History)
2 users (show)

See Also:
Fixed In Version: RHBA-2007-0785
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-11-15 11:06:13 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to fix mtab~ lock permission when CAP_DAC_OVERRIDE is revoked (913 bytes, patch)
2007-05-28 18:05 EDT, Flavio Leitner
no flags Details | Diff

  None (edit)
Description Kevin Graham 2007-04-17 19:11:28 EDT
Description of problem:

In lock_mtab, when the lockfile is created (w/ O_CREAT), the permissions
specified are improper. Instead of '0', this should presumably be set to '0600'. 

Version-Release number of selected component (if applicable):

Observed in util-linux 2.12, though hadn't verified others.

How reproducible:

Drop CAP_DAC_OVERRIDE and watch mounts fail due to inability to acquire a lock
on the mtab.

Steps to Reproduce:
1. sysctl -w kernel.cap-bound=0xf7fd7df5
2. mount -t tmpfs /dev/swap /mnt
  
Actual results:

$ mount -t tmpfs /dev/swap /mnt
can't open lock file /etc/mtab~: Permission denied (use -n flag to override)
$


Expected results:

A mounted filesystem, with proper locking of mtab.

Additional info:

See RH Enterprise issue 116584.
Comment 2 Karel Zak 2007-05-14 15:55:14 EDT
Yes, the request makes sense.
Comment 3 RHEL Product and Program Management 2007-05-14 16:03:59 EDT
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.
Comment 5 Flavio Leitner 2007-05-28 18:05:45 EDT
Created attachment 155566 [details]
Patch to fix mtab~ lock permission when CAP_DAC_OVERRIDE is revoked

Attached a patch to fix based on devel, but works in rhel4 too.
Comment 9 Fedora Update System 2007-08-09 12:49:21 EDT
util-linux-2.13-0.54.fc7 has been pushed to the Fedora 7 testing repository.  If problems still persist, please make note of it in this bug report.
Comment 10 Fedora Update System 2007-08-24 01:45:50 EDT
util-linux-2.13-0.54.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 13 errata-xmlrpc 2007-11-15 11:06:13 EST
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 the 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/RHBA-2007-0785.html

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