)]}'
{
  "commit": "c6b51849a2c5d89edd7a47f77c14ec29af97b873",
  "tree": "820fe8b3a29836d9e2a0b5a87476bbcd044caba1",
  "parents": [
    "502f4ebab92ac450f0d5f30f8751c6b43eb8ceef"
  ],
  "author": {
    "name": "Weidong Wang",
    "email": "weidongw@illinois.edu",
    "time": "Thu Nov 12 00:56:11 2026 -0600"
  },
  "committer": {
    "name": "Mimi Zohar",
    "email": "zohar@linux.ibm.com",
    "time": "Fri Nov 20 09:27:50 2026 -0500"
  },
  "message": "ima: reject duplicate fsname\u003d in a policy rule\n\nima_parse_rule() stores the fsname\u003d value with kstrdup() but, unlike\nfsmagic\u003d, fs_subtype\u003d and the other options, does not check whether the\nrule already has one. A rule that names fsname\u003d twice overwrites\nentry-\u003efsname and leaks the first string.\n\nReject the duplicate with -EINVAL, as fs_subtype\u003d does. Such a rule used\nto be accepted with the last fsname\u003d taking effect; giving the option\ntwice was never meaningful, and the other options already reject it.\n\nWriting the policy requires CAP_SYS_ADMIN, so the leak is limited to a\nfew bytes per malformed rule loaded by a privileged user.\n\nConfirmed on an unmodified kernel, without error injection, on x86_64\nunder QEMU with kmemleak: loading 64 rules with a duplicated fsname\u003d\nleft 64 unreferenced objects allocated by kstrdup() in ima_parse_rule()\n(inlined into ima_parse_add_rule()); the same rules with a single\nfsname\u003d left none. With this patch the duplicate rules are rejected and\nkmemleak reports nothing; rules with a single fsname\u003d are still accepted.\n\nFixes: f1b08bbcbdaf (\"ima: define a new policy condition based on the filesystem name\")\nReported-by: Zijie Zhao \u003czijie4@illinois.edu\u003e\nSigned-off-by: Weidong Wang \u003cweidongw@illinois.edu\u003e\nReviewed-by: Roberto Sassu \u003croberto.sassu@huawei.com\u003e\n[zohar: removed AI tool attribution, changed Cc tag to credit Zijie Zhao\nwith contribution based on the AI attribution]\nSigned-off-by: Mimi Zohar \u003czohar@linux.ibm.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "2dc1d93aa768e198fee9bb0c73dc770904c2b2a7",
      "old_mode": 33188,
      "old_path": "security/integrity/ima/ima_policy.c",
      "new_id": "f08ca00bd9994e9a11aa4085831e28f5653ad243",
      "new_mode": 33188,
      "new_path": "security/integrity/ima/ima_policy.c"
    }
  ]
}
