Bug 1184294 - Please fix unshare on new kernels
Summary: Please fix unshare on new kernels
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: util-linux
Version: 21
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-01-21 00:51 UTC by Andy Lutomirski
Modified: 2015-08-13 08:44 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-08-13 08:44:20 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Backport patches to fix unshare on new kernels. (11.01 KB, patch)
2015-06-28 19:29 UTC, Ting-Wei Lan
lantw44: review?
Details | Diff

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/


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