diff options
| author | Linmao Li <lilinmao@kylinos.cn> | 2026-08-14 11:38:45 +0800 |
|---|---|---|
| committer | Martin K. Petersen (Oracle) <mkp@kernel.org> | 2026-08-23 21:51:43 -0400 |
| commit | 00b7c8d4ce441aa9ac704840332ba4738e1c6d51 (patch) | |
| tree | 3100d2c2cee9c8aee16d16cef14308c7e2d91bc2 /tools/perf/scripts/python | |
| parent | 970f69b6bf71562df5afcefb89c77b4e971d68de (diff) | |
| download | linux-next-00b7c8d4ce441aa9ac704840332ba4738e1c6d51.tar.gz linux-next-00b7c8d4ce441aa9ac704840332ba4738e1c6d51.zip | |
scsi: leapraid: Serialize firmware log mmap with teardown
leapraid_fw_log_exit() waits for mmap_refcnt to reach zero before it frees
the firmware log buffer. leapraid_fw_mmap() checks host_removing, but it
does not increment mmap_refcnt until after dma_mmap_coherent() succeeds and
the VMA open callback runs.
Removal can set host_removing and observe a zero mmap_refcnt between the
check and the VMA open. It can then free the coherent buffer while the
mmap path is still establishing a userspace mapping of it.
Claim a temporary mmap reference while looking up the adapter under
leapraid_adapter_lock. Removal deletes the adapter from the same locked
list after setting host_removing, so a mapping is either rejected or
included in the count that removal waits for. Drop the temporary reference
on the common exit path, after a successful VMA open has acquired the
reference covering the VMA lifetime.
Fixes: 5597088c9e79 ("scsi: leapraid: Add new SCSI driver")
Signed-off-by: Linmao Li <lilinmao@kylinos.cn>
Reviewed-by: Dongdong Hao <doubled@leap-io-kernel.com>
Link: https://patch.msgid.link/20260814033845.2971706-3-lilinmao@kylinos.cn
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
