)]}'
{
  "commit": "347ba8a588c3e49f357291e5a1ac38a11d7e052d",
  "tree": "e3f67be1903df707e60116f841b8082da7facc7b",
  "parents": [
    "07e003417b88deac4b887c98f499fc3b01bc8df0"
  ],
  "author": {
    "name": "David Fries",
    "email": "david@fries.net",
    "time": "Wed Oct 15 22:04:51 2008 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Thu Oct 16 11:21:50 2008 -0700"
  },
  "message": "W1: w1_therm fix user buffer overflow and cat\n\nFixed data reading bug by replacing binary attribute with device one.\n\nSwitching the sysfs read from bin_attribute to device_attribute.  The data\nis far under PAGE_SIZE so the binary interface isn\u0027t required.  As the\ndevice_attribute interface will make one call to w1_therm_read per file\nopen and buffer, the result is, the following problems go away.\n\nbuffer overflow:\n\tExecute a short read on w1_slave and w1_therm_read_bin would still\n\treturn the full string size worth of data clobbering the user space\n\tbuffer when it returned.  Switching to device_attribute avoids the\n\tbuffer overflow problems.  With the snprintf formatted output dealing\n\twith short reads without doing a conversion per read would have\n\tbeen difficult.\nbad behavior:\n\t`cat w1_slave` would cause two temperature conversions to take place.\n\tPreviously the code assumed W1_SLAVE_DATA_SIZE would be returned with\n\teach read.  It would not return 0 unless the offset was less\n\tthan W1_SLAVE_DATA_SIZE.  The result was the first read did a\n\ttemperature conversion, filled the buffer and returned, the\n\toffset in the second read would be less than\n\tW1_SLAVE_DATA_SIZE and also fill the buffer and return, the\n\tthird read would finnally have a big enough offset to return 0\n\tand cause cat to stop.  Now w1_therm_read will be called at\n\tmost once per open.\n\nSigned-off-by: David Fries \u003cdavid@fries.net\u003e\nSigned-off-by: Evgeniy Polyakov \u003cjohnpol@2ka.mipt.ru\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": "e87f464a6fb0adbd0c224e8951751f510bf5572a",
      "old_mode": 33188,
      "old_path": "drivers/w1/slaves/w1_therm.c",
      "new_id": "7de99dfd11c89ae4335eb910ba57b142e71c562b",
      "new_mode": 33188,
      "new_path": "drivers/w1/slaves/w1_therm.c"
    },
    {
      "type": "modify",
      "old_id": "00b84ab22808e32fcfed046cbddfa6f11fa379a2",
      "old_mode": 33188,
      "old_path": "drivers/w1/w1.h",
      "new_id": "cdaa6fffbfc73c2c6bd6be3eefdd2a600ca3f82e",
      "new_mode": 33188,
      "new_path": "drivers/w1/w1.h"
    }
  ]
}
