)]}'
{
  "commit": "c6517b7942fad663cc1cf3235cbe4207cf769332",
  "tree": "63af1b1aa434d756d7b7128f9e5d77bcdcbdf15e",
  "parents": [
    "bd5cd9cdc5379088b7e4e9a1757a1d101223a005"
  ],
  "author": {
    "name": "Tony Battersby",
    "email": "tonyb@cybernetics.com",
    "time": "Wed Jan 21 14:45:50 2009 -0500"
  },
  "committer": {
    "name": "James Bottomley",
    "email": "James.Bottomley@HansenPartnership.com",
    "time": "Thu Mar 12 12:58:04 2009 -0500"
  },
  "message": "[SCSI] sg: fix races during device removal\n\nsg has the following problems related to device removal:\n\n* opening a sg fd races with removing a device\n* closing a sg fd races with removing a device\n* /proc/scsi/sg/* access races with removing a device\n* command completion races with removing a device\n* command completion races with closing a sg fd\n* can rmmod sg with active commands\n\nThese problems can cause kernel oopses, memory-use-after-free, or\ndouble-free errors.  This patch fixes these problems by using krefs\nto manage the lifetime of sg_device and sg_fd.\n\nEach command submitted to the midlevel holds a reference to sg_fd\nuntil the completion callback.  This ensures that sg_fd doesn\u0027t go\naway if the fd is closed with commands still outstanding.\n\nsg_fd gets the reference of sg_device (with scsi_device) and also\nmakes sure that the sg module doesn\u0027t go away.\n\n/proc/scsi/sg/* functions don\u0027t play nicely with krefs because they\ngive information about sg_fds which have been closed but not yet\nfreed due to still having outstanding commands and sg_devices which\nhave been removed but not yet freed due to still being referenced\nby one or more sg_fds.  To deal with this safely without removing\nfunctionality, /proc functions now access sg_device and sg_fd while\nholding a lock instead of using kref_get()/kref_put().\n\nSigned-off-by: Tony Battersby \u003ctonyb@cybernetics.com\u003e\nAcked-by: Douglas Gilbert \u003cdgilbert@interlog.com\u003e\nSigned-off-by: James Bottomley \u003cJames.Bottomley@HansenPartnership.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "516925d8b570c3fab05d5d1b0a6b729e0ebce395",
      "old_mode": 33188,
      "old_path": "drivers/scsi/sg.c",
      "new_id": "b447527555a70c438a1c5c5d9c123bbed6067c7a",
      "new_mode": 33188,
      "new_path": "drivers/scsi/sg.c"
    }
  ]
}
