Re: [PATCH] SCSI: Fix 'Poison overwritten' warning caused by using freed 'shost'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 12 Feb 2012, Huajun Li wrote:

> In do_scan_async(), calling scsi_autopm_put_host(shost) may reference
> freed shost, and cause Posison overwitten warning.
> Yes, this case can happen, for example, an USB is disconnected just
> when do_scan_async() thread starts to run, then scsi_host_put() called
> in scsi_finish_async_scan() will lead to shost be freed(because the
> refcount of shost->shost_gendev decreases to 1 after USB disconnects),
> at this point, if references shost again, system will show following
> warning msg.
> 
> To make scsi_autopm_put_host(shost) always reference a valid shost,
> put it just before scsi_host_put() in function
> scsi_finish_async_scan().

Good catch!

Acked-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux