Commit 56fce58
Ewan D. Milne
scsi: sg: Avoid sg device teardown race
JIRA: https://issues.redhat.com/browse/RHEL-35659
Upstream Status: From upstream linux mainline
sg_remove_sfp_usercontext() must not use sg_device_destroy() after calling
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.
The resulting NULL pointer exception will then crash the kernel.
Link: https://lore.kernel.org/r/20240305150509.23896-1-Alexander@wetzel-home.de
Fixes: db59133 ("scsi: sg: fix blktrace debugfs entries leakage")
Cc: stable@vger.kernel.org
Signed-off-by: Alexander Wetzel <Alexander@wetzel-home.de>
Link: https://lore.kernel.org/r/20240320213032.18221-1-Alexander@wetzel-home.de
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 27f58c0)
Signed-off-by: Ewan D. Milne <emilne@redhat.com>1 parent 3681c87 commit 56fce58
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2185 | 2185 | | |
2186 | 2186 | | |
2187 | 2187 | | |
| 2188 | + | |
2188 | 2189 | | |
2189 | 2190 | | |
2190 | 2191 | | |
| |||
2210 | 2211 | | |
2211 | 2212 | | |
2212 | 2213 | | |
2213 | | - | |
| 2214 | + | |
2214 | 2215 | | |
| 2216 | + | |
2215 | 2217 | | |
2216 | 2218 | | |
2217 | 2219 | | |
| |||
0 commit comments