Bug 988146 - When using non-default umask settings, rhevm-iso-uploader uploads images with incorrect permissions and VMs cannot access them
When using non-default umask settings, rhevm-iso-uploader uploads images with...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-iso-uploader (Show other bugs)
3.2.0
All Linux
high Severity high
: ---
: 3.3.0
Assigned To: Sandro Bonazzola
Ilanit Stein
integration
: ZStream
Depends On:
Blocks: 990144
  Show dependency treegraph
 
Reported: 2013-07-24 16:49 EDT by Allan Voss
Modified: 2015-09-22 09 EDT (History)
10 users (show)

See Also:
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.
Story Points: ---
Clone Of:
: 990144 (view as bug list)
Environment:
Last Closed: 2014-01-21 11:31:14 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 17411 None None None Never

  None (edit)
Description Allan Voss 2013-07-24 16:49:24 EDT
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 03:18:37 EDT
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 05:57:18 EDT
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 06:30:37 EDT
(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 06:40:06 EDT
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 06:46:11 EDT
(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 Allan Voss 2013-07-29 12:26:23 EDT
(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 09:17:25 EDT
(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 09:22:58 EDT
merged upstream master for 3.3.0.
Comment 11 Ilanit Stein 2013-08-13 09:30:21 EDT
Verified on is9.1, same as bug 990144 verified.
Comment 12 errata-xmlrpc 2014-01-21 11:31:14 EST
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.