Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] nvme: fix racy access to FDP placement ID array
@ 2026-07-25 13:51 Hari Mishal
  2026-07-25 13:51 ` [PATCH 1/2] " Hari Mishal
  2026-07-25 13:51 ` [PATCH 2/2] nvme: drop WARN_ON_ONCE on write_stream bounds check Hari Mishal
  0 siblings, 2 replies; 13+ messages in thread
From: Hari Mishal @ 2026-07-25 13:51 UTC (permalink / raw)
  To: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg
  Cc: Hannes Reinecke, Kanchan Joshi, Nitesh Shetty, Greg Kroah-Hartman,
	linux-nvme, linux-kernel, Hari Mishal

nvme_ns_head can be shared across multiple nvme_ns paths (multipath,
or dual-port/multi-controller subsystems). nvme_query_fdp_info()
populates head->nr_plids/head->plids the first time a namespace's
FDP configuration is registered, but nothing protects that pair from
concurrent access - two paths scanning the same namespace at the
same time can race to populate it, and depending on how the writes
interleave a concurrent reader can hit a NULL dereference or an
out-of-bounds read.

Patch 1 adds a spinlock and closes the race.

Patch 2 is a small, unrelated cleanup on code sitting right next to
what patch 1 touches: it drops a WARN_ON_ONCE that turns out to be
unreachable through any current path, since the value it guards
against is already validated upstream in the block layer and F2FS
before a bio ever carries it. Happy to drop this one or send it
separately if you'd rather keep it out of this series.

Hari Mishal (2):
  nvme: fix racy access to FDP placement ID array
  nvme: drop WARN_ON_ONCE on write_stream bounds check

 drivers/nvme/host/core.c | 63 ++++++++++++++++++++++++++--------------
 drivers/nvme/host/nvme.h |  1 +
 2 files changed, 43 insertions(+), 21 deletions(-)

-- 
2.43.0



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

end of thread, other threads:[~2026-07-28 10:34 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-25 13:51 [PATCH 0/2] nvme: fix racy access to FDP placement ID array Hari Mishal
2026-07-25 13:51 ` [PATCH 1/2] " Hari Mishal
2026-07-27 13:31   ` Kanchan Joshi
2026-07-27 14:22     ` Kanchan Joshi
2026-07-25 13:51 ` [PATCH 2/2] nvme: drop WARN_ON_ONCE on write_stream bounds check Hari Mishal
2026-07-27 14:24   ` Keith Busch
2026-07-27 19:19     ` Greg Kroah-Hartman
2026-07-27 22:51       ` Keith Busch
2026-07-28  5:15         ` Greg Kroah-Hartman
2026-07-28  5:18           ` Christoph Hellwig
2026-07-28  6:58             ` Greg Kroah-Hartman
2026-07-28  9:46               ` Keith Busch
2026-07-28 10:34                 ` Greg Kroah-Hartman

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