From: Chaohai Chen <wdhh6@aliyun.com>
To: Jason Yan <yanaijie@huawei.com>
Cc: john.g.garry@oracle.com, James.Bottomley@hansenpartnership.com,
martin.petersen@oracle.com, dlemoal@kernel.org,
johannes.thumshirn@wdc.com, mingo@kernel.org, cassel@kernel.org,
tglx@kernel.org, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scsi: libsas: Fix dev_list race conditions with proper locking
Date: Sat, 31 Jan 2026 18:47:02 +0800 [thread overview]
Message-ID: <aX3dpqtLmgNVaQEg@LAPTOP-RK2E6KJ3.localdomain> (raw)
In-Reply-To: <e59ff23b-81d3-41b7-ac25-ab886a3379bf@huawei.com>
On Fri, Jan 30, 2026 at 04:27:11PM +0800, Jason Yan wrote:
> Hi,
>
> 在 2026/1/29 17:38, Chaohai Chen 写道:
> > Multiple functions in libsas were accessing port->dev_list without
> > proper locking, leading to potential race conditions that could cause:
> > - Use-after-free when devices are removed during list traversal
> > - List corruption from concurrent modifications
> > - System crashes from accessing freed memory
>
> libsas events are processed in orderd workqueue. Do you have a crash log?
No crash log. I noticed the missing locks while watching the code. But
there are tow queues, event_q and disco_q which may cause conflicts.
And I think the dev_ist_lock is designed to prevent conflicts.
>
> Thanks,
> 祝一切顺利
--
Chaohai Chen
next prev parent reply other threads:[~2026-01-31 10:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-29 9:38 [PATCH] scsi: libsas: Fix dev_list race conditions with proper locking Chaohai Chen
2026-01-30 3:02 ` Damien Le Moal
2026-01-31 11:19 ` Chaohai Chen
2026-02-02 1:21 ` Damien Le Moal
2026-02-02 7:36 ` Chaohai Chen
2026-02-02 7:45 ` Damien Le Moal
2026-02-02 9:03 ` Jason Yan
2026-01-30 8:27 ` Jason Yan
2026-01-31 10:47 ` Chaohai Chen [this message]
2026-02-02 1:46 ` Damien Le Moal
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=aX3dpqtLmgNVaQEg@LAPTOP-RK2E6KJ3.localdomain \
--to=wdhh6@aliyun.com \
--cc=James.Bottomley@hansenpartnership.com \
--cc=cassel@kernel.org \
--cc=dlemoal@kernel.org \
--cc=johannes.thumshirn@wdc.com \
--cc=john.g.garry@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mingo@kernel.org \
--cc=tglx@kernel.org \
--cc=yanaijie@huawei.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox