Re: [PATCH v3] scsi: sg: Avoid race in error handling & drop bogus warn

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

 




> On 2 Apr 2024, at 12:40 AM, Alexander Wetzel <Alexander@xxxxxxxxxxxxxx> wrote:
> 
> commit 27f58c04a8f4 ("scsi: sg: Avoid sg device teardown race")
> introduced an incorrect WARN_ON_ONCE() and missed a sequence where
> sg_device_destroy() was used after scsi_device_put().
> 
> sg_device_destroy() is accessing the parent scsi_device request_queue which
> will already be set to NULL when the preceding call to scsi_device_put()
> removed the last reference to the parent scsi_device.
> 
> Drop the incorrect WARN_ON_ONCE() - allowing more than one concurrent
> access to the sg device - and make sure sg_device_destroy() is not used
> after scsi_device_put() in the error handling.
> 
> Link: https://lore.kernel.org/all/5375B275-D137-4D5F-BE25-6AF8ACAE41EF@xxxxxxxxxxxxx
> Fixes: 27f58c04a8f4 ("scsi: sg: Avoid sg device teardown race")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Alexander Wetzel <Alexander@xxxxxxxxxxxxxx>
> ---

Thanks for the fix. I tested this patch and confirm it fixes the reported problem.

Tested-by: Sachin Sant <sachinp@xxxxxxxxxxxxx>


— Sachin





[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux