All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Sachin Sant <sachinp@linux.ibm.com>
To: Alexander Wetzel <Alexander@wetzel-home.de>
Cc: dgilbert@interlog.com, gregkh@linuxfoundation.org,
	Bart Van Assche <bvanassche@acm.org>,
	linux-scsi@vger.kernel.org,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH v3] scsi: sg: Avoid race in error handling & drop bogus warn
Date: Tue, 2 Apr 2024 11:31:29 +0530	[thread overview]
Message-ID: <3FD93D06-41E6-4026-BCD9-574A724F18CD@linux.ibm.com> (raw)
In-Reply-To: <20240401191038.18359-1-Alexander@wetzel-home.de>



> On 2 Apr 2024, at 12:40 AM, Alexander Wetzel <Alexander@wetzel-home.de> 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@linux.ibm.com
> Fixes: 27f58c04a8f4 ("scsi: sg: Avoid sg device teardown race")
> Cc: stable@vger.kernel.org
> Signed-off-by: Alexander Wetzel <Alexander@wetzel-home.de>
> ---

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

Tested-by: Sachin Sant <sachinp@linux.ibm.com>


— Sachin

WARNING: multiple messages have this Message-ID (diff)
From: Sachin Sant <sachinp@linux.ibm.com>
To: Alexander Wetzel <Alexander@wetzel-home.de>
Cc: Bart Van Assche <bvanassche@acm.org>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	gregkh@linuxfoundation.org, dgilbert@interlog.com,
	stable@vger.kernel.org, linux-scsi@vger.kernel.org,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH v3] scsi: sg: Avoid race in error handling & drop bogus warn
Date: Tue, 2 Apr 2024 11:31:29 +0530	[thread overview]
Message-ID: <3FD93D06-41E6-4026-BCD9-574A724F18CD@linux.ibm.com> (raw)
In-Reply-To: <20240401191038.18359-1-Alexander@wetzel-home.de>



> On 2 Apr 2024, at 12:40 AM, Alexander Wetzel <Alexander@wetzel-home.de> 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@linux.ibm.com
> Fixes: 27f58c04a8f4 ("scsi: sg: Avoid sg device teardown race")
> Cc: stable@vger.kernel.org
> Signed-off-by: Alexander Wetzel <Alexander@wetzel-home.de>
> ---

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

Tested-by: Sachin Sant <sachinp@linux.ibm.com>


— Sachin

  reply	other threads:[~2024-04-02  6:02 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-29  9:08 [powerpc] WARN at drivers/scsi/sg.c:2236 (sg_remove_sfp_usercontext) Sachin Sant
2024-03-29  9:08 ` Sachin Sant
2024-03-29 11:10 ` Alexander Wetzel
2024-03-29 11:10   ` Alexander Wetzel
2024-03-29 14:37   ` Sachin Sant
2024-04-01  9:56     ` [PATCH] scsi: sg: Avoid race in error handling & drop bogus warn Alexander Wetzel
2024-04-01  9:56       ` Alexander Wetzel
2024-04-01 10:03     ` [PATCH v2] " Alexander Wetzel
2024-04-01 10:03       ` Alexander Wetzel
2024-04-01 17:09       ` Bart Van Assche
2024-04-01 17:09         ` Bart Van Assche
2024-04-01 19:01         ` Alexander Wetzel
2024-04-01 19:01           ` Alexander Wetzel
2024-04-01 19:10     ` [PATCH v3] " Alexander Wetzel
2024-04-01 19:10       ` Alexander Wetzel
2024-04-02  6:01       ` Sachin Sant [this message]
2024-04-02  6:01         ` Sachin Sant
2024-04-03 23:24       ` Bart Van Assche
2024-04-03 23:24         ` Bart Van Assche
2024-04-04  6:55         ` Alexander Wetzel
2024-04-04  6:55           ` Alexander Wetzel
2024-04-04 16:34       ` Bart Van Assche
2024-04-04 16:34         ` Bart Van Assche
2024-04-04 22:22       ` Martin K. Petersen
2024-04-04 22:22         ` Martin K. Petersen
2024-04-06  1:58       ` Martin K. Petersen
2024-04-06  1:58         ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3FD93D06-41E6-4026-BCD9-574A724F18CD@linux.ibm.com \
    --to=sachinp@linux.ibm.com \
    --cc=Alexander@wetzel-home.de \
    --cc=bvanassche@acm.org \
    --cc=dgilbert@interlog.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=martin.petersen@oracle.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.