Bug 236848 - mount/fstab.c:lock_mtab() should open with proper permissions
Summary: mount/fstab.c:lock_mtab() should open with proper permissions
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: util-linux   
(Show other bugs)
Version: 4.0
Hardware: All Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Karel Zak
QA Contact: Ben Levenson
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-04-17 23:11 UTC by Kevin Graham
Modified: 2018-10-19 22:44 UTC (History)
2 users (show)

Fixed In Version: RHBA-2007-0785
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-11-15 16:06:13 UTC
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 22:05 UTC, Flavio Leitner
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2007:0785 normal SHIPPED_LIVE util-linux bug fix and enhancement update. 2007-11-14 18:35:14 UTC

Description Kevin Graham 2007-04-17 23:11:28 UTC
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 19:55:14 UTC
Yes, the request makes sense.

Comment 3 RHEL Product and Program Management 2007-05-14 20:03:59 UTC
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 22:05:45 UTC
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 16:49:21 UTC
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 05:45:50 UTC
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 16:06:13 UTC
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.