Re: [PATCH 10/31] Avoid that scsi_exit_rq() triggers a use-after-free

2017-05-23 Thread Hannes Reinecke
On 05/24/2017 02:33 AM, Bart Van Assche wrote: > Dereferencing shost from scsi_exit_rq() is not safe because the > SCSI host may already have been freed when scsi_exit_rq() is > called. Increasing the shost reference count in scsi_init_rq() > and dropping that reference in scsi_exit_rq() is nontriv

[PATCH 10/31] Avoid that scsi_exit_rq() triggers a use-after-free

2017-05-23 Thread Bart Van Assche
Dereferencing shost from scsi_exit_rq() is not safe because the SCSI host may already have been freed when scsi_exit_rq() is called. Increasing the shost reference count in scsi_init_rq() and dropping that reference in scsi_exit_rq() is nontrivial since scsi_host_dev_release() may sleep and since s