)]}'
{
  "commit": "8bbf4976b59fc9fc2861e79cab7beb3f6d647640",
  "tree": "9bd621217cbdfcf94aca5b220de7363254d7fc23",
  "parents": [
    "e9e349b051d98799b743ebf248cc2d986fedf090"
  ],
  "author": {
    "name": "David Howells",
    "email": "dhowells@redhat.com",
    "time": "Fri Nov 14 10:39:14 2008 +1100"
  },
  "committer": {
    "name": "James Morris",
    "email": "jmorris@namei.org",
    "time": "Fri Nov 14 10:39:14 2008 +1100"
  },
  "message": "KEYS: Alter use of key instantiation link-to-keyring argument\n\nAlter the use of the key instantiation and negation functions\u0027 link-to-keyring\narguments.  Currently this specifies a keyring in the target process to link\nthe key into, creating the keyring if it doesn\u0027t exist.  This, however, can be\na problem for copy-on-write credentials as it means that the instantiating\nprocess can alter the credentials of the requesting process.\n\nThis patch alters the behaviour such that:\n\n (1) If keyctl_instantiate_key() or keyctl_negate_key() are given a specific\n     keyring by ID (ringid \u003e\u003d 0), then that keyring will be used.\n\n (2) If keyctl_instantiate_key() or keyctl_negate_key() are given one of the\n     special constants that refer to the requesting process\u0027s keyrings\n     (KEY_SPEC_*_KEYRING, all \u003c\u003d 0), then:\n\n     (a) If sys_request_key() was given a keyring to use (destringid) then the\n     \t key will be attached to that keyring.\n\n     (b) If sys_request_key() was given a NULL keyring, then the key being\n     \t instantiated will be attached to the default keyring as set by\n     \t keyctl_set_reqkey_keyring().\n\n (3) No extra link will be made.\n\nDecision point (1) follows current behaviour, and allows those instantiators\nwho\u0027ve searched for a specifically named keyring in the requestor\u0027s keyring so\nas to partition the keys by type to still have their named keyrings.\n\nDecision point (2) allows the requestor to make sure that the key or keys that\nget produced by request_key() go where they want, whilst allowing the\ninstantiator to request that the key is retained.  This is mainly useful for\nsituations where the instantiator makes a secondary request, the key for which\nshould be retained by the initial requestor:\n\n\t+-----------+        +--------------+        +--------------+\n\t|           |        |              |        |              |\n\t| Requestor |-------\u003e| Instantiator |-------\u003e| Instantiator |\n\t|           |        |              |        |              |\n\t+-----------+        +--------------+        +--------------+\n\t           request_key()           request_key()\n\nThis might be useful, for example, in Kerberos, where the requestor requests a\nticket, and then the ticket instantiator requests the TGT, which someone else\nthen has to go and fetch.  The TGT, however, should be retained in the\nkeyrings of the requestor, not the first instantiator.  To make this explict\nan extra special keyring constant is also added.\n\nSigned-off-by: David Howells \u003cdhowells@redhat.com\u003e\nReviewed-by: James Morris \u003cjmorris@namei.org\u003e\nSigned-off-by: James Morris \u003cjmorris@namei.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "1b70e35a71e378808454a60429c478c20200fe48",
      "old_mode": 33188,
      "old_path": "include/linux/key.h",
      "new_id": "df709e1af3cd3e25fa4ce44c16bf969327d67339",
      "new_mode": 33188,
      "new_path": "include/linux/key.h"
    },
    {
      "type": "modify",
      "old_id": "656ee6b77a4a337d2dcdd728e8a1d79af83ba5ad",
      "old_mode": 33188,
      "old_path": "include/linux/keyctl.h",
      "new_id": "c0688eb7209396bf8ca3d5ba3202f6b8033ef981",
      "new_mode": 33188,
      "new_path": "include/linux/keyctl.h"
    },
    {
      "type": "modify",
      "old_id": "3d3c3ea3a023376f2ecf8c16b6c89aed39da67f4",
      "old_mode": 33188,
      "old_path": "kernel/kmod.c",
      "new_id": "f044f8f577030dabff0e43e8bed92439068f46f7",
      "new_mode": 33188,
      "new_path": "kernel/kmod.c"
    },
    {
      "type": "modify",
      "old_id": "a60c68138b4dcd34005f4dd6d0736ac07ccb9369",
      "old_mode": 33188,
      "old_path": "security/keys/internal.h",
      "new_id": "d1586c6297883dbd170f68563a1d1fc2f86d2633",
      "new_mode": 33188,
      "new_path": "security/keys/internal.h"
    },
    {
      "type": "modify",
      "old_id": "3f09e5b2a7848eaadd03ec5f6e5b8734fdd6d444",
      "old_mode": 33188,
      "old_path": "security/keys/keyctl.c",
      "new_id": "fcce331eca72da78f3c9cce7eca232b56d3d3922",
      "new_mode": 33188,
      "new_path": "security/keys/keyctl.c"
    },
    {
      "type": "modify",
      "old_id": "5be6d018759abf43d469bc786d04305223464574",
      "old_mode": 33188,
      "old_path": "security/keys/process_keys.c",
      "new_id": "1c793b7090a75be3c1412bba294af1ddd32b1332",
      "new_mode": 33188,
      "new_path": "security/keys/process_keys.c"
    },
    {
      "type": "modify",
      "old_id": "91953c814497a4531bccfe398ba5283c06c59c0d",
      "old_mode": 33188,
      "old_path": "security/keys/request_key.c",
      "new_id": "8e9d93b4a4026170b975118ec0d3224548846684",
      "new_mode": 33188,
      "new_path": "security/keys/request_key.c"
    },
    {
      "type": "modify",
      "old_id": "729156b3485e2cf84f1cec8c1fd56489981c1c45",
      "old_mode": 33188,
      "old_path": "security/keys/request_key_auth.c",
      "new_id": "1762d44711d50babac8ed093471ebc64e5c63965",
      "new_mode": 33188,
      "new_path": "security/keys/request_key_auth.c"
    }
  ]
}
