Bug 988146 - When using non-default umask settings, rhevm-iso-uploader uploads images with incorrect permissions and VMs cannot access them
Summary: When using non-default umask settings, rhevm-iso-uploader uploads images with...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-iso-uploader
Version: 3.2.0
Hardware: All
OS: Linux
high
high
Target Milestone: ---
: 3.3.0
Assignee: Sandro Bonazzola
QA Contact: Ilanit Stein
URL:
Whiteboard: integration
Depends On:
Blocks: 990144
TreeView+ depends on / blocked
 
Reported: 2013-07-24 20:49 UTC by Allie DeVolder
Modified: 2018-12-02 16:08 UTC (History)
10 users (show)

Fixed In Version: rhevm-iso-uploader-3.3.0-0.1.master.el6ev
Doc Type: Bug Fix
Doc Text:
When using non-default umask settings (such as 077), rhevm-iso-uploader uploaded images with incorrect permissions, so virtual machines could not access the images. This has been fixed so that rhevm-iso-uploader sets the correct umask when renaming the temporary file to the destination file during upload, and prevents providing incorrect access permissions on systems with non-standard umask settings.
Clone Of:
: 990144 (view as bug list)
Environment:
Last Closed: 2014-01-21 16:31:14 UTC
oVirt Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:0077 0 normal SHIPPED_LIVE rhevm-iso-uploader bug fix and enhancement update 2014-01-21 20:36:29 UTC
oVirt gerrit 17411 0 None None None Never

Description Allie DeVolder 2013-07-24 20:49:24 UTC
Description of problem:
When using non-default umask settings (as required by government agencies), rhevm-iso-uploader uploads images with incorrect permissions and VMs cannot access them.

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

How reproducible:
Very

Steps to Reproduce:
1. Create RHEV-M with the default local ISO domain, and set umask settings as required for most government agencies. (077)
2. Use rhevm-iso-uploader to upload an ISO to the ISO domain
3. Attempt to boot VM using that ISO.

Actual results:
Virtual machine failed to boot from attached ISO CD with error message "Boot failed: Could not read from CDROM (code 0003)"

Expected results:
Successful boot

Additional info:
While we know that the non-default umask is the problem here, there are enough users in hardened/secure environments that the rhevm-iso-uploader tool should check permissions upon upload, rather than using the default umask

Comment 1 Sandro Bonazzola 2013-07-29 07:18:37 UTC
I assume that image-uploader will be affected as well.
The strange thing is that iso-uploader sets umask for having 0660 file access mode (copy_file method).
Maybe it's not enough, since after the copy it seems that the file are renamed and that's done with system umask.
I think that it's better to totally ignore the umask and use chmod on the file to ensure it's permissions.

Comment 2 Sandro Bonazzola 2013-07-29 09:57:18 UTC
Hi Allan, can you confirm that the issue on iso-uploader affects only uploads done through NFS and not uploads done through SSH ?

Comment 3 Sandro Bonazzola 2013-07-29 10:30:37 UTC
(In reply to Sandro Bonazzola from comment #1)
> I think that it's better to totally ignore the umask and use chmod on the
> file to ensure it's permissions.

Can't chmod over NFS mounted domain. Will fix setting correct umask while renaming.

Comment 4 Sandro Bonazzola 2013-07-29 10:40:06 UTC
Patch pushed on master branch for 3.3.0:

  upload: nfs: set correct umask while renaming

  set the correct umask while renaming the temporary
  file to destination file. Avoid to have incorrect
  access bits on systems with not standard umask
  (like 077)

(setting again needinfo flag, removed accidentally in previous comment)

Comment 5 Sandro Bonazzola 2013-07-29 10:46:11 UTC
(In reply to Sandro Bonazzola from comment #1)
> I assume that image-uploader will be affected as well.

image uploader should not be affected, no renaming after file copy.

Comment 6 Allie DeVolder 2013-07-29 16:26:23 UTC
(In reply to Sandro Bonazzola from comment #2)
> Hi Allan, can you confirm that the issue on iso-uploader affects only
> uploads done through NFS and not uploads done through SSH ?

I don't have a system I can reproduce this on, and the customer closed the case as soon as they discovered the permissions issue. I filed the bug because that shouldn't be normal behaviour.

Comment 7 Sandro Bonazzola 2013-07-30 13:17:25 UTC
(In reply to Allan Voss from comment #6)
> I don't have a system I can reproduce this on, and the customer closed the
> case as soon as they discovered the permissions issue. I filed the bug
> because that shouldn't be normal behaviour.

Ok. no problem. I've checked the code and ssh upload uses chown on remote system so there can't be umask issue there.

Comment 8 Sandro Bonazzola 2013-07-30 13:22:58 UTC
merged upstream master for 3.3.0.

Comment 11 Ilanit Stein 2013-08-13 13:30:21 UTC
Verified on is9.1, same as bug 990144 verified.

Comment 12 errata-xmlrpc 2014-01-21 16:31: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-0077.html


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