Skip to content
This repository was archived by the owner on Oct 10, 2020. It is now read-only.

XFS cannot have nosuid when mounting#199

Merged
rhatdan merged 1 commit intoprojectatomic:masterfrom
baude:nosuid
Nov 3, 2015
Merged

XFS cannot have nosuid when mounting#199
rhatdan merged 1 commit intoprojectatomic:masterfrom
baude:nosuid

Conversation

@baude
Copy link
Member

@baude baude commented Oct 28, 2015

Atomic/mount.py:
    Under certain conditions, nosuid was still being
    injected into the mount options.

@baude baude force-pushed the nosuid branch 2 times, most recently from cdbb494 to dab9f29 Compare October 28, 2015 23:25
@baude
Copy link
Member Author

baude commented Oct 28, 2015

@rhatdan Assuming this passes checks (ill check in the morning), can you review my use of while conditions to "wait" on on the thinpool device to activate? I'd like your opinion. I'm also not super fond of using a sleep condition to buy time, but I also thought the one while loop should have an "out" in case the condition is never met. Do you think both should as well?

@rhatdan
Copy link
Member

rhatdan commented Oct 29, 2015

@rjvgoyal is there a better way.

@baude Looks like you got a chance at an Infinite loop here.

@baude
Copy link
Member Author

baude commented Oct 29, 2015

@rhatdan When you mount with thinpool, if the filesystem is XFS, you cannot use nosuid (it must use nouuid). After talking with @rhvgoyal, he confirmed that and that it should be nouuid when using XFS and nothing for EXT4.

@baude baude force-pushed the nosuid branch 2 times, most recently from 3434b2e to cdd7bcc Compare October 30, 2015 18:43
@baude
Copy link
Member Author

baude commented Oct 30, 2015

@rhatdan Updated per our conversation today.

@rhvgoyal
Copy link

@baude I talked to few folks here who know much more about dmsetup and they said that --addnodeoncreate is for systems not having udev.

they think that by default by the time "dmsetup create --table<>" returned, udev must have settled down.

So please remove this and if problem is still happening, we need to debug why you are getting EBUSY during remove.

@rhvgoyal
Copy link

@baude

One more thing. "dmsetup remove" seems to support option --retry. Which will try device removal if it fails first time.

Following is from "man dmsetup".

If an attempt to remove a device fails, perhaps because a process run from a quick udev rule temporarily opened the device, the --retry option will cause the operation to be retried for a few seconds before failing.

May be give it a try and see if this solves the issue you are facing.

@baude
Copy link
Member Author

baude commented Nov 1, 2015

Updated to include --retry on the dmsetup remove per @rhvgoyal

@baude
Copy link
Member Author

baude commented Nov 2, 2015

Re-added --nosuid after conversation with @rhvgoyal; so now XFS mounts will have both 'nouuid' and 'nosuid' and we retain the --retry option.

    Atomic/mount.py:
        Sometimes devices fail removal due to race-like
        conditions with EBUSY.  Adding --retry option
        to prevent these failures.
@rhatdan
Copy link
Member

rhatdan commented Nov 3, 2015

I only see --retry?

@rhvgoyal
Copy link

rhvgoyal commented Nov 3, 2015

nosuid and nouuid can coexist. So we really don't seem to have a need to remove nosuid. If you want to remove it explicitly for some other reason, then that can be done in separate PR. But that does not seem to be a requirement atleast for the failure baude was seeing.

@baude
Copy link
Member Author

baude commented Nov 3, 2015

@rhatdan yes, the agreement yesterday was to only use --retry. The nouuid stuff is already in there from previous commits.

@rhatdan
Copy link
Member

rhatdan commented Nov 3, 2015

Ok, LGTM.

I think having NOSUID is good. We don't want new file systems with SUID binaries showing up on the host where unpriv processes might be able to take advantage.

@rhatdan rhatdan closed this Nov 3, 2015
@rhatdan rhatdan reopened this Nov 3, 2015
rhatdan added a commit that referenced this pull request Nov 3, 2015
XFS cannot have nosuid when mounting
@rhatdan rhatdan merged commit ea18c14 into projectatomic:master Nov 3, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants