)]}'
{
  "commit": "59607db367c57f515183cb203642291bb14d9c40",
  "tree": "9097cfc3a72820c5624de6a24c9fa9cf28b6cb35",
  "parents": [
    "52e9fc76d0d4b1e8adeee736172c6c23180059b2"
  ],
  "author": {
    "name": "Serge E. Hallyn",
    "email": "serge@hallyn.com",
    "time": "Wed Mar 23 16:43:16 2011 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Wed Mar 23 19:46:59 2011 -0700"
  },
  "message": "userns: add a user_namespace as creator/owner of uts_namespace\n\nThe expected course of development for user namespaces targeted\ncapabilities is laid out at https://wiki.ubuntu.com/UserNamespace.\n\nGoals:\n\n- Make it safe for an unprivileged user to unshare namespaces.  They\n  will be privileged with respect to the new namespace, but this should\n  only include resources which the unprivileged user already owns.\n\n- Provide separate limits and accounting for userids in different\n  namespaces.\n\nStatus:\n\n  Currently (as of 2.6.38) you can clone with the CLONE_NEWUSER flag to\n  get a new user namespace if you have the CAP_SYS_ADMIN, CAP_SETUID, and\n  CAP_SETGID capabilities.  What this gets you is a whole new set of\n  userids, meaning that user 500 will have a different \u0027struct user\u0027 in\n  your namespace than in other namespaces.  So any accounting information\n  stored in struct user will be unique to your namespace.\n\n  However, throughout the kernel there are checks which\n\n  - simply check for a capability.  Since root in a child namespace\n    has all capabilities, this means that a child namespace is not\n    constrained.\n\n  - simply compare uid1 \u003d\u003d uid2.  Since these are the integer uids,\n    uid 500 in namespace 1 will be said to be equal to uid 500 in\n    namespace 2.\n\n  As a result, the lxc implementation at lxc.sf.net does not use user\n  namespaces.  This is actually helpful because it leaves us free to\n  develop user namespaces in such a way that, for some time, user\n  namespaces may be unuseful.\n\nBugs aside, this patchset is supposed to not at all affect systems which\nare not actively using user namespaces, and only restrict what tasks in\nchild user namespace can do.  They begin to limit privilege to a user\nnamespace, so that root in a container cannot kill or ptrace tasks in the\nparent user namespace, and can only get world access rights to files.\nSince all files currently belong to the initila user namespace, that means\nthat child user namespaces can only get world access rights to *all*\nfiles.  While this temporarily makes user namespaces bad for system\ncontainers, it starts to get useful for some sandboxing.\n\nI\u0027ve run the \u0027runltplite.sh\u0027 with and without this patchset and found no\ndifference.\n\nThis patch:\n\ncopy_process() handles CLONE_NEWUSER before the rest of the namespaces.\nSo in the case of clone(CLONE_NEWUSER|CLONE_NEWUTS) the new uts namespace\nwill have the new user namespace as its owner.  That is what we want,\nsince we want root in that new userns to be able to have privilege over\nit.\n\nChangelog:\n\tFeb 15: don\u0027t set uts_ns-\u003euser_ns if we didn\u0027t create\n\t\ta new uts_ns.\n\tFeb 23: Move extern init_user_ns declaration from\n\t\tinit/version.c to utsname.h.\n\nSigned-off-by: Serge E. Hallyn \u003cserge.hallyn@canonical.com\u003e\nAcked-by: \"Eric W. Biederman\" \u003cebiederm@xmission.com\u003e\nAcked-by: Daniel Lezcano \u003cdaniel.lezcano@free.fr\u003e\nAcked-by: David Howells \u003cdhowells@redhat.com\u003e\nCc: James Morris \u003cjmorris@namei.org\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "69f39974c041b964c4a32bb0dead5942f191dae2",
      "old_mode": 33188,
      "old_path": "include/linux/utsname.h",
      "new_id": "2c3c0f543705164492c171d45d804f6528b74a15",
      "new_mode": 33188,
      "new_path": "include/linux/utsname.h"
    },
    {
      "type": "modify",
      "old_id": "adff586401a50c2e6de2ee145ae6a047fd03c6ba",
      "old_mode": 33188,
      "old_path": "init/version.c",
      "new_id": "86fe0ccb997abdd2e97a920288fd2d3fbfd9736e",
      "new_mode": 33188,
      "new_path": "init/version.c"
    },
    {
      "type": "modify",
      "old_id": "f74e6c00e26d1f50fb1c404b2a6e5505354882bf",
      "old_mode": 33188,
      "old_path": "kernel/nsproxy.c",
      "new_id": "034dc2ed13acbf979fe91ec91adfa816ff571a2d",
      "new_mode": 33188,
      "new_path": "kernel/nsproxy.c"
    },
    {
      "type": "modify",
      "old_id": "5c598ca781df4bf6f907043ed1d43f98b3b7ef58",
      "old_mode": 33188,
      "old_path": "kernel/user.c",
      "new_id": "9e03e9c1df8d47fb7242125a6ac3b848d71ca801",
      "new_mode": 33188,
      "new_path": "kernel/user.c"
    },
    {
      "type": "modify",
      "old_id": "8a82b4b8ea52cb3690e25bf039eaf32ff5c8c079",
      "old_mode": 33188,
      "old_path": "kernel/utsname.c",
      "new_id": "a7b3a8d1ad24cebcd69982aa9d924542d02cb53a",
      "new_mode": 33188,
      "new_path": "kernel/utsname.c"
    }
  ]
}
