)]}'
{
  "commit": "9eb8a659dea694b0dcbd6287f6b1fbdc523b80bc",
  "tree": "35ad406db615fa0a81a181df966c1229585083da",
  "parents": [
    "725fc629ff2545b061407305ae51016c9f928fce"
  ],
  "author": {
    "name": "Oleg Nesterov",
    "email": "oleg@redhat.com",
    "time": "Mon May 23 16:24:08 2016 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Mon May 23 17:04:14 2016 -0700"
  },
  "message": "exec: remove the no longer needed remove_arg_zero()-\u003efree_arg_page()\n\nremove_arg_zero() does free_arg_page() for no reason.  This was needed\nbefore and only if CONFIG_MMU\u003dy: see commit 4fc75ff4816c (\"exec: fix\nremove_arg_zero\"), install_arg_page() was called for every page !\u003d NULL\nin bprm-\u003epage[] array.  Today install_arg_page() has already gone and\nfree_arg_page() is nop after another commit b6a2fea39318 (\"mm: variable\nlength argument support\").\n\nCONFIG_MMU\u003dn does free_arg_pages() in free_bprm() and thus it doesn\u0027t\nneed remove_arg_zero()-\u003efree_arg_page() too; apart from get_arg_page()\nit never checks if the page in bprm-\u003epage[] was allocated or not, so the\n\"extra\" non-freed page is fine.  OTOH, this free_arg_page() can add the\nminor pessimization, the caller is going to do copy_strings_kernel()\nright after remove_arg_zero() which will likely need to re-allocate the\nsame page again.\n\nAnd as Hujunjie pointed out, the \"offset \u003d\u003d PAGE_SIZE\" check is wrong\nbecause we are going to increment bprm-\u003ep once again before return, so\nCONFIG_MMU\u003dn \"leaks\" the page anyway if \u00270\u0027 is the final byte in this\npage.\n\nNOTE: remove_arg_zero() assumes that argv[0] is null-terminated but this\nis not necessarily true.  copy_strings() does \"len \u003d strnlen_user(...)\",\nthen copy_from_user(len) but another thread or debuger can overwrite the\ntrailing \u00270\u0027 in between.  Afaics nothing really bad can happen because\nwe must always have the null-terminated bprm-\u003efilename copied by the 1st\ncopy_strings_kernel(), but perhaps we should change this code to check\n\"bprm-\u003ep \u003c bprm-\u003eexec\" anyway, and/or change copy_strings() to ensure\nthat the last byte in string is always zero.\n\nLink: http://lkml.kernel.org/r/20160517155335.GA31435@redhat.com\nSigned-off-by: Oleg Nesterov \u003coleg@redhat.com\u003e\nReported by: hujunjie \u003cjj.net@163.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "e92419fd78b326720ae97f70198f3aa399c58436",
      "old_mode": 33188,
      "old_path": "fs/exec.c",
      "new_id": "4f079bd083af86f6ed7655f59c2314e7aeb808fa",
      "new_mode": 33188,
      "new_path": "fs/exec.c"
    }
  ]
}
