Bug 1184294

Summary: Please fix unshare on new kernels
Product: [Fedora] Fedora Reporter: Andy Lutomirski <luto>
Component: util-linuxAssignee: Karel Zak <kzak>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: jonathan, kzak, lantw44
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-13 08:44:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Backport patches to fix unshare on new kernels. lantw44: review?

Description Andy Lutomirski 2015-01-21 00:51:21 UTC
On recent kernels (3.18.2 and up, and possibly some kernels on the 3.17 branch), unshare -r no longer works when run as an unprivileged user.  It fails like this:

$ unshare -r
unshare: write failed /proc/self/gid_map: Operation not permitted

It's fixed by these two upstream commits:

https://git.kernel.org/cgit/utils/util-linux/util-linux.git/commit/sys-utils/unshare.c?id=0bf159413bdb9e324864a422b7aecb081e739119

https://git.kernel.org/cgit/utils/util-linux/util-linux.git/commit/sys-utils/unshare.c?id=fbceefded6645de693d576cd988a703a6f60d207

Can you backport those two commits?

Thanks,
Andy

Comment 1 Ting-Wei Lan 2015-04-12 18:34:12 UTC
unshare works after applying two patches mentioned above.  5e43af7e345310f734cbfb5a0bd6ee040cf178a7 (with changes to files other than unshare.1 removed) is also needed to get unshare.1 patch successfully applied.

Comment 2 Ting-Wei Lan 2015-06-28 19:29:46 UTC
Created attachment 1044099 [details]
Backport patches to fix unshare on new kernels.

Comment 3 Karel Zak 2015-06-29 13:50:54 UTC
What about to update to f22? :-)

Comment 4 Ting-Wei Lan 2015-06-29 14:00:41 UTC
F22 uses util-linux 2.26.2, which already has the fix.

Comment 5 Ting-Wei Lan 2015-07-06 15:42:44 UTC
Will this problem be fixed? Or users needing this feature should upgrade to f22? I had a util-linux build with the same patches applied to fix the problem for f21, but I no longer maintain it because all of my systems has been upgraded to f22.

https://copr.fedoraproject.org/coprs/lantw44/util-linux-unshare-f21/