)]}'
{
  "commit": "006ebb40d3d65338bd74abb03b945f8d60e362bd",
  "tree": "c548c678b54b307e1fb9acf94676fb7bfd849501",
  "parents": [
    "feb2a5b82d87fbdc01c00b7e9413e4b5f4c1f0c1"
  ],
  "author": {
    "name": "Stephen Smalley",
    "email": "sds@tycho.nsa.gov",
    "time": "Mon May 19 08:32:49 2008 -0400"
  },
  "committer": {
    "name": "James Morris",
    "email": "jmorris@namei.org",
    "time": "Mon Jul 14 15:01:47 2008 +1000"
  },
  "message": "Security: split proc ptrace checking into read vs. attach\n\nEnable security modules to distinguish reading of process state via\nproc from full ptrace access by renaming ptrace_may_attach to\nptrace_may_access and adding a mode argument indicating whether only\nread access or full attach access is requested.  This allows security\nmodules to permit access to reading process state without granting\nfull ptrace access.  The base DAC/capability checking remains unchanged.\n\nRead access to /proc/pid/mem continues to apply a full ptrace attach\ncheck since check_mem_permission() already requires the current task\nto already be ptracing the target.  The other ptrace checks within\nproc for elements like environ, maps, and fds are changed to pass the\nread mode instead of attach.\n\nIn the SELinux case, we model such reading of process state as a\nreading of a proc file labeled with the target process\u0027 label.  This\nenables SELinux policy to permit such reading of process state without\npermitting control or manipulation of the target process, as there are\na number of cases where programs probe for such information via proc\nbut do not need to be able to control the target (e.g. procps,\nlsof, PolicyKit, ConsoleKit).  At present we have to choose between\nallowing full ptrace in policy (more permissive than required/desired)\nor breaking functionality (or in some cases just silencing the denials\nvia dontaudit rules but this can hide genuine attacks).\n\nThis version of the patch incorporates comments from Casey Schaufler\n(change/replace existing ptrace_may_attach interface, pass access\nmode), and Chris Wright (provide greater consistency in the checking).\n\nNote that like their predecessors __ptrace_may_attach and\nptrace_may_attach, the __ptrace_may_access and ptrace_may_access\ninterfaces use different return value conventions from each other (0\nor -errno vs. 1 or 0).  I retained this difference to avoid any\nchanges to the caller logic but made the difference clearer by\nchanging the latter interface to return a bool rather than an int and\nby adding a comment about it to ptrace.h for any future callers.\n\nSigned-off-by:  Stephen Smalley \u003csds@tycho.nsa.gov\u003e\nAcked-by: Chris Wright \u003cchrisw@sous-sol.org\u003e\nSigned-off-by: James Morris \u003cjmorris@namei.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "3b455371e7ff50981229d98359344ef92a228d0e",
      "old_mode": 33188,
      "old_path": "fs/proc/base.c",
      "new_id": "58c3e6a8e15e160ec3d6af3aabe6138b666b00b8",
      "new_mode": 33188,
      "new_path": "fs/proc/base.c"
    },
    {
      "type": "modify",
      "old_id": "c492449f3b45057cba171121e7e2b08b934adbfc",
      "old_mode": 33188,
      "old_path": "fs/proc/task_mmu.c",
      "new_id": "164bd9f9ede3024188285d071bbc6caa47cb94f8",
      "new_mode": 33188,
      "new_path": "fs/proc/task_mmu.c"
    },
    {
      "type": "modify",
      "old_id": "4b4f9cc2f186a72705a2525367b8861b6889a0ad",
      "old_mode": 33188,
      "old_path": "fs/proc/task_nommu.c",
      "new_id": "5d84e7121df819cd0d9eb8b9bd54973edf5b77ed",
      "new_mode": 33188,
      "new_path": "fs/proc/task_nommu.c"
    },
    {
      "type": "modify",
      "old_id": "f98501ba557eea676a827aed770d57b0b4b12c56",
      "old_mode": 33188,
      "old_path": "include/linux/ptrace.h",
      "new_id": "c6f5f9dd0cee41636f282237e0ccfacf07586f96",
      "new_mode": 33188,
      "new_path": "include/linux/ptrace.h"
    },
    {
      "type": "modify",
      "old_id": "50737c70e78ea41e2a2e4551b6044df86f8a1de3",
      "old_mode": 33188,
      "old_path": "include/linux/security.h",
      "new_id": "62bd80cb7f876d326cf79760554627ae0a7d42bc",
      "new_mode": 33188,
      "new_path": "include/linux/security.h"
    },
    {
      "type": "modify",
      "old_id": "6c19e94fd0a5482786e432599a0fb4840a5c66cb",
      "old_mode": 33188,
      "old_path": "kernel/ptrace.c",
      "new_id": "e337390fce011dc0ea1d5eba1cf678553fb93b71",
      "new_mode": 33188,
      "new_path": "kernel/ptrace.c"
    },
    {
      "type": "modify",
      "old_id": "33d34330841344f7329e1b1f313cc531c65aa7a9",
      "old_mode": 33188,
      "old_path": "security/commoncap.c",
      "new_id": "0b6537a3672d8822baf4b10627f142e9afc1102b",
      "new_mode": 33188,
      "new_path": "security/commoncap.c"
    },
    {
      "type": "modify",
      "old_id": "b8916883b77f0c0cdc495e979edcf5775818272d",
      "old_mode": 33188,
      "old_path": "security/dummy.c",
      "new_id": "1db712d99dc7e969380589e4659e8f54bcfbf89a",
      "new_mode": 33188,
      "new_path": "security/dummy.c"
    },
    {
      "type": "modify",
      "old_id": "59838a99b80e981d27ae892e7d3aa0204bb484c1",
      "old_mode": 33188,
      "old_path": "security/security.c",
      "new_id": "c4507ce2a5a0a7c4bcf10f9d6f52866ff3222ad7",
      "new_mode": 33188,
      "new_path": "security/security.c"
    },
    {
      "type": "modify",
      "old_id": "eca70f42e678c67df6c524b973733917c32bff1b",
      "old_mode": 33188,
      "old_path": "security/selinux/hooks.c",
      "new_id": "4be156334b22f06a28631cc3952cbd161468f2a0",
      "new_mode": 33188,
      "new_path": "security/selinux/hooks.c"
    },
    {
      "type": "modify",
      "old_id": "4a09293efa007329fdc56b39f2dc5dd923d45f42",
      "old_mode": 33188,
      "old_path": "security/smack/smack_lsm.c",
      "new_id": "3c7150b3493d0d7bbf554ba8d62045612ad2de60",
      "new_mode": 33188,
      "new_path": "security/smack/smack_lsm.c"
    }
  ]
}
