mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] scsi: leapraid: fix firmware log mmap lifetime
@ 2026-08-11 11:19 Linmao Li
  2026-08-11 11:20 ` [PATCH 1/2] scsi: leapraid: balance host references for firmware log VMAs Linmao Li
  2026-08-11 11:20 ` [PATCH 2/2] scsi: leapraid: serialize firmware log mmap with teardown Linmao Li
  0 siblings, 2 replies; 4+ messages in thread
From: Linmao Li @ 2026-08-11 11:19 UTC (permalink / raw)
  To: doubled, James.Bottomley, martin.petersen, linux-scsi
  Cc: hare, dlemoal, linux-kernel, Linmao Li

The firmware log mmap path has two related lifetime issues.  VMA clones
drop Scsi_Host references that they never acquired, and device removal
can free the coherent log buffer while mmap is still setting up a VMA.

Patch 1 gives each VMA its own host device reference.  Patch 2 claims a
temporary mmap activity reference under the adapter-list lock so teardown
cannot miss an in-progress mapping.

Patch 2 depends on patch 1: patch 1 keeps adapter non-NULL on the
successful mmap path, allowing patch 2 to drop the temporary mmap
reference at out_put.  Applied alone, patch 2 would leak that reference
and make teardown wait indefinitely.

Neither patch has been tested on hardware; both are derived from the
reference counting and locking in the code.

Linmao Li (2):
  scsi: leapraid: balance host references for firmware log VMAs
  scsi: leapraid: serialize firmware log mmap with teardown

 drivers/scsi/leapraid/leapraid_app.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)


base-commit: 376a3960e5efe85ff765abfb5b5b7e4655ad6aed
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-13  7:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-11 11:19 [PATCH 0/2] scsi: leapraid: fix firmware log mmap lifetime Linmao Li
2026-08-11 11:20 ` [PATCH 1/2] scsi: leapraid: balance host references for firmware log VMAs Linmao Li
2026-08-11 11:20 ` [PATCH 2/2] scsi: leapraid: serialize firmware log mmap with teardown Linmao Li
2026-08-13  6:36   ` Hao Dongdong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®