)]}'
{
  "commit": "57e7ba04d422c3d41c8426380303ec9b7533ded9",
  "tree": "826c33ecfc1a2bca8601e63c87384218baea890e",
  "parents": [
    "d81fa669e3de7eb8a631d7d95dac5fbcb2bf9d4e"
  ],
  "author": {
    "name": "Casey Schaufler",
    "email": "casey@schaufler-ca.com",
    "time": "Tue Sep 19 09:39:08 2017 -0700"
  },
  "committer": {
    "name": "James Morris",
    "email": "james.l.morris@oracle.com",
    "time": "Wed Oct 04 18:03:15 2017 +1100"
  },
  "message": "lsm: fix smack_inode_removexattr and xattr_getsecurity memleak\n\nsecurity_inode_getsecurity() provides the text string value\nof a security attribute. It does not provide a \"secctx\".\nThe code in xattr_getsecurity() that calls security_inode_getsecurity()\nand then calls security_release_secctx() happened to work because\nSElinux and Smack treat the attribute and the secctx the same way.\nIt fails for cap_inode_getsecurity(), because that module has no\nsecctx that ever needs releasing. It turns out that Smack is the\none that\u0027s doing things wrong by not allocating memory when instructed\nto do so by the \"alloc\" parameter.\n\nThe fix is simple enough. Change the security_release_secctx() to\nkfree() because it isn\u0027t a secctx being returned by\nsecurity_inode_getsecurity(). Change Smack to allocate the string when\ntold to do so.\n\nNote: this also fixes memory leaks for LSMs which implement\ninode_getsecurity but not release_secctx, such as capabilities.\n\nSigned-off-by: Casey Schaufler \u003ccasey@schaufler-ca.com\u003e\nReported-by: Konstantin Khlebnikov \u003ckhlebnikov@yandex-team.ru\u003e\nCc: stable@vger.kernel.org\nSigned-off-by: James Morris \u003cjames.l.morris@oracle.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "4424f7fecf14549b65c62d0cac4b8b692718f426",
      "old_mode": 33188,
      "old_path": "fs/xattr.c",
      "new_id": "61cd28ba25f364df5af103277924befb6d4a39a0",
      "new_mode": 33188,
      "new_path": "fs/xattr.c"
    },
    {
      "type": "modify",
      "old_id": "319add31b4a4ee7b5464d2a15782289ecb110ce7",
      "old_mode": 33188,
      "old_path": "security/smack/smack_lsm.c",
      "new_id": "286171a16ed255e20c396fca595600488c059c2d",
      "new_mode": 33188,
      "new_path": "security/smack/smack_lsm.c"
    }
  ]
}
