)]}'
{
  "log": [
    {
      "commit": "c49c41a4134679cecb77362e7f6b59acb6320aa7",
      "tree": "45e690c036ca5846a48c8be67945d1d841b2d96d",
      "parents": [
        "892d208bcf79e4e1058707786a7b6d486697cd78",
        "f423e5ba76e7e4a6fcb4836b4f072d1fdebba8b5"
      ],
      "author": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Sat Jan 14 18:36:33 2012 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Sat Jan 14 18:36:33 2012 -0800"
      },
      "message": "Merge branch \u0027for-linus\u0027 of git://selinuxproject.org/~jmorris/linux-security\n\n* \u0027for-linus\u0027 of git://selinuxproject.org/~jmorris/linux-security:\n  capabilities: remove __cap_full_set definition\n  security: remove the security_netlink_recv hook as it is equivalent to capable()\n  ptrace: do not audit capability check when outputing /proc/pid/stat\n  capabilities: remove task_ns_* functions\n  capabitlies: ns_capable can use the cap helpers rather than lsm call\n  capabilities: style only - move capable below ns_capable\n  capabilites: introduce new has_ns_capabilities_noaudit\n  capabilities: call has_ns_capability from has_capability\n  capabilities: remove all _real_ interfaces\n  capabilities: introduce security_capable_noaudit\n  capabilities: reverse arguments to security_capable\n  capabilities: remove the task from capable LSM hook entirely\n  selinux: sparse fix: fix several warnings in the security server cod\n  selinux: sparse fix: fix warnings in netlink code\n  selinux: sparse fix: eliminate warnings for selinuxfs\n  selinux: sparse fix: declare selinux_disable() in security.h\n  selinux: sparse fix: move selinux_complete_init\n  selinux: sparse fix: make selinux_secmark_refcount static\n  SELinux: Fix RCU deref check warning in sel_netport_insert()\n\nManually fix up a semantic mis-merge wrt security_netlink_recv():\n\n - the interface was removed in commit fd7784615248 (\"security: remove\n   the security_netlink_recv hook as it is equivalent to capable()\")\n\n - a new user of it appeared in commit a38f7907b926 (\"crypto: Add\n   userspace configuration API\")\n\ncausing no automatic merge conflict, but Eric Paris pointed out the\nissue.\n"
    },
    {
      "commit": "f423e5ba76e7e4a6fcb4836b4f072d1fdebba8b5",
      "tree": "42835a712b10579fbd1b05d5ba7170762f0bec47",
      "parents": [
        "fd778461524849afd035679030ae8e8873c72b81"
      ],
      "author": {
        "name": "Eric Paris",
        "email": "eparis@redhat.com",
        "time": "Tue Jan 03 12:25:16 2012 -0500"
      },
      "committer": {
        "name": "Eric Paris",
        "email": "eparis@redhat.com",
        "time": "Thu Jan 05 18:53:01 2012 -0500"
      },
      "message": "capabilities: remove __cap_full_set definition\n\nIn 5163b583a036b103c3cec7171d6731c125773ed6 I removed __cap_full_set but\nforgot to remove it from a header.  Do that.\n\nReported-by: Kornilios Kourtis \u003ckkourt@cslab.ece.ntua.gr\u003e\nSigned-off-by: Eric Paris \u003ceparis@redhat.com\u003e\n"
    },
    {
      "commit": "f1c84dae0ecc51aa35c81f19a0ebcd6c0921ddcb",
      "tree": "59d729bb7806e42a13f0ec1657c90b717c314002",
      "parents": [
        "d2a7009f0bb03fa22ad08dd25472efa0568126b9"
      ],
      "author": {
        "name": "Eric Paris",
        "email": "eparis@redhat.com",
        "time": "Tue Jan 03 12:25:15 2012 -0500"
      },
      "committer": {
        "name": "Eric Paris",
        "email": "eparis@redhat.com",
        "time": "Thu Jan 05 18:52:59 2012 -0500"
      },
      "message": "capabilities: remove task_ns_* functions\n\ntask_ in the front of a function, in the security subsystem anyway, means\nto me at least, that we are operating with that task as the subject of the\nsecurity decision.  In this case what it means is that we are using current as\nthe subject but we use the task to get the right namespace.  Who in the world\nwould ever realize that\u0027s what task_ns_capability means just by the name?  This\npatch eliminates the task_ns functions entirely and uses the has_ns_capability\nfunction instead.  This means we explicitly open code the ns in question in\nthe caller.  I think it makes the caller a LOT more clear what is going on.\n\nSigned-off-by: Eric Paris \u003ceparis@redhat.com\u003e\nAcked-by: Serge E. Hallyn \u003cserge.hallyn@canonical.com\u003e\n"
    },
    {
      "commit": "7b61d648499e74dbec3d4ce645675e0ae040ae78",
      "tree": "dbf56a4e0cf344d22ac4deb71bb1a83ef02526e5",
      "parents": [
        "25e75703410a84b80623da3653db6b70282e5c6a"
      ],
      "author": {
        "name": "Eric Paris",
        "email": "eparis@redhat.com",
        "time": "Tue Jan 03 12:25:15 2012 -0500"
      },
      "committer": {
        "name": "Eric Paris",
        "email": "eparis@redhat.com",
        "time": "Thu Jan 05 18:52:57 2012 -0500"
      },
      "message": "capabilites: introduce new has_ns_capabilities_noaudit\n\nFor consistency in interfaces, introduce a new interface called\nhas_ns_capabilities_noaudit.  It checks if the given task has the given\ncapability in the given namespace.  Use this new function by\nhas_capabilities_noaudit.\n\nSigned-off-by: Eric Paris \u003ceparis@redhat.com\u003e\nAcked-by: Serge E. Hallyn \u003cserge.hallyn@canonical.com\u003e\n"
    },
    {
      "commit": "6cc7a765c2987f03ba278dac03c7cc759ee198e7",
      "tree": "1afd1f5b4da65279b84aa5b74f9c69e8ad3f3b36",
      "parents": [
        "05bdd2f14351176d368e8ddc67993690a2d1bfb6"
      ],
      "author": {
        "name": "Maciej Żenczykowski",
        "email": "maze@google.com",
        "time": "Thu Oct 20 18:21:36 2011 -0400"
      },
      "committer": {
        "name": "David S. Miller",
        "email": "davem@davemloft.net",
        "time": "Thu Oct 20 18:21:36 2011 -0400"
      },
      "message": "net: allow CAP_NET_RAW to set socket options IP{,V6}_TRANSPARENT\n\nUp till now the IP{,V6}_TRANSPARENT socket options (which actually set\nthe same bit in the socket struct) have required CAP_NET_ADMIN\nprivileges to set or clear the option.\n\n- we make clearing the bit not require any privileges.\n- we allow CAP_NET_ADMIN to set the bit (as before this change)\n- we allow CAP_NET_RAW to set this bit, because raw\n  sockets already pretty much effectively allow you\n  to emulate socket transparency.\n\nSigned-off-by: Maciej Żenczykowski \u003cmaze@google.com\u003e\nSigned-off-by: David S. Miller \u003cdavem@davemloft.net\u003e\n"
    },
    {
      "commit": "434d42cfd05a7cc452457a81d2029540cba12150",
      "tree": "3a6b9b7f9ff2e1b7409dd66c15242b2a75aa4422",
      "parents": [
        "d762f4383100c2a87b1a3f2d678cd3b5425655b4",
        "12a5a2621b1ee14d32beca35304d7c6076a58815"
      ],
      "author": {
        "name": "James Morris",
        "email": "jmorris@namei.org",
        "time": "Tue May 24 22:55:24 2011 +1000"
      },
      "committer": {
        "name": "James Morris",
        "email": "jmorris@namei.org",
        "time": "Tue May 24 22:55:24 2011 +1000"
      },
      "message": "Merge branch \u0027next\u0027 into for-linus\n"
    },
    {
      "commit": "78c4def67e8eebe602655a3dec9aa08f0e2f7c4b",
      "tree": "8c0c756bbff7325f5c2a773f8cc64d8390ebe5b5",
      "parents": [
        "7e6628e4bcb3b3546c625ec63ca724f28ab14f0c",
        "942c3c5c329274fa6de5998cb911cf3d0a42d0b1"
      ],
      "author": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Thu May 19 17:45:08 2011 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Thu May 19 17:45:08 2011 -0700"
      },
      "message": "Merge branch \u0027timers-core-for-linus\u0027 of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip\n\n* \u0027timers-core-for-linus\u0027 of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:\n  hrtimer: Make lookup table const\n  RTC: Disable CONFIG_RTC_CLASS from being built as a module\n  timers: Fix alarmtimer build issues when CONFIG_RTC_CLASS\u003dn\n  timers: Remove delayed irqwork from alarmtimers implementation\n  timers: Improve alarmtimer comments and minor fixes\n  timers: Posix interface for alarm-timers\n  timers: Introduce in-kernel alarm-timer interface\n  timers: Add rb_init_node() to allow for stack allocated rb nodes\n  time: Add timekeeping_inject_sleeptime\n"
    },
    {
      "commit": "12a5a2621b1ee14d32beca35304d7c6076a58815",
      "tree": "213e13f99de690b3c4a510f504393b63ada626bd",
      "parents": [
        "e77dc3460fa59be5759e9327ad882868eee9d61b",
        "61c4f2c81c61f73549928dfd9f3e8f26aa36a8cf"
      ],
      "author": {
        "name": "James Morris",
        "email": "jmorris@namei.org",
        "time": "Thu May 19 18:51:57 2011 +1000"
      },
      "committer": {
        "name": "James Morris",
        "email": "jmorris@namei.org",
        "time": "Thu May 19 18:51:57 2011 +1000"
      },
      "message": "Merge branch \u0027master\u0027 into next\n\nConflicts:\n\tinclude/linux/capability.h\n\nManually resolve merge conflict w/ thanks to Stephen Rothwell.\n\nSigned-off-by: James Morris \u003cjmorris@namei.org\u003e\n"
    },
    {
      "commit": "47a150edc2ae734c0f4bf50aa19499e23b9a46f8",
      "tree": "beeba9befd531285f663559a76f6f0f7378a6c2b",
      "parents": [
        "381e7863d94891035a1a6b7836e9db72f9f1cba1"
      ],
      "author": {
        "name": "Serge E. Hallyn",
        "email": "serge.hallyn@canonical.com",
        "time": "Fri May 13 04:27:54 2011 +0100"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Fri May 13 11:45:33 2011 -0700"
      },
      "message": "Cache user_ns in struct cred\n\nIf !CONFIG_USERNS, have current_user_ns() defined to (\u0026init_user_ns).\n\nGet rid of _current_user_ns.  This requires nsown_capable() to be\ndefined in capability.c rather than as static inline in capability.h,\nso do that.\n\nRequest_key needs init_user_ns defined at current_user_ns if\n!CONFIG_USERNS, so forward-declare that in cred.h if !CONFIG_USERNS\nat current_user_ns() define.\n\nCompile-tested with and without CONFIG_USERNS.\n\nSigned-off-by: Serge E. Hallyn \u003cserge.hallyn@canonical.com\u003e\n[ This makes a huge performance difference for acl_permission_check(),\n  up to 30%.  And that is one of the hottest kernel functions for loads\n  that are pathname-lookup heavy.  ]\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "9a7adcf5c6dea63d2e47e6f6d2f7a6c9f48b9337",
      "tree": "151f7fbb135053945fc6eae99c9175e860ad343c",
      "parents": [
        "ff3ead96d17f47ee70c294a5cc2cce9b61e82f0f"
      ],
      "author": {
        "name": "John Stultz",
        "email": "john.stultz@linaro.org",
        "time": "Tue Jan 11 09:54:33 2011 -0800"
      },
      "committer": {
        "name": "John Stultz",
        "email": "john.stultz@linaro.org",
        "time": "Tue Apr 26 14:01:46 2011 -0700"
      },
      "message": "timers: Posix interface for alarm-timers\n\nThis patch exposes alarm-timers to userland via the posix clock\nand timers interface, using two new clockids: CLOCK_REALTIME_ALARM\nand CLOCK_BOOTTIME_ALARM. Both clockids behave identically to\nCLOCK_REALTIME and CLOCK_BOOTTIME, respectively, but timers\nset against the _ALARM suffixed clockids will wake the system if\nit is suspended.\n\nSome background can be found here:\n\thttps://lwn.net/Articles/429925/\n\nThe concept for Alarm-timers was inspired by the Android Alarm\ndriver (by Arve Hjønnevåg) found in the Android kernel tree.\n\nSee: http://android.git.kernel.org/?p\u003dkernel/common.git;a\u003dblob;f\u003ddrivers/rtc/alarm.c;h\u003d1250edfbdf3302f5e4ea6194847c6ef4bb7beb1c;hb\u003dandroid-2.6.36\n\nWhile the in-kernel interface is pretty similar between\nalarm-timers and Android alarm driver, the user-space interface\nfor the Android alarm driver is via ioctls to a new char device.\nAs mentioned above, I\u0027ve instead chosen to export this functionality\nvia the posix interface, as it seemed a little simpler and avoids\ncreating duplicate interfaces to things like CLOCK_REALTIME and\nCLOCK_MONOTONIC under alternate names (ie:ANDROID_ALARM_RTC and\nANDROID_ALARM_SYSTEMTIME).\n\nThe semantics of the Android alarm driver are different from what\nthis posix interface provides. For instance, threads other then\nthe thread waiting on the Android alarm driver are able to modify\nthe alarm being waited on. Also this interface does not allow\nthe same wakelock semantics that the Android driver provides\n(ie: kernel takes a wakelock on RTC alarm-interupt, and holds it\nthrough process wakeup, and while the process runs, until the\nprocess either closes the char device or calls back in to wait\non a new alarm).\n\nOne potential way to implement similar semantics may be via\nthe timerfd infrastructure, but this needs more research.\n\nThere may also need to be some sort of sysfs system level policy\nhooks that allow alarm timers to be disabled to keep them\nfrom firing at inappropriate times (ie: laptop in a well insulated\nbag, mid-flight).\n\nCC: Arve Hjønnevåg \u003carve@android.com\u003e\nCC: Thomas Gleixner \u003ctglx@linutronix.de\u003e\nCC: Alessandro Zummo \u003ca.zummo@towertech.it\u003e\nAcked-by: Arnd Bergmann \u003carnd@arndb.de\u003e\nSigned-off-by: John Stultz \u003cjohn.stultz@linaro.org\u003e\n"
    },
    {
      "commit": "a3232d2fa2e3cbab3e76d91cdae5890fee8a4034",
      "tree": "de02161b885ceb58b2c807ac6e0a721aabd3470b",
      "parents": [
        "5163b583a036b103c3cec7171d6731c125773ed6"
      ],
      "author": {
        "name": "Eric Paris",
        "email": "eparis@redhat.com",
        "time": "Fri Apr 01 17:08:45 2011 -0400"
      },
      "committer": {
        "name": "James Morris",
        "email": "jmorris@namei.org",
        "time": "Mon Apr 04 10:31:16 2011 +1000"
      },
      "message": "capabilities: delete all CAP_INIT macros\n\nThe CAP_INIT macros of INH, BSET, and EFF made sense at one point in time,\nbut now days they aren\u0027t helping.  Just open code the logic in the\ninit_cred.\n\nSigned-off-by: Eric Paris \u003ceparis@redhat.com\u003e\nAcked-by: David Howells \u003cdhowells@redhat.com\u003e\nSigned-off-by: James Morris \u003cjmorris@namei.org\u003e\n"
    },
    {
      "commit": "5163b583a036b103c3cec7171d6731c125773ed6",
      "tree": "c3ee80267d6d29f4302308414bcf2af41087f575",
      "parents": [
        "ffa8e59df047d57e812a04f7d6baf6a25c652c0c"
      ],
      "author": {
        "name": "Eric Paris",
        "email": "eparis@redhat.com",
        "time": "Fri Apr 01 17:08:39 2011 -0400"
      },
      "committer": {
        "name": "James Morris",
        "email": "jmorris@namei.org",
        "time": "Mon Apr 04 10:31:12 2011 +1000"
      },
      "message": "capabilities: delete unused cap_set_full\n\nunused code.  Clean it up.\n\nSigned-off-by: Eric Paris \u003ceparis@redhat.com\u003e\nAcked-by: David Howells \u003cdhowells@redhat.com\u003e\nAcked-by: Andrew G. Morgan \u003cmorgan@kernel.org\u003e\nSigned-off-by: James Morris \u003cjmorris@namei.org\u003e\n"
    },
    {
      "commit": "ffa8e59df047d57e812a04f7d6baf6a25c652c0c",
      "tree": "099fc879024f151ff5bc400763477f1bb0ffa254",
      "parents": [
        "4bf2ea77dba76a22f49db3c10773896aaeeb8f66"
      ],
      "author": {
        "name": "Eric Paris",
        "email": "eparis@redhat.com",
        "time": "Fri Apr 01 17:08:34 2011 -0400"
      },
      "committer": {
        "name": "James Morris",
        "email": "jmorris@namei.org",
        "time": "Mon Apr 04 10:31:09 2011 +1000"
      },
      "message": "capabilities: do not drop CAP_SETPCAP from the initial task\n\nIn olden\u0027 days of yore CAP_SETPCAP had special meaning for the init task.\nWe actually have code to make sure that CAP_SETPCAP wasn\u0027t in pE of things\nusing the init_cred.  But CAP_SETPCAP isn\u0027t so special any more and we\ndon\u0027t have a reason to special case dropping it for init or kthreads....\n\nSigned-off-by: Eric Paris \u003ceparis@redhat.com\u003e\nAcked-by: Andrew G. Morgan \u003cmorgan@kernel.org\u003e\nSigned-off-by: James Morris \u003cjmorris@namei.org\u003e\n"
    },
    {
      "commit": "3263245de48344ad7bdd0e7256bf1606d2592f88",
      "tree": "a6fa31305f5b6558d882b2dad29ed9a720167ee0",
      "parents": [
        "8409cca7056113bee3236cb6a8e4d8d4d1eef102"
      ],
      "author": {
        "name": "Serge E. Hallyn",
        "email": "serge.hallyn@canonical.com",
        "time": "Wed Mar 23 16:43:21 2011 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Wed Mar 23 19:47:06 2011 -0700"
      },
      "message": "userns: make has_capability* into real functions\n\nSo we can let type safety keep things sane, and as a bonus we can remove\nthe declaration of init_user_ns in capability.h.\n\nSigned-off-by: Serge E. Hallyn \u003cserge.hallyn@canonical.com\u003e\nCc: \"Eric W. Biederman\" \u003cebiederm@xmission.com\u003e\nCc: Daniel Lezcano \u003cdaniel.lezcano@free.fr\u003e\nCc: 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"
    },
    {
      "commit": "8409cca7056113bee3236cb6a8e4d8d4d1eef102",
      "tree": "d9f1ced0d47070fcdf8b399021f33770c150b1ec",
      "parents": [
        "39fd33933b0209e4b6254743f2cede07c5ad4c52"
      ],
      "author": {
        "name": "Serge E. Hallyn",
        "email": "serge@hallyn.com",
        "time": "Wed Mar 23 16:43:20 2011 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Wed Mar 23 19:47:05 2011 -0700"
      },
      "message": "userns: allow ptrace from non-init user namespaces\n\nptrace is allowed to tasks in the same user namespace according to the\nusual rules (i.e.  the same rules as for two tasks in the init user\nnamespace).  ptrace is also allowed to a user namespace to which the\ncurrent task the has CAP_SYS_PTRACE capability.\n\nChangelog:\n\tDec 31: Address feedback by Eric:\n\t\t. Correct ptrace uid check\n\t\t. Rename may_ptrace_ns to ptrace_capable\n\t\t. Also fix the cap_ptrace checks.\n\tJan  1: Use const cred struct\n\tJan 11: use task_ns_capable() in place of ptrace_capable().\n\tFeb 23: same_or_ancestore_user_ns() was not an appropriate\n\t\tcheck to constrain cap_issubset.  Rather, cap_issubset()\n\t\tonly is meaningful when both capsets are in the same\n\t\tuser_ns.\n\nSigned-off-by: Serge E. Hallyn \u003cserge.hallyn@canonical.com\u003e\nCc: \"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"
    },
    {
      "commit": "3486740a4f32a6a466f5ac931654d154790ba648",
      "tree": "ac5d968a66057fa84933b8f89fd3e916270dffed",
      "parents": [
        "59607db367c57f515183cb203642291bb14d9c40"
      ],
      "author": {
        "name": "Serge E. Hallyn",
        "email": "serge@hallyn.com",
        "time": "Wed Mar 23 16:43:17 2011 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Wed Mar 23 19:47:02 2011 -0700"
      },
      "message": "userns: security: make capabilities relative to the user namespace\n\n- Introduce ns_capable to test for a capability in a non-default\n  user namespace.\n- Teach cap_capable to handle capabilities in a non-default\n  user namespace.\n\nThe motivation is to get to the unprivileged creation of new\nnamespaces.  It looks like this gets us 90% of the way there, with\nonly potential uid confusion issues left.\n\nI still need to handle getting all caps after creation but otherwise I\nthink I have a good starter patch that achieves all of your goals.\n\nChangelog:\n\t11/05/2010: [serge] add apparmor\n\t12/14/2010: [serge] fix capabilities to created user namespaces\n\tWithout this, if user serge creates a user_ns, he won\u0027t have\n\tcapabilities to the user_ns he created.  THis is because we\n\twere first checking whether his effective caps had the caps\n\the needed and returning -EPERM if not, and THEN checking whether\n\the was the creator.  Reverse those checks.\n\t12/16/2010: [serge] security_real_capable needs ns argument in !security case\n\t01/11/2011: [serge] add task_ns_capable helper\n\t01/11/2011: [serge] add nsown_capable() helper per Bastian Blank suggestion\n\t02/16/2011: [serge] fix a logic bug: the root user is always creator of\n\t\t    init_user_ns, but should not always have capabilities to\n\t\t    it!  Fix the check in cap_capable().\n\t02/21/2011: Add the required user_ns parameter to security_capable,\n\t\t    fixing a compile failure.\n\t02/23/2011: Convert some macros to functions as per akpm comments.  Some\n\t\t    couldn\u0027t be converted because we can\u0027t easily forward-declare\n\t\t    them (they are inline if !SECURITY, extern if SECURITY).  Add\n\t\t    a current_user_ns function so we can use it in capability.h\n\t\t    without #including cred.h.  Move all forward declarations\n\t\t    together to the top of the #ifdef __KERNEL__ section, and use\n\t\t    kernel-doc format.\n\t02/23/2011: Per dhowells, clean up comment in cap_capable().\n\t02/23/2011: Per akpm, remove unreachable \u0027return -EPERM\u0027 in cap_capable.\n\n(Original written and signed off by Eric;  latest, modified version\nacked by him)\n\n[akpm@linux-foundation.org: fix build]\n[akpm@linux-foundation.org: export current_user_ns() for ecryptfs]\n[serge.hallyn@canonical.com: remove unneeded extra argument in selinux\u0027s task_has_capability]\nSigned-off-by: Eric W. Biederman \u003cebiederm@xmission.com\u003e\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: Serge E. Hallyn \u003cserge.hallyn@canonical.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "ce6ada35bdf710d16582cc4869c26722547e6f11",
      "tree": "c2b5fd46c883f4b7285b191bac55940022662b43",
      "parents": [
        "1d6d75684d869406e5bb2ac5d3ed9454f52d0cab"
      ],
      "author": {
        "name": "Serge E. Hallyn",
        "email": "serge@hallyn.com",
        "time": "Thu Nov 25 17:11:32 2010 +0000"
      },
      "committer": {
        "name": "James Morris",
        "email": "jmorris@namei.org",
        "time": "Mon Nov 29 08:35:12 2010 +1100"
      },
      "message": "security: Define CAP_SYSLOG\n\nPrivileged syslog operations currently require CAP_SYS_ADMIN.  Split\nthis off into a new CAP_SYSLOG privilege which we can sanely take away\nfrom a container through the capability bounding set.\n\nWith this patch, an lxc container can be prevented from messing with\nthe host\u0027s syslog (i.e. dmesg -c).\n\nChangelog: mar 12 2010: add selinux capability2:cap_syslog perm\nChangelog: nov 22 2010:\n\t. port to new kernel\n\t. add a WARN_ONCE if userspace isn\u0027t using CAP_SYSLOG\n\nSigned-off-by: Serge Hallyn \u003cserge.hallyn@ubuntu.com\u003e\nAcked-by: Andrew G. Morgan \u003cmorgan@kernel.org\u003e\nAcked-By: Kees Cook \u003ckees.cook@canonical.com\u003e\nCc: James Morris \u003cjmorris@namei.org\u003e\nCc: Michael Kerrisk \u003cmtk.manpages@gmail.com\u003e\nCc: Stephen Smalley \u003csds@tycho.nsa.gov\u003e\nCc: \"Christopher J. PeBenito\" \u003ccpebenito@tresys.com\u003e\nCc: Eric Paris \u003ceparis@parisplace.org\u003e\nSigned-off-by: James Morris \u003cjmorris@namei.org\u003e\n"
    },
    {
      "commit": "af4f136056c984b0aa67feed7d3170b958370b2f",
      "tree": "30b62cd9174044cbdfdddc1fe5e0f21e7ddde85c",
      "parents": [
        "5ad18a0d59ba9e65b3c8b2b489fd23bc6b3daf94"
      ],
      "author": {
        "name": "Mimi Zohar",
        "email": "zohar@linux.vnet.ibm.com",
        "time": "Thu Jul 01 15:07:43 2010 -0400"
      },
      "committer": {
        "name": "James Morris",
        "email": "jmorris@namei.org",
        "time": "Mon Aug 02 15:34:57 2010 +1000"
      },
      "message": "security: move LSM xattrnames to xattr.h\n\nMake the security extended attributes names global. Updated to move\nthe remaining Smack xattrs.\n\nSigned-off-by: Mimi Zohar \u003czohar@us.ibm.com\u003e\nAcked-by: Serge Hallyn \u003cserue@us.ibm.com\u003e\nSigned-off-by: James Morris \u003cjmorris@namei.org\u003e\n"
    },
    {
      "commit": "b3a222e52e4d4be77cc4520a57af1a4a0d8222d1",
      "tree": "1c3d5df529a404636b996ef39c991c9b8813aa12",
      "parents": [
        "0bce95279909aa4cc401a2e3140b4295ca22e72a"
      ],
      "author": {
        "name": "Serge E. Hallyn",
        "email": "serue@us.ibm.com",
        "time": "Mon Nov 23 16:21:30 2009 -0600"
      },
      "committer": {
        "name": "James Morris",
        "email": "jmorris@namei.org",
        "time": "Tue Nov 24 15:06:47 2009 +1100"
      },
      "message": "remove CONFIG_SECURITY_FILE_CAPABILITIES compile option\n\nAs far as I know, all distros currently ship kernels with default\nCONFIG_SECURITY_FILE_CAPABILITIES\u003dy.  Since having the option on\nleaves a \u0027no_file_caps\u0027 option to boot without file capabilities,\nthe main reason to keep the option is that turning it off saves\nyou (on my s390x partition) 5k.  In particular, vmlinux sizes\ncame to:\n\nwithout patch fscaps\u003dn:\t\t \t53598392\nwithout patch fscaps\u003dy:\t\t \t53603406\nwith this patch applied:\t\t53603342\n\nwith the security-next tree.\n\nAgainst this we must weigh the fact that there is no simple way for\nuserspace to figure out whether file capabilities are supported,\nwhile things like per-process securebits, capability bounding\nsets, and adding bits to pI if CAP_SETPCAP is in pE are not supported\nwith SECURITY_FILE_CAPABILITIES\u003dn, leaving a bit of a problem for\napplications wanting to know whether they can use them and/or why\nsomething failed.\n\nIt also adds another subtly different set of semantics which we must\nmaintain at the risk of severe security regressions.\n\nSo this patch removes the SECURITY_FILE_CAPABILITIES compile\noption.  It drops the kernel size by about 50k over the stock\nSECURITY_FILE_CAPABILITIES\u003dy kernel, by removing the\ncap_limit_ptraced_target() function.\n\nChangelog:\n\tNov 20: remove cap_limit_ptraced_target() as it\u0027s logic\n\t\twas ifndef\u0027ed.\n\nSigned-off-by: Serge E. Hallyn \u003cserue@us.ibm.com\u003e\nAcked-by: Andrew G. Morgan\" \u003cmorgan@kernel.org\u003e\nSigned-off-by: James Morris \u003cjmorris@namei.org\u003e\n"
    },
    {
      "commit": "bcf56442429a15bdd6e1d81a9d4c89f93a44fdf7",
      "tree": "a59f794bfa1e617091b055f33adabe362d043cbc",
      "parents": [
        "ebc79c4f8da0f92efa968e0328f32334a2ce80cf"
      ],
      "author": {
        "name": "GeunSik Lim",
        "email": "leemgs1@gmail.com",
        "time": "Tue Jun 16 10:26:25 2009 +0200"
      },
      "committer": {
        "name": "Jiri Kosina",
        "email": "jkosina@suse.cz",
        "time": "Mon Sep 21 15:14:51 2009 +0200"
      },
      "message": "trivial: change address of the libcap source.\n\nThis is patch to change ftp site of the libcap source.\n\"ftp://linux.kernel.org\" address does not exist.\n\nSigned-off-by: GeunSik Lim \u003cgeunsik.lim@samsung.com\u003e\nSigned-off-by: Jiri Kosina \u003cjkosina@suse.cz\u003e\n"
    },
    {
      "commit": "0ad30b8fd5fe798aae80df6344b415d8309342cc",
      "tree": "a62ffb310ab370df11a8fe2ba2995e952b6522be",
      "parents": [
        "d3ab02a7c51fcbceafe999a515cc8bc4f0d0cfee"
      ],
      "author": {
        "name": "Serge E. Hallyn",
        "email": "serue@us.ibm.com",
        "time": "Mon Apr 13 09:56:14 2009 -0500"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Mon Apr 13 08:32:28 2009 -0700"
      },
      "message": "add some long-missing capabilities to fs_mask\n\nWhen POSIX capabilities were introduced during the 2.1 Linux\ncycle, the fs mask, which represents the capabilities which having\nfsuid\u003d\u003d0 is supposed to grant, did not include CAP_MKNOD and\nCAP_LINUX_IMMUTABLE.  However, before capabilities the privilege\nto call these did in fact depend upon fsuid\u003d\u003d0.\n\nThis patch introduces those capabilities into the fsmask,\nrestoring the old behavior.\n\nSee the thread starting at http://lkml.org/lkml/2009/3/11/157 for\nreference.\n\nNote that if this fix is deemed valid, then earlier kernel versions (2.4\nand 2.2) ought to be fixed too.\n\nChangelog:\n\t[Mar 23] Actually delete old CAP_FS_SET definition...\n\t[Mar 20] Updated against J. Bruce Fields\u0027s patch\n\nReported-by: Igor Zhbanov \u003cizh1979@gmail.com\u003e\nSigned-off-by: Serge E. Hallyn \u003cserue@us.ibm.com\u003e\nCc: stable@kernel.org\nCc: J. Bruce Fields \u003cbfields@citi.umich.edu\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "76a67ec6fb79ff3570dcb5342142c16098299911",
      "tree": "45bfd454d59ce611a103d6b63fff08a5cb5d2194",
      "parents": [
        "84f09f46b4ee9e4e9b6381f8af31817516d2091b"
      ],
      "author": {
        "name": "J. Bruce Fields",
        "email": "bfields@citi.umich.edu",
        "time": "Mon Mar 16 18:34:20 2009 -0400"
      },
      "committer": {
        "name": "J. Bruce Fields",
        "email": "bfields@citi.umich.edu",
        "time": "Tue Mar 17 14:55:55 2009 -0400"
      },
      "message": "nfsd: nfsd should drop CAP_MKNOD for non-root\n\nSince creating a device node is normally an operation requiring special\nprivilege, Igor Zhbanov points out that it is surprising (to say the\nleast) that a client can, for example, create a device node on a\nfilesystem exported with root_squash.\n\nSo, make sure CAP_MKNOD is among the capabilities dropped when an nfsd\nthread handles a request from a non-root user.\n\nReported-by: Igor Zhbanov \u003cizh1979@gmail.com\u003e\nCc: stable@kernel.org\nSigned-off-by: J. Bruce Fields \u003cbfields@citi.umich.edu\u003e\n"
    },
    {
      "commit": "9fa91d99bfdd9582e43b6b9ab97678c51373c4ae",
      "tree": "53466c4815c97c745526eabc479ad463ac129ac5",
      "parents": [
        "4502b80e44f1fc9af33f66053c6c99ae9dba32a6"
      ],
      "author": {
        "name": "Jaswinder Singh Rajput",
        "email": "jaswinderrajput@gmail.com",
        "time": "Fri Jan 30 20:39:30 2009 +0530"
      },
      "committer": {
        "name": "Jaswinder Singh Rajput",
        "email": "jaswinderrajput@gmail.com",
        "time": "Fri Jan 30 23:41:27 2009 +0530"
      },
      "message": "headers_check fix: linux/capability.h\n\nfix the following \u0027make headers_check\u0027 warning:\n\n  usr/include/linux/capability.h:73: extern\u0027s make no sense in userspace\n\nSigned-off-by: Jaswinder Singh Rajput \u003cjaswinderrajput@gmail.com\u003e\n"
    },
    {
      "commit": "3699c53c485bf0168e6500d0ed18bf931584dd7c",
      "tree": "eee63a8ddbdb0665bc6a4a053a2405ca7a5b867f",
      "parents": [
        "29881c4502ba05f46bc12ae8053d4e08d7e2615c"
      ],
      "author": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Tue Jan 06 22:27:01 2009 +0000"
      },
      "committer": {
        "name": "James Morris",
        "email": "jmorris@namei.org",
        "time": "Wed Jan 07 09:38:48 2009 +1100"
      },
      "message": "CRED: Fix regression in cap_capable() as shown up by sys_faccessat() [ver #3]\n\nFix a regression in cap_capable() due to:\n\n\tcommit 3b11a1decef07c19443d24ae926982bc8ec9f4c0\n\tAuthor: David Howells \u003cdhowells@redhat.com\u003e\n\tDate:   Fri Nov 14 10:39:26 2008 +1100\n\n\t    CRED: Differentiate objective and effective subjective credentials on a task\n\nThe problem is that the above patch allows a process to have two sets of\ncredentials, and for the most part uses the subjective credentials when\naccessing current\u0027s creds.\n\nThere is, however, one exception: cap_capable(), and thus capable(), uses the\nreal/objective credentials of the target task, whether or not it is the current\ntask.\n\nOrdinarily this doesn\u0027t matter, since usually the two cred pointers in current\npoint to the same set of creds.  However, sys_faccessat() makes use of this\nfacility to override the credentials of the calling process to make its test,\nwithout affecting the creds as seen from other processes.\n\nOne of the things sys_faccessat() does is to make an adjustment to the\neffective capabilities mask, which cap_capable(), as it stands, then ignores.\n\nThe affected capability check is in generic_permission():\n\n\tif (!(mask \u0026 MAY_EXEC) || execute_ok(inode))\n\t\tif (capable(CAP_DAC_OVERRIDE))\n\t\t\treturn 0;\n\nThis change passes the set of credentials to be tested down into the commoncap\nand SELinux code.  The security functions called by capable() and\nhas_capability() select the appropriate set of credentials from the process\nbeing checked.\n\nThis can be tested by compiling the following program from the XFS testsuite:\n\n/*\n *  t_access_root.c - trivial test program to show permission bug.\n *\n *  Written by Michael Kerrisk - copyright ownership not pursued.\n *  Sourced from: http://linux.derkeiler.com/Mailing-Lists/Kernel/2003-10/6030.html\n */\n#include \u003climits.h\u003e\n#include \u003cunistd.h\u003e\n#include \u003cstdio.h\u003e\n#include \u003cstdlib.h\u003e\n#include \u003cfcntl.h\u003e\n#include \u003csys/stat.h\u003e\n\n#define UID 500\n#define GID 100\n#define PERM 0\n#define TESTPATH \"/tmp/t_access\"\n\nstatic void\nerrExit(char *msg)\n{\n    perror(msg);\n    exit(EXIT_FAILURE);\n} /* errExit */\n\nstatic void\naccessTest(char *file, int mask, char *mstr)\n{\n    printf(\"access(%s, %s) returns %d\\n\", file, mstr, access(file, mask));\n} /* accessTest */\n\nint\nmain(int argc, char *argv[])\n{\n    int fd, perm, uid, gid;\n    char *testpath;\n    char cmd[PATH_MAX + 20];\n\n    testpath \u003d (argc \u003e 1) ? argv[1] : TESTPATH;\n    perm \u003d (argc \u003e 2) ? strtoul(argv[2], NULL, 8) : PERM;\n    uid \u003d (argc \u003e 3) ? atoi(argv[3]) : UID;\n    gid \u003d (argc \u003e 4) ? atoi(argv[4]) : GID;\n\n    unlink(testpath);\n\n    fd \u003d open(testpath, O_RDWR | O_CREAT, 0);\n    if (fd \u003d\u003d -1) errExit(\"open\");\n\n    if (fchown(fd, uid, gid) \u003d\u003d -1) errExit(\"fchown\");\n    if (fchmod(fd, perm) \u003d\u003d -1) errExit(\"fchmod\");\n    close(fd);\n\n    snprintf(cmd, sizeof(cmd), \"ls -l %s\", testpath);\n    system(cmd);\n\n    if (seteuid(uid) \u003d\u003d -1) errExit(\"seteuid\");\n\n    accessTest(testpath, 0, \"0\");\n    accessTest(testpath, R_OK, \"R_OK\");\n    accessTest(testpath, W_OK, \"W_OK\");\n    accessTest(testpath, X_OK, \"X_OK\");\n    accessTest(testpath, R_OK | W_OK, \"R_OK | W_OK\");\n    accessTest(testpath, R_OK | X_OK, \"R_OK | X_OK\");\n    accessTest(testpath, W_OK | X_OK, \"W_OK | X_OK\");\n    accessTest(testpath, R_OK | W_OK | X_OK, \"R_OK | W_OK | X_OK\");\n\n    exit(EXIT_SUCCESS);\n} /* main */\n\nThis can be run against an Ext3 filesystem as well as against an XFS\nfilesystem.  If successful, it will show:\n\n\t[root@andromeda src]# ./t_access_root /tmp/xxx 0 4043 4043\n\t---------- 1 dhowells dhowells 0 2008-12-31 03:00 /tmp/xxx\n\taccess(/tmp/xxx, 0) returns 0\n\taccess(/tmp/xxx, R_OK) returns 0\n\taccess(/tmp/xxx, W_OK) returns 0\n\taccess(/tmp/xxx, X_OK) returns -1\n\taccess(/tmp/xxx, R_OK | W_OK) returns 0\n\taccess(/tmp/xxx, R_OK | X_OK) returns -1\n\taccess(/tmp/xxx, W_OK | X_OK) returns -1\n\taccess(/tmp/xxx, R_OK | W_OK | X_OK) returns -1\n\nIf unsuccessful, it will show:\n\n\t[root@andromeda src]# ./t_access_root /tmp/xxx 0 4043 4043\n\t---------- 1 dhowells dhowells 0 2008-12-31 02:56 /tmp/xxx\n\taccess(/tmp/xxx, 0) returns 0\n\taccess(/tmp/xxx, R_OK) returns -1\n\taccess(/tmp/xxx, W_OK) returns -1\n\taccess(/tmp/xxx, X_OK) returns -1\n\taccess(/tmp/xxx, R_OK | W_OK) returns -1\n\taccess(/tmp/xxx, R_OK | X_OK) returns -1\n\taccess(/tmp/xxx, W_OK | X_OK) returns -1\n\taccess(/tmp/xxx, R_OK | W_OK | X_OK) returns -1\n\nI\u0027ve also tested the fix with the SELinux and syscalls LTP testsuites.\n\nSigned-off-by: David Howells \u003cdhowells@redhat.com\u003e\nTested-by: J. Bruce Fields \u003cbfields@citi.umich.edu\u003e\nAcked-by: Serge Hallyn \u003cserue@us.ibm.com\u003e\nSigned-off-by: James Morris \u003cjmorris@namei.org\u003e\n"
    },
    {
      "commit": "29881c4502ba05f46bc12ae8053d4e08d7e2615c",
      "tree": "536ea4ac63554e836438bd5f370ddecaa343f1f4",
      "parents": [
        "76f7ba35d4b5219fcc4cb072134c020ec77d030d"
      ],
      "author": {
        "name": "James Morris",
        "email": "jmorris@namei.org",
        "time": "Wed Jan 07 09:21:54 2009 +1100"
      },
      "committer": {
        "name": "James Morris",
        "email": "jmorris@namei.org",
        "time": "Wed Jan 07 09:21:54 2009 +1100"
      },
      "message": "Revert \"CRED: Fix regression in cap_capable() as shown up by sys_faccessat() [ver #2]\"\n\nThis reverts commit 14eaddc967b16017d4a1a24d2be6c28ecbe06ed8.\n\nDavid has a better version to come.\n"
    },
    {
      "commit": "14eaddc967b16017d4a1a24d2be6c28ecbe06ed8",
      "tree": "ce10216d592f0fa89ae02c4e4e9e9497010e7714",
      "parents": [
        "5c8c40be4b5a2944483bfc1a45d6c3fa02551af3"
      ],
      "author": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Wed Dec 31 15:15:42 2008 +0000"
      },
      "committer": {
        "name": "James Morris",
        "email": "jmorris@namei.org",
        "time": "Mon Jan 05 11:17:04 2009 +1100"
      },
      "message": "CRED: Fix regression in cap_capable() as shown up by sys_faccessat() [ver #2]\n\nFix a regression in cap_capable() due to:\n\n\tcommit 5ff7711e635b32f0a1e558227d030c7e45b4a465\n\tAuthor: David Howells \u003cdhowells@redhat.com\u003e\n\tDate:   Wed Dec 31 02:52:28 2008 +0000\n\n\t    CRED: Differentiate objective and effective subjective credentials on a task\n\nThe problem is that the above patch allows a process to have two sets of\ncredentials, and for the most part uses the subjective credentials when\naccessing current\u0027s creds.\n\nThere is, however, one exception: cap_capable(), and thus capable(), uses the\nreal/objective credentials of the target task, whether or not it is the current\ntask.\n\nOrdinarily this doesn\u0027t matter, since usually the two cred pointers in current\npoint to the same set of creds.  However, sys_faccessat() makes use of this\nfacility to override the credentials of the calling process to make its test,\nwithout affecting the creds as seen from other processes.\n\nOne of the things sys_faccessat() does is to make an adjustment to the\neffective capabilities mask, which cap_capable(), as it stands, then ignores.\n\nThe affected capability check is in generic_permission():\n\n\tif (!(mask \u0026 MAY_EXEC) || execute_ok(inode))\n\t\tif (capable(CAP_DAC_OVERRIDE))\n\t\t\treturn 0;\n\nThis change splits capable() from has_capability() down into the commoncap and\nSELinux code.  The capable() security op now only deals with the current\nprocess, and uses the current process\u0027s subjective creds.  A new security op -\ntask_capable() - is introduced that can check any task\u0027s objective creds.\n\nstrictly the capable() security op is superfluous with the presence of the\ntask_capable() op, however it should be faster to call the capable() op since\ntwo fewer arguments need be passed down through the various layers.\n\nThis can be tested by compiling the following program from the XFS testsuite:\n\n/*\n *  t_access_root.c - trivial test program to show permission bug.\n *\n *  Written by Michael Kerrisk - copyright ownership not pursued.\n *  Sourced from: http://linux.derkeiler.com/Mailing-Lists/Kernel/2003-10/6030.html\n */\n#include \u003climits.h\u003e\n#include \u003cunistd.h\u003e\n#include \u003cstdio.h\u003e\n#include \u003cstdlib.h\u003e\n#include \u003cfcntl.h\u003e\n#include \u003csys/stat.h\u003e\n\n#define UID 500\n#define GID 100\n#define PERM 0\n#define TESTPATH \"/tmp/t_access\"\n\nstatic void\nerrExit(char *msg)\n{\n    perror(msg);\n    exit(EXIT_FAILURE);\n} /* errExit */\n\nstatic void\naccessTest(char *file, int mask, char *mstr)\n{\n    printf(\"access(%s, %s) returns %d\\n\", file, mstr, access(file, mask));\n} /* accessTest */\n\nint\nmain(int argc, char *argv[])\n{\n    int fd, perm, uid, gid;\n    char *testpath;\n    char cmd[PATH_MAX + 20];\n\n    testpath \u003d (argc \u003e 1) ? argv[1] : TESTPATH;\n    perm \u003d (argc \u003e 2) ? strtoul(argv[2], NULL, 8) : PERM;\n    uid \u003d (argc \u003e 3) ? atoi(argv[3]) : UID;\n    gid \u003d (argc \u003e 4) ? atoi(argv[4]) : GID;\n\n    unlink(testpath);\n\n    fd \u003d open(testpath, O_RDWR | O_CREAT, 0);\n    if (fd \u003d\u003d -1) errExit(\"open\");\n\n    if (fchown(fd, uid, gid) \u003d\u003d -1) errExit(\"fchown\");\n    if (fchmod(fd, perm) \u003d\u003d -1) errExit(\"fchmod\");\n    close(fd);\n\n    snprintf(cmd, sizeof(cmd), \"ls -l %s\", testpath);\n    system(cmd);\n\n    if (seteuid(uid) \u003d\u003d -1) errExit(\"seteuid\");\n\n    accessTest(testpath, 0, \"0\");\n    accessTest(testpath, R_OK, \"R_OK\");\n    accessTest(testpath, W_OK, \"W_OK\");\n    accessTest(testpath, X_OK, \"X_OK\");\n    accessTest(testpath, R_OK | W_OK, \"R_OK | W_OK\");\n    accessTest(testpath, R_OK | X_OK, \"R_OK | X_OK\");\n    accessTest(testpath, W_OK | X_OK, \"W_OK | X_OK\");\n    accessTest(testpath, R_OK | W_OK | X_OK, \"R_OK | W_OK | X_OK\");\n\n    exit(EXIT_SUCCESS);\n} /* main */\n\nThis can be run against an Ext3 filesystem as well as against an XFS\nfilesystem.  If successful, it will show:\n\n\t[root@andromeda src]# ./t_access_root /tmp/xxx 0 4043 4043\n\t---------- 1 dhowells dhowells 0 2008-12-31 03:00 /tmp/xxx\n\taccess(/tmp/xxx, 0) returns 0\n\taccess(/tmp/xxx, R_OK) returns 0\n\taccess(/tmp/xxx, W_OK) returns 0\n\taccess(/tmp/xxx, X_OK) returns -1\n\taccess(/tmp/xxx, R_OK | W_OK) returns 0\n\taccess(/tmp/xxx, R_OK | X_OK) returns -1\n\taccess(/tmp/xxx, W_OK | X_OK) returns -1\n\taccess(/tmp/xxx, R_OK | W_OK | X_OK) returns -1\n\nIf unsuccessful, it will show:\n\n\t[root@andromeda src]# ./t_access_root /tmp/xxx 0 4043 4043\n\t---------- 1 dhowells dhowells 0 2008-12-31 02:56 /tmp/xxx\n\taccess(/tmp/xxx, 0) returns 0\n\taccess(/tmp/xxx, R_OK) returns -1\n\taccess(/tmp/xxx, W_OK) returns -1\n\taccess(/tmp/xxx, X_OK) returns -1\n\taccess(/tmp/xxx, R_OK | W_OK) returns -1\n\taccess(/tmp/xxx, R_OK | X_OK) returns -1\n\taccess(/tmp/xxx, W_OK | X_OK) returns -1\n\taccess(/tmp/xxx, R_OK | W_OK | X_OK) returns -1\n\nI\u0027ve also tested the fix with the SELinux and syscalls LTP testsuites.\n\nSigned-off-by: David Howells \u003cdhowells@redhat.com\u003e\nSigned-off-by: James Morris \u003cjmorris@namei.org\u003e\n"
    },
    {
      "commit": "d84f4f992cbd76e8f39c488cf0c5d123843923b1",
      "tree": "fc4a0349c42995715b93d0f7a3c78e9ea9b3f36e",
      "parents": [
        "745ca2475a6ac596e3d8d37c2759c0fbe2586227"
      ],
      "author": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Fri Nov 14 10:39:23 2008 +1100"
      },
      "committer": {
        "name": "James Morris",
        "email": "jmorris@namei.org",
        "time": "Fri Nov 14 10:39:23 2008 +1100"
      },
      "message": "CRED: Inaugurate COW credentials\n\nInaugurate copy-on-write credentials management.  This uses RCU to manage the\ncredentials pointer in the task_struct with respect to accesses by other tasks.\nA process may only modify its own credentials, and so does not need locking to\naccess or modify its own credentials.\n\nA mutex (cred_replace_mutex) is added to the task_struct to control the effect\nof PTRACE_ATTACHED on credential calculations, particularly with respect to\nexecve().\n\nWith this patch, the contents of an active credentials struct may not be\nchanged directly; rather a new set of credentials must be prepared, modified\nand committed using something like the following sequence of events:\n\n\tstruct cred *new \u003d prepare_creds();\n\tint ret \u003d blah(new);\n\tif (ret \u003c 0) {\n\t\tabort_creds(new);\n\t\treturn ret;\n\t}\n\treturn commit_creds(new);\n\nThere are some exceptions to this rule: the keyrings pointed to by the active\ncredentials may be instantiated - keyrings violate the COW rule as managing\nCOW keyrings is tricky, given that it is possible for a task to directly alter\nthe keys in a keyring in use by another task.\n\nTo help enforce this, various pointers to sets of credentials, such as those in\nthe task_struct, are declared const.  The purpose of this is compile-time\ndiscouragement of altering credentials through those pointers.  Once a set of\ncredentials has been made public through one of these pointers, it may not be\nmodified, except under special circumstances:\n\n  (1) Its reference count may incremented and decremented.\n\n  (2) The keyrings to which it points may be modified, but not replaced.\n\nThe only safe way to modify anything else is to create a replacement and commit\nusing the functions described in Documentation/credentials.txt (which will be\nadded by a later patch).\n\nThis patch and the preceding patches have been tested with the LTP SELinux\ntestsuite.\n\nThis patch makes several logical sets of alteration:\n\n (1) execve().\n\n     This now prepares and commits credentials in various places in the\n     security code rather than altering the current creds directly.\n\n (2) Temporary credential overrides.\n\n     do_coredump() and sys_faccessat() now prepare their own credentials and\n     temporarily override the ones currently on the acting thread, whilst\n     preventing interference from other threads by holding cred_replace_mutex\n     on the thread being dumped.\n\n     This will be replaced in a future patch by something that hands down the\n     credentials directly to the functions being called, rather than altering\n     the task\u0027s objective credentials.\n\n (3) LSM interface.\n\n     A number of functions have been changed, added or removed:\n\n     (*) security_capset_check(), -\u003ecapset_check()\n     (*) security_capset_set(), -\u003ecapset_set()\n\n     \t Removed in favour of security_capset().\n\n     (*) security_capset(), -\u003ecapset()\n\n     \t New.  This is passed a pointer to the new creds, a pointer to the old\n     \t creds and the proposed capability sets.  It should fill in the new\n     \t creds or return an error.  All pointers, barring the pointer to the\n     \t new creds, are now const.\n\n     (*) security_bprm_apply_creds(), -\u003ebprm_apply_creds()\n\n     \t Changed; now returns a value, which will cause the process to be\n     \t killed if it\u0027s an error.\n\n     (*) security_task_alloc(), -\u003etask_alloc_security()\n\n     \t Removed in favour of security_prepare_creds().\n\n     (*) security_cred_free(), -\u003ecred_free()\n\n     \t New.  Free security data attached to cred-\u003esecurity.\n\n     (*) security_prepare_creds(), -\u003ecred_prepare()\n\n     \t New. Duplicate any security data attached to cred-\u003esecurity.\n\n     (*) security_commit_creds(), -\u003ecred_commit()\n\n     \t New. Apply any security effects for the upcoming installation of new\n     \t security by commit_creds().\n\n     (*) security_task_post_setuid(), -\u003etask_post_setuid()\n\n     \t Removed in favour of security_task_fix_setuid().\n\n     (*) security_task_fix_setuid(), -\u003etask_fix_setuid()\n\n     \t Fix up the proposed new credentials for setuid().  This is used by\n     \t cap_set_fix_setuid() to implicitly adjust capabilities in line with\n     \t setuid() changes.  Changes are made to the new credentials, rather\n     \t than the task itself as in security_task_post_setuid().\n\n     (*) security_task_reparent_to_init(), -\u003etask_reparent_to_init()\n\n     \t Removed.  Instead the task being reparented to init is referred\n     \t directly to init\u0027s credentials.\n\n\t NOTE!  This results in the loss of some state: SELinux\u0027s osid no\n\t longer records the sid of the thread that forked it.\n\n     (*) security_key_alloc(), -\u003ekey_alloc()\n     (*) security_key_permission(), -\u003ekey_permission()\n\n     \t Changed.  These now take cred pointers rather than task pointers to\n     \t refer to the security context.\n\n (4) sys_capset().\n\n     This has been simplified and uses less locking.  The LSM functions it\n     calls have been merged.\n\n (5) reparent_to_kthreadd().\n\n     This gives the current thread the same credentials as init by simply using\n     commit_thread() to point that way.\n\n (6) __sigqueue_alloc() and switch_uid()\n\n     __sigqueue_alloc() can\u0027t stop the target task from changing its creds\n     beneath it, so this function gets a reference to the currently applicable\n     user_struct which it then passes into the sigqueue struct it returns if\n     successful.\n\n     switch_uid() is now called from commit_creds(), and possibly should be\n     folded into that.  commit_creds() should take care of protecting\n     __sigqueue_alloc().\n\n (7) [sg]et[ug]id() and co and [sg]et_current_groups.\n\n     The set functions now all use prepare_creds(), commit_creds() and\n     abort_creds() to build and check a new set of credentials before applying\n     it.\n\n     security_task_set[ug]id() is called inside the prepared section.  This\n     guarantees that nothing else will affect the creds until we\u0027ve finished.\n\n     The calling of set_dumpable() has been moved into commit_creds().\n\n     Much of the functionality of set_user() has been moved into\n     commit_creds().\n\n     The get functions all simply access the data directly.\n\n (8) security_task_prctl() and cap_task_prctl().\n\n     security_task_prctl() has been modified to return -ENOSYS if it doesn\u0027t\n     want to handle a function, or otherwise return the return value directly\n     rather than through an argument.\n\n     Additionally, cap_task_prctl() now prepares a new set of credentials, even\n     if it doesn\u0027t end up using it.\n\n (9) Keyrings.\n\n     A number of changes have been made to the keyrings code:\n\n     (a) switch_uid_keyring(), copy_keys(), exit_keys() and suid_keys() have\n     \t all been dropped and built in to the credentials functions directly.\n     \t They may want separating out again later.\n\n     (b) key_alloc() and search_process_keyrings() now take a cred pointer\n     \t rather than a task pointer to specify the security context.\n\n     (c) copy_creds() gives a new thread within the same thread group a new\n     \t thread keyring if its parent had one, otherwise it discards the thread\n     \t keyring.\n\n     (d) The authorisation key now points directly to the credentials to extend\n     \t the search into rather pointing to the task that carries them.\n\n     (e) Installing thread, process or session keyrings causes a new set of\n     \t credentials to be created, even though it\u0027s not strictly necessary for\n     \t process or session keyrings (they\u0027re shared).\n\n(10) Usermode helper.\n\n     The usermode helper code now carries a cred struct pointer in its\n     subprocess_info struct instead of a new session keyring pointer.  This set\n     of credentials is derived from init_cred and installed on the new process\n     after it has been cloned.\n\n     call_usermodehelper_setup() allocates the new credentials and\n     call_usermodehelper_freeinfo() discards them if they haven\u0027t been used.  A\n     special cred function (prepare_usermodeinfo_creds()) is provided\n     specifically for call_usermodehelper_setup() to call.\n\n     call_usermodehelper_setkeys() adjusts the credentials to sport the\n     supplied keyring as the new session keyring.\n\n(11) SELinux.\n\n     SELinux has a number of changes, in addition to those to support the LSM\n     interface changes mentioned above:\n\n     (a) selinux_setprocattr() no longer does its check for whether the\n     \t current ptracer can access processes with the new SID inside the lock\n     \t that covers getting the ptracer\u0027s SID.  Whilst this lock ensures that\n     \t the check is done with the ptracer pinned, the result is only valid\n     \t until the lock is released, so there\u0027s no point doing it inside the\n     \t lock.\n\n(12) is_single_threaded().\n\n     This function has been extracted from selinux_setprocattr() and put into\n     a file of its own in the lib/ directory as join_session_keyring() now\n     wants to use it too.\n\n     The code in SELinux just checked to see whether a task shared mm_structs\n     with other tasks (CLONE_VM), but that isn\u0027t good enough.  We really want\n     to know if they\u0027re part of the same thread group (CLONE_THREAD).\n\n(13) nfsd.\n\n     The NFS server daemon now has to use the COW credentials to set the\n     credentials it is going to use.  It really needs to pass the credentials\n     down to the functions it calls, but it can\u0027t do that until other patches\n     in this series have been applied.\n\nSigned-off-by: David Howells \u003cdhowells@redhat.com\u003e\nAcked-by: James Morris \u003cjmorris@namei.org\u003e\nSigned-off-by: James Morris \u003cjmorris@namei.org\u003e\n"
    },
    {
      "commit": "92a77aac9812d5397abbe6f1920e085e50838635",
      "tree": "dc0af93722974faa8b234d00e8216e2eaf2f79c0",
      "parents": [
        "066746796bd2f0a1ba210c0dded3b6ee4032692a"
      ],
      "author": {
        "name": "James Morris",
        "email": "jmorris@namei.org",
        "time": "Wed Nov 12 21:20:00 2008 +1100"
      },
      "committer": {
        "name": "James Morris",
        "email": "jmorris@namei.org",
        "time": "Wed Nov 12 21:20:00 2008 +1100"
      },
      "message": "security: remove broken and useless declarations\n\nRemove broken declarations for security_capable* functions,\nwhich were not needed anyway.\n\nSigned-off-by: James Morris \u003cjmorris@namei.org\u003e\n"
    },
    {
      "commit": "06112163f5fd9e491a7f810443d81efa9d88e247",
      "tree": "48039f7488abbec36c0982a57405b57d47311dd6",
      "parents": [
        "637d32dc720897616e8a1a4f9e9609e29d431800"
      ],
      "author": {
        "name": "Eric Paris",
        "email": "eparis@redhat.com",
        "time": "Tue Nov 11 22:02:50 2008 +1100"
      },
      "committer": {
        "name": "James Morris",
        "email": "jmorris@namei.org",
        "time": "Tue Nov 11 22:02:50 2008 +1100"
      },
      "message": "Add a new capable interface that will be used by systems that use audit to\nmake an A or B type decision instead of a security decision.  Currently\nthis is the case at least for filesystems when deciding if a process can use\nthe reserved \u0027root\u0027 blocks and for the case of things like the oom\nalgorithm determining if processes are root processes and should be less\nlikely to be killed.  These types of security system requests should not be\naudited or logged since they are not really security decisions.  It would be\npossible to solve this problem like the vm_enough_memory security check did\nby creating a new LSM interface and moving all of the policy into that\ninterface but proves the needlessly bloat the LSM and provide complex\nindirection.\n\nThis merely allows those decisions to be made where they belong and to not\nflood logs or printk with denials for thing that are not security decisions.\n\nSigned-off-by: Eric Paris \u003ceparis@redhat.com\u003e\nAcked-by:  Stephen Smalley \u003csds@tycho.nsa.gov\u003e\nSigned-off-by: James Morris \u003cjmorris@namei.org\u003e\n"
    },
    {
      "commit": "851f7ff56d9c21272f289dd85fb3f1b6cf7a6e10",
      "tree": "42c72104230d93bf785a4cdda1e1ea5895339db0",
      "parents": [
        "c0b004413a46a0a5744e6d2b85220fe9d2c33d48"
      ],
      "author": {
        "name": "Eric Paris",
        "email": "eparis@redhat.com",
        "time": "Tue Nov 11 21:48:14 2008 +1100"
      },
      "committer": {
        "name": "James Morris",
        "email": "jmorris@namei.org",
        "time": "Tue Nov 11 21:48:14 2008 +1100"
      },
      "message": "This patch will print cap_permitted and cap_inheritable data in the PATH\nrecords of any file that has file capabilities set.  Files which do not\nhave fcaps set will not have different PATH records.\n\nAn example audit record if you run:\nsetcap \"cap_net_admin+pie\" /bin/bash\n/bin/bash\n\ntype\u003dSYSCALL msg\u003daudit(1225741937.363:230): arch\u003dc000003e syscall\u003d59 success\u003dyes exit\u003d0 a0\u003d2119230 a1\u003d210da30 a2\u003d20ee290 a3\u003d8 items\u003d2 ppid\u003d2149 pid\u003d2923 auid\u003d0 uid\u003d0 gid\u003d0 euid\u003d0 suid\u003d0 fsuid\u003d0 egid\u003d0 sgid\u003d0 fsgid\u003d0 tty\u003dpts0 ses\u003d3 comm\u003d\"ping\" exe\u003d\"/bin/ping\" subj\u003dunconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key\u003d(null)\ntype\u003dEXECVE msg\u003daudit(1225741937.363:230): argc\u003d2 a0\u003d\"ping\" a1\u003d\"www.google.com\"\ntype\u003dCWD msg\u003daudit(1225741937.363:230):  cwd\u003d\"/root\"\ntype\u003dPATH msg\u003daudit(1225741937.363:230): item\u003d0 name\u003d\"/bin/ping\" inode\u003d49256 dev\u003dfd:00 mode\u003d0104755 ouid\u003d0 ogid\u003d0 rdev\u003d00:00 obj\u003dsystem_u:object_r:ping_exec_t:s0 cap_fp\u003d0000000000002000 cap_fi\u003d0000000000002000 cap_fe\u003d1 cap_fver\u003d2\ntype\u003dPATH msg\u003daudit(1225741937.363:230): item\u003d1 name\u003d(null) inode\u003d507915 dev\u003dfd:00 mode\u003d0100755 ouid\u003d0 ogid\u003d0 rdev\u003d00:00 obj\u003dsystem_u:object_r:ld_so_t:s0\n\nSigned-off-by: Eric Paris \u003ceparis@redhat.com\u003e\nAcked-by: Serge Hallyn \u003cserue@us.ibm.com\u003e\nSigned-off-by: James Morris \u003cjmorris@namei.org\u003e\n"
    },
    {
      "commit": "c0b004413a46a0a5744e6d2b85220fe9d2c33d48",
      "tree": "f66ee9e4cf14ce961e42a9dd356927478bab4574",
      "parents": [
        "9d36be76c55ad2c2bb29683b752b0d9ad2e4eeef"
      ],
      "author": {
        "name": "Eric Paris",
        "email": "eparis@redhat.com",
        "time": "Tue Nov 11 21:48:10 2008 +1100"
      },
      "committer": {
        "name": "James Morris",
        "email": "jmorris@namei.org",
        "time": "Tue Nov 11 21:48:10 2008 +1100"
      },
      "message": "This patch add a generic cpu endian caps structure and externally available\nfunctions which retrieve fcaps information from disk.  This information is\nnecessary so fcaps information can be collected and recorded by the audit\nsystem.\n\nSigned-off-by: Eric Paris \u003ceparis@redhat.com\u003e\nAcked-by: Serge Hallyn \u003cserue@us.ibm.com\u003e\nSigned-off-by: James Morris \u003cjmorris@namei.org\u003e\n"
    },
    {
      "commit": "9d36be76c55ad2c2bb29683b752b0d9ad2e4eeef",
      "tree": "dc193d694a65dc64740928858432af7bb623d010",
      "parents": [
        "39c9aede2b4a252bd296c0a86be832c3d3d0a273"
      ],
      "author": {
        "name": "Eric Paris",
        "email": "eparis@redhat.com",
        "time": "Tue Nov 11 21:48:07 2008 +1100"
      },
      "committer": {
        "name": "James Morris",
        "email": "jmorris@namei.org",
        "time": "Tue Nov 11 21:48:07 2008 +1100"
      },
      "message": "Document the order of arguments for cap_issubset.  It\u0027s not instantly clear\nwhich order the argument should be in.  So give an example.\n\nSigned-off-by: Eric Paris \u003ceparis@redhat.com\u003e\nAcked-by: Serge Hallyn \u003cserue@us.ibm.com\u003e\nSigned-off-by: James Morris \u003cjmorris@namei.org\u003e\n"
    },
    {
      "commit": "1f29fae29709b4668979e244c09b2fa78ff1ad59",
      "tree": "d50129066cd1f131551eb364d04542dfcf923050",
      "parents": [
        "e21e696edb498c7f7eed42ba3096f6bbe13927b6"
      ],
      "author": {
        "name": "Serge E. Hallyn",
        "email": "serue@us.ibm.com",
        "time": "Wed Nov 05 16:08:52 2008 -0600"
      },
      "committer": {
        "name": "James Morris",
        "email": "jmorris@namei.org",
        "time": "Thu Nov 06 07:14:51 2008 +0800"
      },
      "message": "file capabilities: add no_file_caps switch (v4)\n\nAdd a no_file_caps boot option when file capabilities are\ncompiled into the kernel (CONFIG_SECURITY_FILE_CAPABILITIES\u003dy).\n\nThis allows distributions to ship a kernel with file capabilities\ncompiled in, without forcing users to use (and understand and\ntrust) them.\n\nWhen no_file_caps is specified at boot, then when a process executes\na file, any file capabilities stored with that file will not be\nused in the calculation of the process\u0027 new capability sets.\n\nThis means that booting with the no_file_caps boot option will\nnot be the same as booting a kernel with file capabilities\ncompiled out - in particular a task with  CAP_SETPCAP will not\nhave any chance of passing capabilities to another task (which\nisn\u0027t \"really\" possible anyway, and which may soon by killed\naltogether by David Howells in any case), and it will instead\nbe able to put new capabilities in its pI.  However since fI\nwill always be empty and pI is masked with fI, it gains the\ntask nothing.\n\nWe also support the extra prctl options, setting securebits and\ndropping capabilities from the per-process bounding set.\n\nThe other remaining difference is that killpriv, task_setscheduler,\nsetioprio, and setnice will continue to be hooked.  That will\nbe noticable in the case where a root task changed its uid\nwhile keeping some caps, and another task owned by the new uid\ntries to change settings for the more privileged task.\n\nChangelog:\n\tNov 05 2008: (v4) trivial port on top of always-start-\\\n\t\twith-clear-caps patch\n\tSep 23 2008: nixed file_caps_enabled when file caps are\n\t\tnot compiled in as it isn\u0027t used.\n\t\tDocument no_file_caps in kernel-parameters.txt.\n\nSigned-off-by: Serge Hallyn \u003cserue@us.ibm.com\u003e\nAcked-by: Andrew G. Morgan \u003cmorgan@kernel.org\u003e\nSigned-off-by: James Morris \u003cjmorris@namei.org\u003e\n"
    },
    {
      "commit": "5cd9c58fbe9ec92b45b27e131719af4f2bd9eb40",
      "tree": "8573db001b4dc3c2ad97102dda42b841c40b5f6c",
      "parents": [
        "8d0968abd03ec6b407df117adc773562386702fa"
      ],
      "author": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Thu Aug 14 11:37:28 2008 +0100"
      },
      "committer": {
        "name": "James Morris",
        "email": "jmorris@namei.org",
        "time": "Thu Aug 14 22:59:43 2008 +1000"
      },
      "message": "security: Fix setting of PF_SUPERPRIV by __capable()\n\nFix the setting of PF_SUPERPRIV by __capable() as it could corrupt the flags\nthe target process if that is not the current process and it is trying to\nchange its own flags in a different way at the same time.\n\n__capable() is using neither atomic ops nor locking to protect t-\u003eflags.  This\npatch removes __capable() and introduces has_capability() that doesn\u0027t set\nPF_SUPERPRIV on the process being queried.\n\nThis patch further splits security_ptrace() in two:\n\n (1) security_ptrace_may_access().  This passes judgement on whether one\n     process may access another only (PTRACE_MODE_ATTACH for ptrace() and\n     PTRACE_MODE_READ for /proc), and takes a pointer to the child process.\n     current is the parent.\n\n (2) security_ptrace_traceme().  This passes judgement on PTRACE_TRACEME only,\n     and takes only a pointer to the parent process.  current is the child.\n\n     In Smack and commoncap, this uses has_capability() to determine whether\n     the parent will be permitted to use PTRACE_ATTACH if normal checks fail.\n     This does not set PF_SUPERPRIV.\n\nTwo of the instances of __capable() actually only act on current, and so have\nbeen changed to calls to capable().\n\nOf the places that were using __capable():\n\n (1) The OOM killer calls __capable() thrice when weighing the killability of a\n     process.  All of these now use has_capability().\n\n (2) cap_ptrace() and smack_ptrace() were using __capable() to check to see\n     whether the parent was allowed to trace any process.  As mentioned above,\n     these have been split.  For PTRACE_ATTACH and /proc, capable() is now\n     used, and for PTRACE_TRACEME, has_capability() is used.\n\n (3) cap_safe_nice() only ever saw current, so now uses capable().\n\n (4) smack_setprocattr() rejected accesses to tasks other than current just\n     after calling __capable(), so the order of these two tests have been\n     switched and capable() is used instead.\n\n (5) In smack_file_send_sigiotask(), we need to allow privileged processes to\n     receive SIGIO on files they\u0027re manipulating.\n\n (6) In smack_task_wait(), we let a process wait for a privileged process,\n     whether or not the process doing the waiting is privileged.\n\nI\u0027ve tested this with the LTP SELinux and syscalls testscripts.\n\nSigned-off-by: David Howells \u003cdhowells@redhat.com\u003e\nAcked-by: Serge Hallyn \u003cserue@us.ibm.com\u003e\nAcked-by: Casey Schaufler \u003ccasey@schaufler-ca.com\u003e\nAcked-by: Andrew G. Morgan \u003cmorgan@kernel.org\u003e\nAcked-by: Al Viro \u003cviro@zeniv.linux.org.uk\u003e\nSigned-off-by: James Morris \u003cjmorris@namei.org\u003e\n"
    },
    {
      "commit": "086f7316f0d400806d76323beefae996bb3849b1",
      "tree": "679405a89b7f8c7a75d3896e43c837b5a5115d7b",
      "parents": [
        "abbaeff38c00cb7f6817ec1cef406b27081ebedd"
      ],
      "author": {
        "name": "Andrew G. Morgan",
        "email": "morgan@kernel.org",
        "time": "Fri Jul 04 09:59:58 2008 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Fri Jul 04 10:40:08 2008 -0700"
      },
      "message": "security: filesystem capabilities: fix fragile setuid fixup code\n\nThis commit includes a bugfix for the fragile setuid fixup code in the\ncase that filesystem capabilities are supported (in access()).  The effect\nof this fix is gated on filesystem capability support because changing\nsecurebits is only supported when filesystem capabilities support is\nconfigured.)\n\n[akpm@linux-foundation.org: coding-style fixes]\nSigned-off-by: Andrew G. Morgan \u003cmorgan@kernel.org\u003e\nAcked-by: Serge Hallyn \u003cserue@us.ibm.com\u003e\nAcked-by: David Howells \u003cdhowells@redhat.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "ca05a99a54db1db5bca72eccb5866d2a86f8517f",
      "tree": "b39fba6604da4b4f77103d2769bb783118b9b508",
      "parents": [
        "cc94bc37d5e02aaf8a6409a28e3c62bbd479b9a8"
      ],
      "author": {
        "name": "Andrew G. Morgan",
        "email": "morgan@kernel.org",
        "time": "Tue May 27 22:05:17 2008 -0700"
      },
      "committer": {
        "name": "Chris Wright",
        "email": "chrisw@sous-sol.org",
        "time": "Sat May 31 16:36:16 2008 -0700"
      },
      "message": "capabilities: remain source compatible with 32-bit raw legacy capability support.\n\nSource code out there hard-codes a notion of what the\n_LINUX_CAPABILITY_VERSION #define means in terms of the semantics of the\nraw capability system calls capget() and capset().  Its unfortunate, but\ntrue.\n\nSince the confusing header file has been in a released kernel, there is\nsoftware that is erroneously using 64-bit capabilities with the semantics\nof 32-bit compatibilities.  These recently compiled programs may suffer\ncorruption of their memory when sys_getcap() overwrites more memory than\nthey are coded to expect, and the raising of added capabilities when using\nsys_capset().\n\nAs such, this patch does a number of things to clean up the situation\nfor all. It\n\n  1. forces the _LINUX_CAPABILITY_VERSION define to always retain its\n     legacy value.\n\n  2. adopts a new #define strategy for the kernel\u0027s internal\n     implementation of the preferred magic.\n\n  3. deprecates v2 capability magic in favor of a new (v3) magic\n     number. The functionality of v3 is entirely equivalent to v2,\n     the only difference being that the v2 magic causes the kernel\n     to log a \"deprecated\" warning so the admin can find applications\n     that may be using v2 inappropriately.\n\n[User space code continues to be encouraged to use the libcap API which\nprotects the application from details like this.  libcap-2.10 is the first\nto support v3 capabilities.]\n\nFixes issue reported in https://bugzilla.redhat.com/show_bug.cgi?id\u003d447518.\nThanks to Bojan Smojver for the report.\n\n[akpm@linux-foundation.org: s/depreciate/deprecate/g]\n[akpm@linux-foundation.org: be robust about put_user size]\n[akpm@linux-foundation.org: coding-style fixes]\nSigned-off-by: Andrew G. Morgan \u003cmorgan@kernel.org\u003e\nCc: Serge E. Hallyn \u003cserue@us.ibm.com\u003e\nCc: Bojan Smojver \u003cbojan@rexursive.com\u003e\nCc: stable@kernel.org\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Chris Wright \u003cchrisw@sous-sol.org\u003e\n"
    },
    {
      "commit": "25f2ea9fc8c7ec34d351cef7dade2e8046e49ed1",
      "tree": "d261d4fb8bb751ddf23e64b09d960b1a2ad77116",
      "parents": [
        "7bf570dc8dcf76df2a9f583bef2da96d4289ed0d"
      ],
      "author": {
        "name": "David Howells",
        "email": "dhowells@redhat.com",
        "time": "Tue Apr 29 20:54:28 2008 +0100"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Tue Apr 29 13:22:56 2008 -0700"
      },
      "message": "Security: Typecast CAP_*_SET macros\n\nCast the CAP_*_SET macros to be of kernel_cap_t type to avoid compiler\nwarnings.\n\nSigned-off-by: David Howells \u003cdhowells@redhat.com\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "3898b1b4ebff8dcfbcf1807e0661585e06c9a91c",
      "tree": "69a338864dfe654f68064a599c5d0da460df34ac",
      "parents": [
        "4016a1390d07f15b267eecb20e76a48fd5c524ef"
      ],
      "author": {
        "name": "Andrew G. Morgan",
        "email": "morgan@kernel.org",
        "time": "Mon Apr 28 02:13:40 2008 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Mon Apr 28 08:58:26 2008 -0700"
      },
      "message": "capabilities: implement per-process securebits\n\nFilesystem capability support makes it possible to do away with (set)uid-0\nbased privilege and use capabilities instead.  That is, with filesystem\nsupport for capabilities but without this present patch, it is (conceptually)\npossible to manage a system with capabilities alone and never need to obtain\nprivilege via (set)uid-0.\n\nOf course, conceptually isn\u0027t quite the same as currently possible since few\nuser applications, certainly not enough to run a viable system, are currently\nprepared to leverage capabilities to exercise privilege.  Further, many\napplications exist that may never get upgraded in this way, and the kernel\nwill continue to want to support their setuid-0 base privilege needs.\n\nWhere pure-capability applications evolve and replace setuid-0 binaries, it is\ndesirable that there be a mechanisms by which they can contain their\nprivilege.  In addition to leveraging the per-process bounding and inheritable\nsets, this should include suppressing the privilege of the uid-0 superuser\nfrom the process\u0027 tree of children.\n\nThe feature added by this patch can be leveraged to suppress the privilege\nassociated with (set)uid-0.  This suppression requires CAP_SETPCAP to\ninitiate, and only immediately affects the \u0027current\u0027 process (it is inherited\nthrough fork()/exec()).  This reimplementation differs significantly from the\nhistorical support for securebits which was system-wide, unwieldy and which\nhas ultimately withered to a dead relic in the source of the modern kernel.\n\nWith this patch applied a process, that is capable(CAP_SETPCAP), can now drop\nall legacy privilege (through uid\u003d0) for itself and all subsequently\nfork()\u0027d/exec()\u0027d children with:\n\n  prctl(PR_SET_SECUREBITS, 0x2f);\n\nThis patch represents a no-op unless CONFIG_SECURITY_FILE_CAPABILITIES is\nenabled at configure time.\n\n[akpm@linux-foundation.org: fix uninitialised var warning]\n[serue@us.ibm.com: capabilities: use cap_task_prctl when !CONFIG_SECURITY]\nSigned-off-by: Andrew G. Morgan \u003cmorgan@kernel.org\u003e\nAcked-by: Serge Hallyn \u003cserue@us.ibm.com\u003e\nReviewed-by: James Morris \u003cjmorris@namei.org\u003e\nCc: Stephen Smalley \u003csds@tycho.nsa.gov\u003e\nCc: Paul Moore \u003cpaul.moore@hp.com\u003e\nSigned-off-by: Serge E. Hallyn \u003cserue@us.ibm.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "e114e473771c848c3cfec05f0123e70f1cdbdc99",
      "tree": "933b840f3ccac6860da56291c742094f9b5a20cb",
      "parents": [
        "eda61d32e8ad1d9102872f9a0abf3344bf9c5e67"
      ],
      "author": {
        "name": "Casey Schaufler",
        "email": "casey@schaufler-ca.com",
        "time": "Mon Feb 04 22:29:50 2008 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Tue Feb 05 09:44:20 2008 -0800"
      },
      "message": "Smack: Simplified Mandatory Access Control Kernel\n\nSmack is the Simplified Mandatory Access Control Kernel.\n\nSmack implements mandatory access control (MAC) using labels\nattached to tasks and data containers, including files, SVIPC,\nand other tasks. Smack is a kernel based scheme that requires\nan absolute minimum of application support and a very small\namount of configuration data.\n\nSmack uses extended attributes and\nprovides a set of general mount options, borrowing technics used\nelsewhere. Smack uses netlabel for CIPSO labeling. Smack provides\na pseudo-filesystem smackfs that is used for manipulation of\nsystem Smack attributes.\n\nThe patch, patches for ls and sshd, a README, a startup script,\nand x86 binaries for ls and sshd are also available on\n\n    http://www.schaufler-ca.com\n\nDevelopment has been done using Fedora Core 7 in a virtual machine\nenvironment and on an old Sony laptop.\n\nSmack provides mandatory access controls based on the label attached\nto a task and the label attached to the object it is attempting to\naccess. Smack labels are deliberately short (1-23 characters) text\nstrings. Single character labels using special characters are reserved\nfor system use. The only operation applied to Smack labels is equality\ncomparison. No wildcards or expressions, regular or otherwise, are\nused. Smack labels are composed of printable characters and may not\ninclude \"/\".\n\nA file always gets the Smack label of the task that created it.\n\nSmack defines and uses these labels:\n\n    \"*\" - pronounced \"star\"\n    \"_\" - pronounced \"floor\"\n    \"^\" - pronounced \"hat\"\n    \"?\" - pronounced \"huh\"\n\nThe access rules enforced by Smack are, in order:\n\n1. Any access requested by a task labeled \"*\" is denied.\n2. A read or execute access requested by a task labeled \"^\"\n   is permitted.\n3. A read or execute access requested on an object labeled \"_\"\n   is permitted.\n4. Any access requested on an object labeled \"*\" is permitted.\n5. Any access requested by a task on an object with the same\n   label is permitted.\n6. Any access requested that is explicitly defined in the loaded\n   rule set is permitted.\n7. Any other access is denied.\n\nRules may be explicitly defined by writing subject,object,access\ntriples to /smack/load.\n\nSmack rule sets can be easily defined that describe Bell\u0026LaPadula\nsensitivity, Biba integrity, and a variety of interesting\nconfigurations. Smack rule sets can be modified on the fly to\naccommodate changes in the operating environment or even the time\nof day.\n\nSome practical use cases:\n\nHierarchical levels. The less common of the two usual uses\nfor MLS systems is to define hierarchical levels, often\nunclassified, confidential, secret, and so on. To set up smack\nto support this, these rules could be defined:\n\n   C        Unclass rx\n   S        C       rx\n   S        Unclass rx\n   TS       S       rx\n   TS       C       rx\n   TS       Unclass rx\n\nA TS process can read S, C, and Unclass data, but cannot write it.\nAn S process can read C and Unclass. Note that specifying that\nTS can read S and S can read C does not imply TS can read C, it\nhas to be explicitly stated.\n\nNon-hierarchical categories. This is the more common of the\nusual uses for an MLS system. Since the default rule is that a\nsubject cannot access an object with a different label no\naccess rules are required to implement compartmentalization.\n\nA case that the Bell \u0026 LaPadula policy does not allow is demonstrated\nwith this Smack access rule:\n\nA case that Bell\u0026LaPadula does not allow that Smack does:\n\n    ESPN    ABC   r\n    ABC     ESPN  r\n\nOn my portable video device I have two applications, one that\nshows ABC programming and the other ESPN programming. ESPN wants\nto show me sport stories that show up as news, and ABC will\nonly provide minimal information about a sports story if ESPN\nis covering it. Each side can look at the other\u0027s info, neither\ncan change the other. Neither can see what FOX is up to, which\nis just as well all things considered.\n\nAnother case that I especially like:\n\n    SatData Guard   w\n    Guard   Publish w\n\nA program running with the Guard label opens a UDP socket and\naccepts messages sent by a program running with a SatData label.\nThe Guard program inspects the message to ensure it is wholesome\nand if it is sends it to a program running with the Publish label.\nThis program then puts the information passed in an appropriate\nplace. Note that the Guard program cannot write to a Publish\nfile system object because file system semanitic require read as\nwell as write.\n\nThe four cases (categories, levels, mutual read, guardbox) here\nare all quite real, and problems I\u0027ve been asked to solve over\nthe years. The first two are easy to do with traditonal MLS systems\nwhile the last two you can\u0027t without invoking privilege, at least\nfor a while.\n\nSigned-off-by: Casey Schaufler \u003ccasey@schaufler-ca.com\u003e\nCc: Joshua Brindle \u003cmethod@manicmethod.com\u003e\nCc: Paul Moore \u003cpaul.moore@hp.com\u003e\nCc: Stephen Smalley \u003csds@tycho.nsa.gov\u003e\nCc: Chris Wright \u003cchrisw@sous-sol.org\u003e\nCc: James Morris \u003cjmorris@namei.org\u003e\nCc: \"Ahmed S. Darwish\" \u003cdarwish.07@gmail.com\u003e\nCc: Andrew G. Morgan \u003cmorgan@kernel.org\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "3b7391de67da515c91f48aa371de77cb6cc5c07e",
      "tree": "22b9f5d9d1c36b374eb5765219aca3c7e1f23486",
      "parents": [
        "46c383cc4530ccc438cb325e92e11eb21dd3d4fc"
      ],
      "author": {
        "name": "Serge E. Hallyn",
        "email": "serue@us.ibm.com",
        "time": "Mon Feb 04 22:29:45 2008 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Tue Feb 05 09:44:20 2008 -0800"
      },
      "message": "capabilities: introduce per-process capability bounding set\n\nThe capability bounding set is a set beyond which capabilities cannot grow.\n Currently cap_bset is per-system.  It can be manipulated through sysctl,\nbut only init can add capabilities.  Root can remove capabilities.  By\ndefault it includes all caps except CAP_SETPCAP.\n\nThis patch makes the bounding set per-process when file capabilities are\nenabled.  It is inherited at fork from parent.  Noone can add elements,\nCAP_SETPCAP is required to remove them.\n\nOne example use of this is to start a safer container.  For instance, until\ndevice namespaces or per-container device whitelists are introduced, it is\nbest to take CAP_MKNOD away from a container.\n\nThe bounding set will not affect pP and pE immediately.  It will only\naffect pP\u0027 and pE\u0027 after subsequent exec()s.  It also does not affect pI,\nand exec() does not constrain pI\u0027.  So to really start a shell with no way\nof regain CAP_MKNOD, you would do\n\n\tprctl(PR_CAPBSET_DROP, CAP_MKNOD);\n\tcap_t cap \u003d cap_get_proc();\n\tcap_value_t caparray[1];\n\tcaparray[0] \u003d CAP_MKNOD;\n\tcap_set_flag(cap, CAP_INHERITABLE, 1, caparray, CAP_DROP);\n\tcap_set_proc(cap);\n\tcap_free(cap);\n\nThe following test program will get and set the bounding\nset (but not pI).  For instance\n\n\t./bset get\n\t\t(lists capabilities in bset)\n\t./bset drop cap_net_raw\n\t\t(starts shell with new bset)\n\t\t(use capset, setuid binary, or binary with\n\t\tfile capabilities to try to increase caps)\n\n************************************************************\ncap_bound.c\n************************************************************\n #include \u003csys/prctl.h\u003e\n #include \u003clinux/capability.h\u003e\n #include \u003csys/types.h\u003e\n #include \u003cunistd.h\u003e\n #include \u003cstdio.h\u003e\n #include \u003cstdlib.h\u003e\n #include \u003cstring.h\u003e\n\n #ifndef PR_CAPBSET_READ\n #define PR_CAPBSET_READ 23\n #endif\n\n #ifndef PR_CAPBSET_DROP\n #define PR_CAPBSET_DROP 24\n #endif\n\nint usage(char *me)\n{\n\tprintf(\"Usage: %s get\\n\", me);\n\tprintf(\"       %s drop \u003ccapability\u003e\\n\", me);\n\treturn 1;\n}\n\n #define numcaps 32\nchar *captable[numcaps] \u003d {\n\t\"cap_chown\",\n\t\"cap_dac_override\",\n\t\"cap_dac_read_search\",\n\t\"cap_fowner\",\n\t\"cap_fsetid\",\n\t\"cap_kill\",\n\t\"cap_setgid\",\n\t\"cap_setuid\",\n\t\"cap_setpcap\",\n\t\"cap_linux_immutable\",\n\t\"cap_net_bind_service\",\n\t\"cap_net_broadcast\",\n\t\"cap_net_admin\",\n\t\"cap_net_raw\",\n\t\"cap_ipc_lock\",\n\t\"cap_ipc_owner\",\n\t\"cap_sys_module\",\n\t\"cap_sys_rawio\",\n\t\"cap_sys_chroot\",\n\t\"cap_sys_ptrace\",\n\t\"cap_sys_pacct\",\n\t\"cap_sys_admin\",\n\t\"cap_sys_boot\",\n\t\"cap_sys_nice\",\n\t\"cap_sys_resource\",\n\t\"cap_sys_time\",\n\t\"cap_sys_tty_config\",\n\t\"cap_mknod\",\n\t\"cap_lease\",\n\t\"cap_audit_write\",\n\t\"cap_audit_control\",\n\t\"cap_setfcap\"\n};\n\nint getbcap(void)\n{\n\tint comma\u003d0;\n\tunsigned long i;\n\tint ret;\n\n\tprintf(\"i know of %d capabilities\\n\", numcaps);\n\tprintf(\"capability bounding set:\");\n\tfor (i\u003d0; i\u003cnumcaps; i++) {\n\t\tret \u003d prctl(PR_CAPBSET_READ, i);\n\t\tif (ret \u003c 0)\n\t\t\tperror(\"prctl\");\n\t\telse if (ret\u003d\u003d1)\n\t\t\tprintf(\"%s%s\", (comma++) ? \", \" : \" \", captable[i]);\n\t}\n\tprintf(\"\\n\");\n\treturn 0;\n}\n\nint capdrop(char *str)\n{\n\tunsigned long i;\n\n\tint found\u003d0;\n\tfor (i\u003d0; i\u003cnumcaps; i++) {\n\t\tif (strcmp(captable[i], str) \u003d\u003d 0) {\n\t\t\tfound\u003d1;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (!found)\n\t\treturn 1;\n\tif (prctl(PR_CAPBSET_DROP, i)) {\n\t\tperror(\"prctl\");\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\nint main(int argc, char *argv[])\n{\n\tif (argc\u003c2)\n\t\treturn usage(argv[0]);\n\tif (strcmp(argv[1], \"get\")\u003d\u003d0)\n\t\treturn getbcap();\n\tif (strcmp(argv[1], \"drop\")!\u003d0 || argc\u003c3)\n\t\treturn usage(argv[0]);\n\tif (capdrop(argv[2])) {\n\t\tprintf(\"unknown capability\\n\");\n\t\treturn 1;\n\t}\n\treturn execl(\"/bin/bash\", \"/bin/bash\", NULL);\n}\n************************************************************\n\n[serue@us.ibm.com: fix typo]\nSigned-off-by: Serge E. Hallyn \u003cserue@us.ibm.com\u003e\nSigned-off-by: Andrew G. Morgan \u003cmorgan@kernel.org\u003e\nCc: Stephen Smalley \u003csds@tycho.nsa.gov\u003e\nCc: James Morris \u003cjmorris@namei.org\u003e\nCc: Chris Wright \u003cchrisw@sous-sol.org\u003e\nCc: Casey Schaufler \u003ccasey@schaufler-ca.com\u003ea\nSigned-off-by: \"Serge E. Hallyn\" \u003cserue@us.ibm.com\u003e\nTested-by: Jiri Slaby \u003cjirislaby@gmail.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "46c383cc4530ccc438cb325e92e11eb21dd3d4fc",
      "tree": "882b84078780844dffa3fc107adf2a053a25cc7f",
      "parents": [
        "e338d263a76af78fe8f38a72131188b58fceb591"
      ],
      "author": {
        "name": "Andrew Morgan",
        "email": "andrew@nagrom.org",
        "time": "Mon Feb 04 22:29:43 2008 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Tue Feb 05 09:44:20 2008 -0800"
      },
      "message": "Remove unnecessary include from include/linux/capability.h\n\nKaiGai Kohei observed that this line in the linux header is not needed.\n\nSigned-off-by: Andrew G. Morgan \u003cmorgan@kernel.org\u003e\nCc: KaiGai Kohei \u003ckaigai@kaigai.gr.jp\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "e338d263a76af78fe8f38a72131188b58fceb591",
      "tree": "f3f046fc6fd66de43de7191830f0daf3bc4ec8eb",
      "parents": [
        "8f6936f4d29aa14e54a2470b954a2e1f96322988"
      ],
      "author": {
        "name": "Andrew Morgan",
        "email": "morgan@kernel.org",
        "time": "Mon Feb 04 22:29:42 2008 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Tue Feb 05 09:44:20 2008 -0800"
      },
      "message": "Add 64-bit capability support to the kernel\n\nThe patch supports legacy (32-bit) capability userspace, and where possible\ntranslates 32-bit capabilities to/from userspace and the VFS to 64-bit\nkernel space capabilities.  If a capability set cannot be compressed into\n32-bits for consumption by user space, the system call fails, with -ERANGE.\n\nFWIW libcap-2.00 supports this change (and earlier capability formats)\n\n http://www.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/\n\n[akpm@linux-foundation.org: coding-syle fixes]\n[akpm@linux-foundation.org: use get_task_comm()]\n[ezk@cs.sunysb.edu: build fix]\n[akpm@linux-foundation.org: do not initialise statics to 0 or NULL]\n[akpm@linux-foundation.org: unused var]\n[serue@us.ibm.com: export __cap_ symbols]\nSigned-off-by: Andrew G. Morgan \u003cmorgan@kernel.org\u003e\nCc: Stephen Smalley \u003csds@tycho.nsa.gov\u003e\nAcked-by: Serge Hallyn \u003cserue@us.ibm.com\u003e\nCc: Chris Wright \u003cchrisw@sous-sol.org\u003e\nCc: James Morris \u003cjmorris@namei.org\u003e\nCc: Casey Schaufler \u003ccasey@schaufler-ca.com\u003e\nSigned-off-by: Erez Zadok \u003cezk@cs.sunysb.edu\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "8f6936f4d29aa14e54a2470b954a2e1f96322988",
      "tree": "63e1bca33b783cf819b356f3ffd45cfe7b226654",
      "parents": [
        "4bea58053f206be9a89ca35850f9ad295dac2042"
      ],
      "author": {
        "name": "Andrew Morton",
        "email": "akpm@linux-foundation.org",
        "time": "Mon Feb 04 22:29:41 2008 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Tue Feb 05 09:44:20 2008 -0800"
      },
      "message": "revert \"capabilities: clean up file capability reading\"\n\nRevert b68680e4731abbd78863063aaa0dca2a6d8cc723 to make way for the next\npatch: \"Add 64-bit capability support to the kernel\".\n\nWe want to keep the vfs_cap_data.data[] structure, using two \u0027data\u0027s for\n64-bit caps (and later three for 96-bit caps), whereas\nb68680e4731abbd78863063aaa0dca2a6d8cc723 had gotten rid of the \u0027data\u0027 struct\nmade its members inline.\n\nThe 64-bit caps patch keeps the stack abuse fix at get_file_caps(), which was\nthe more important part of that patch.\n\n[akpm@linux-foundation.org: coding-style fixes]\nCc: Stephen Smalley \u003csds@tycho.nsa.gov\u003e\nCc: Serge Hallyn \u003cserue@us.ibm.com\u003e\nCc: Chris Wright \u003cchrisw@sous-sol.org\u003e\nCc: James Morris \u003cjmorris@namei.org\u003e\nCc: Casey Schaufler \u003ccasey@schaufler-ca.com\u003e\nCc: Andrew Morgan \u003cmorgan@kernel.org\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "b68680e4731abbd78863063aaa0dca2a6d8cc723",
      "tree": "6c546575432b34abb27a54b51f549071d2819282",
      "parents": [
        "b9049e234401e1fad8459d69a952b174d76c399d"
      ],
      "author": {
        "name": "Serge E. Hallyn",
        "email": "serue@us.ibm.com",
        "time": "Sun Oct 21 16:41:38 2007 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Mon Oct 22 08:13:18 2007 -0700"
      },
      "message": "capabilities: clean up file capability reading\n\nSimplify the vfs_cap_data structure.\n\nAlso fix get_file_caps which was declaring\n__le32 v1caps[XATTR_CAPS_SZ] on the stack, but\nXATTR_CAPS_SZ is already * sizeof(__le32).\n\n[akpm@linux-foundation.org: coding-style fixes]\nSigned-off-by: Serge E. Hallyn \u003cserue@us.ibm.com\u003e\nCc: Andrew Morgan \u003cmorgan@kernel.org\u003e\nCc: Chris Wright \u003cchrisw@sous-sol.org\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "72c2d5823fc7be799a12184974c3bdc57acea3c4",
      "tree": "5c17418efb57cd5b2cdc0d751f577b2c64012423",
      "parents": [
        "7058cb02ddab4bce70a46e519804fccb7ac0a060"
      ],
      "author": {
        "name": "Andrew Morgan",
        "email": "morgan@kernel.org",
        "time": "Thu Oct 18 03:05:59 2007 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Thu Oct 18 14:37:24 2007 -0700"
      },
      "message": "V3 file capabilities: alter behavior of cap_setpcap\n\nThe non-filesystem capability meaning of CAP_SETPCAP is that a process, p1,\ncan change the capabilities of another process, p2.  This is not the\nmeaning that was intended for this capability at all, and this\nimplementation came about purely because, without filesystem capabilities,\nthere was no way to use capabilities without one process bestowing them on\nanother.\n\nSince we now have a filesystem support for capabilities we can fix the\nimplementation of CAP_SETPCAP.\n\nThe most significant thing about this change is that, with it in effect, no\nprocess can set the capabilities of another process.\n\nThe capabilities of a program are set via the capability convolution\nrules:\n\n   pI(post-exec) \u003d pI(pre-exec)\n   pP(post-exec) \u003d (X(aka cap_bset) \u0026 fP) | (pI(post-exec) \u0026 fI)\n   pE(post-exec) \u003d fE ? pP(post-exec) : 0\n\nat exec() time.  As such, the only influence the pre-exec() program can\nhave on the post-exec() program\u0027s capabilities are through the pI\ncapability set.\n\nThe correct implementation for CAP_SETPCAP (and that enabled by this patch)\nis that it can be used to add extra pI capabilities to the current process\n- to be picked up by subsequent exec()s when the above convolution rules\nare applied.\n\nHere is how it works:\n\nLet\u0027s say we have a process, p. It has capability sets, pE, pP and pI.\nGenerally, p, can change the value of its own pI to pI\u0027 where\n\n   (pI\u0027 \u0026 ~pI) \u0026 ~pP \u003d 0.\n\nThat is, the only new things in pI\u0027 that were not present in pI need to\nbe present in pP.\n\nThe role of CAP_SETPCAP is basically to permit changes to pI beyond\nthe above:\n\n   if (pE \u0026 CAP_SETPCAP) {\n      pI\u0027 \u003d anything; /* ie., even (pI\u0027 \u0026 ~pI) \u0026 ~pP !\u003d 0  */\n   }\n\nThis capability is useful for things like login, which (say, via\npam_cap) might want to raise certain inheritable capabilities for use\nby the children of the logged-in user\u0027s shell, but those capabilities\nare not useful to or needed by the login program itself.\n\nOne such use might be to limit who can run ping. You set the\ncapabilities of the \u0027ping\u0027 program to be \"\u003d cap_net_raw+i\", and then\nonly shells that have (pI \u0026 CAP_NET_RAW) will be able to run\nit. Without CAP_SETPCAP implemented as described above, login(pam_cap)\nwould have to also have (pP \u0026 CAP_NET_RAW) in order to raise this\ncapability and pass it on through the inheritable set.\n\nSigned-off-by: Andrew Morgan \u003cmorgan@kernel.org\u003e\nSigned-off-by: Serge E. Hallyn \u003cserue@us.ibm.com\u003e\nCc: Stephen Smalley \u003csds@tycho.nsa.gov\u003e\nCc: James Morris \u003cjmorris@namei.org\u003e\nCc: Casey Schaufler \u003ccasey@schaufler-ca.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "b53767719b6cd8789392ea3e7e2eb7b8906898f0",
      "tree": "a0279dc93c79b94d3865b0f19f6b7b353e20608c",
      "parents": [
        "57c521ce6125e15e99e56c902cb8da96bee7b36d"
      ],
      "author": {
        "name": "Serge E. Hallyn",
        "email": "serue@us.ibm.com",
        "time": "Tue Oct 16 23:31:36 2007 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Wed Oct 17 08:43:07 2007 -0700"
      },
      "message": "Implement file posix capabilities\n\nImplement file posix capabilities.  This allows programs to be given a\nsubset of root\u0027s powers regardless of who runs them, without having to use\nsetuid and giving the binary all of root\u0027s powers.\n\nThis version works with Kaigai Kohei\u0027s userspace tools, found at\nhttp://www.kaigai.gr.jp/index.php.  For more information on how to use this\npatch, Chris Friedhoff has posted a nice page at\nhttp://www.friedhoff.org/fscaps.html.\n\nChangelog:\n\tNov 27:\n\tIncorporate fixes from Andrew Morton\n\t(security-introduce-file-caps-tweaks and\n\tsecurity-introduce-file-caps-warning-fix)\n\tFix Kconfig dependency.\n\tFix change signaling behavior when file caps are not compiled in.\n\n\tNov 13:\n\tIntegrate comments from Alexey: Remove CONFIG_ ifdef from\n\tcapability.h, and use %zd for printing a size_t.\n\n\tNov 13:\n\tFix endianness warnings by sparse as suggested by Alexey\n\tDobriyan.\n\n\tNov 09:\n\tAddress warnings of unused variables at cap_bprm_set_security\n\twhen file capabilities are disabled, and simultaneously clean\n\tup the code a little, by pulling the new code into a helper\n\tfunction.\n\n\tNov 08:\n\tFor pointers to required userspace tools and how to use\n\tthem, see http://www.friedhoff.org/fscaps.html.\n\n\tNov 07:\n\tFix the calculation of the highest bit checked in\n\tcheck_cap_sanity().\n\n\tNov 07:\n\tAllow file caps to be enabled without CONFIG_SECURITY, since\n\tcapabilities are the default.\n\tHook cap_task_setscheduler when !CONFIG_SECURITY.\n\tMove capable(TASK_KILL) to end of cap_task_kill to reduce\n\taudit messages.\n\n\tNov 05:\n\tAdd secondary calls in selinux/hooks.c to task_setioprio and\n\ttask_setscheduler so that selinux and capabilities with file\n\tcap support can be stacked.\n\n\tSep 05:\n\tAs Seth Arnold points out, uid checks are out of place\n\tfor capability code.\n\n\tSep 01:\n\tDefine task_setscheduler, task_setioprio, cap_task_kill, and\n\ttask_setnice to make sure a user cannot affect a process in which\n\tthey called a program with some fscaps.\n\n\tOne remaining question is the note under task_setscheduler: are we\n\tok with CAP_SYS_NICE being sufficient to confine a process to a\n\tcpuset?\n\n\tIt is a semantic change, as without fsccaps, attach_task doesn\u0027t\n\tallow CAP_SYS_NICE to override the uid equivalence check.  But since\n\tit uses security_task_setscheduler, which elsewhere is used where\n\tCAP_SYS_NICE can be used to override the uid equivalence check,\n\tfixing it might be tough.\n\n\t     task_setscheduler\n\t\t note: this also controls cpuset:attach_task.  Are we ok with\n\t\t     CAP_SYS_NICE being used to confine to a cpuset?\n\t     task_setioprio\n\t     task_setnice\n\t\t sys_setpriority uses this (through set_one_prio) for another\n\t\t process.  Need same checks as setrlimit\n\n\tAug 21:\n\tUpdated secureexec implementation to reflect the fact that\n\teuid and uid might be the same and nonzero, but the process\n\tmight still have elevated caps.\n\n\tAug 15:\n\tHandle endianness of xattrs.\n\tEnforce capability version match between kernel and disk.\n\tEnforce that no bits beyond the known max capability are\n\tset, else return -EPERM.\n\tWith this extra processing, it may be worth reconsidering\n\tdoing all the work at bprm_set_security rather than\n\td_instantiate.\n\n\tAug 10:\n\tAlways call getxattr at bprm_set_security, rather than\n\tcaching it at d_instantiate.\n\n[morgan@kernel.org: file-caps clean up for linux/capability.h]\n[bunk@kernel.org: unexport cap_inode_killpriv]\nSigned-off-by: Serge E. Hallyn \u003cserue@us.ibm.com\u003e\nCc: Stephen Smalley \u003csds@tycho.nsa.gov\u003e\nCc: James Morris \u003cjmorris@namei.org\u003e\nCc: Chris Wright \u003cchrisw@sous-sol.org\u003e\nCc: Andrew Morgan \u003cmorgan@kernel.org\u003e\nSigned-off-by: Andrew Morgan \u003cmorgan@kernel.org\u003e\nSigned-off-by: Adrian Bunk \u003cbunk@kernel.org\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "0a3021f4e249fbdb5f30d614707b5e02022e4c9b",
      "tree": "c01b80fa03dbb4a853b46f182864384736a54088",
      "parents": [
        "9aacd599342fdfc1fb9422f37e900609b7a46249"
      ],
      "author": {
        "name": "Robert P. J. Day",
        "email": "rpjday@mindspring.com",
        "time": "Sun Jul 15 23:39:57 2007 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Mon Jul 16 09:05:42 2007 -0700"
      },
      "message": "Remove unnecessary includes of spinlock.h under include/linux\n\nRemove the obviously unnecessary includes of \u003clinux/spinlock.h\u003e under the\ninclude/linux/ directory, and fix the couple errors that are introduced as\na result of that.\n\nSigned-off-by: Robert P. J. Day \u003crpjday@mindspring.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "b7add02d6247bff34005e040347d81777c80931c",
      "tree": "41a2756e9fc1fc961ff29be08b5b8a080bbc2c03",
      "parents": [
        "8ce7ad7b2d11fae2c3d285a6a0caea9322c0b8fc"
      ],
      "author": {
        "name": "Andrew Morton",
        "email": "akpm@linux-foundation.org",
        "time": "Wed May 23 13:57:39 2007 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@woody.linux-foundation.org",
        "time": "Wed May 23 20:14:12 2007 -0700"
      },
      "message": "capability.h warning fix\n\ninclude/linux/capability.h:397: warning: \"struct task_struct\" declared inside parameter list\ninclude/linux/capability.h:397: warning: its scope is only this definition or declaration, which is probably not what you want\n\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "12b5989be10011387a9da5dee82e5c0d6f9d02e7",
      "tree": "74da71d407bf26bf97c639bb2b473de233a736ac",
      "parents": [
        "77d47582c2345e071df02afaf9191641009287c4"
      ],
      "author": {
        "name": "Chris Wright",
        "email": "chrisw@sous-sol.org",
        "time": "Sat Mar 25 03:07:41 2006 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@g5.osdl.org",
        "time": "Sat Mar 25 08:22:56 2006 -0800"
      },
      "message": "[PATCH] refactor capable() to one implementation, add __capable() helper\n\nMove capable() to kernel/capability.c and eliminate duplicate\nimplementations.  Add __capable() function which can be used to check for\ncapabiilty of any process.\n\nSigned-off-by: Chris Wright \u003cchrisw@sous-sol.org\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "c59ede7b78db329949d9cdcd7064e22d357560ef",
      "tree": "f9dc9d464fdad5bfd464d983e77c1af031389dda",
      "parents": [
        "e16885c5ad624a6efe1b1bf764e075d75f65a788"
      ],
      "author": {
        "name": "Randy.Dunlap",
        "email": "rdunlap@xenotime.net",
        "time": "Wed Jan 11 12:17:46 2006 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@g5.osdl.org",
        "time": "Wed Jan 11 18:42:13 2006 -0800"
      },
      "message": "[PATCH] move capable() to capability.h\n\n- Move capable() from sched.h to capability.h;\n\n- Use \u003clinux/capability.h\u003e where capable() is used\n\t(in include/, block/, ipc/, kernel/, a few drivers/,\n\tmm/, security/, \u0026 sound/;\n\tmany more drivers/ to go)\n\nSigned-off-by: Randy Dunlap \u003crdunlap@xenotime.net\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "bce5f6ba340b09d8b29902add204bb95a6d3d88b",
      "tree": "1cfeea969fa5848f0a8d31394829aec5c8571a79",
      "parents": [
        "242e54686257493f0b10ac557e730419d9af7d24"
      ],
      "author": {
        "name": "Martin Hicks",
        "email": "mort@sgi.com",
        "time": "Sat Sep 03 15:54:50 2005 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@evo.osdl.org",
        "time": "Mon Sep 05 00:05:44 2005 -0700"
      },
      "message": "[PATCH] VM: add capabilites check to set_zone_reclaim\n\nAdd a capability check to sys_set_zone_reclaim().  This syscall is not\nsomething that should be available to a user.\n\nSigned-off-by:  Martin Hicks \u003cmort@sgi.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n"
    },
    {
      "commit": "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2",
      "tree": "0bba044c4ce775e45a88a51686b5d9f90697ea9d",
      "parents": [],
      "author": {
        "name": "Linus Torvalds",
        "email": "torvalds@ppc970.osdl.org",
        "time": "Sat Apr 16 15:20:36 2005 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@ppc970.osdl.org",
        "time": "Sat Apr 16 15:20:36 2005 -0700"
      },
      "message": "Linux-2.6.12-rc2\n\nInitial git repository build. I\u0027m not bothering with the full history,\neven though we have it. We can create a separate \"historical\" git\narchive of that later if we want to, and in the meantime it\u0027s about\n3.2GB when imported into git - space that would just make the early\ngit days unnecessarily complicated, when we don\u0027t have a lot of good\ninfrastructure for it.\n\nLet it rip!\n"
    }
  ]
}
