)]}'
{
  "commit": "8118a859dc7abd873193986c77a8d9bdb877adc8",
  "tree": "6b66719637ba2b4174c126cb751a090de0536269",
  "parents": [
    "71409a498e96a421bdc20e7275ebc4fab8b14cdc"
  ],
  "author": {
    "name": "Miao Xie",
    "email": "miaox@cn.fujitsu.com",
    "time": "Wed Nov 21 14:55:19 2007 -0800"
  },
  "committer": {
    "name": "Greg Kroah-Hartman",
    "email": "gregkh@suse.de",
    "time": "Wed Nov 28 13:53:53 2007 -0800"
  },
  "message": "sysfs: fix off-by-one error in fill_read_buffer()\n\nI found that there is a off-by-one problem in the following code.\n\nVersion:\t2.6.24-rc2\nFile:\t\tfs/sysfs/file.c:118-122\nFunction:\tfill_read_buffer\n--------------------------------------------------------------------\n\tcount \u003d ops-\u003eshow(kobj, attr_sd-\u003es_attr.attr, buffer-\u003epage);\n\n\tsysfs_put_active_two(attr_sd);\n\n\tBUG_ON(count \u003e (ssize_t)PAGE_SIZE);\n--------------------------------------------------------------------\n\nBecause according to the specification of the sysfs and the implement of\nthe show methods, the show methods return the number of bytes which would\nbe generated for the given input, excluding the trailing null.So if the\nreturn value of the show methods equals PAGE_SIZE - 1, the buffer is full\nin fact.  And if the return value equals PAGE_SIZE, the resulting string\nwas already truncated,or buffer overflow occurred.\n\nThis patch fixes an off-by-one error in fill_read_buffer.\n\nSigned-off-by: Miao Xie \u003cmiaox@cn.fujitsu.com\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nAcked-by: Tejun Heo \u003cteheo@suse.de\u003e\nSigned-off-by: Greg Kroah-Hartman \u003cgregkh@suse.de\u003e\n\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "27d1785b764463c4bc654e9713f41c369d9ea0cb",
      "old_mode": 33188,
      "old_path": "fs/sysfs/file.c",
      "new_id": "4045bdcc4b331dbf7f4cdd7c6d781f16021ffbf2",
      "new_mode": 33188,
      "new_path": "fs/sysfs/file.c"
    }
  ]
}
