<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/nvme/target, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-04-02T11:25:21+00:00</updated>
<entry>
<title>nvmet: move async event work off nvmet-wq</title>
<updated>2026-04-02T11:25:21+00:00</updated>
<author>
<name>Chaitanya Kulkarni</name>
<email>kch@nvidia.com</email>
</author>
<published>2026-02-26T04:30:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=25ceffc1dabec3b93f458b437aae26f4da293f87'/>
<id>urn:sha1:25ceffc1dabec3b93f458b437aae26f4da293f87</id>
<content type='text'>
[ Upstream commit 2922e3507f6d5caa7f1d07f145e186fc6f317a4e ]

For target nvmet_ctrl_free() flushes ctrl-&gt;async_event_work.
If nvmet_ctrl_free() runs on nvmet-wq, the flush re-enters workqueue
completion for the same worker:-

A. Async event work queued on nvmet-wq (prior to disconnect):
  nvmet_execute_async_event()
     queue_work(nvmet_wq, &amp;ctrl-&gt;async_event_work)

  nvmet_add_async_event()
     queue_work(nvmet_wq, &amp;ctrl-&gt;async_event_work)

B. Full pre-work chain (RDMA CM path):
  nvmet_rdma_cm_handler()
     nvmet_rdma_queue_disconnect()
       __nvmet_rdma_queue_disconnect()
         queue_work(nvmet_wq, &amp;queue-&gt;release_work)
           process_one_work()
             lock((wq_completion)nvmet-wq)  &lt;--------- 1st
             nvmet_rdma_release_queue_work()

C. Recursive path (same worker):
  nvmet_rdma_release_queue_work()
     nvmet_rdma_free_queue()
       nvmet_sq_destroy()
         nvmet_ctrl_put()
           nvmet_ctrl_free()
             flush_work(&amp;ctrl-&gt;async_event_work)
               __flush_work()
                 touch_wq_lockdep_map()
                 lock((wq_completion)nvmet-wq) &lt;--------- 2nd

Lockdep splat:

  ============================================
  WARNING: possible recursive locking detected
  6.19.0-rc3nvme+ #14 Tainted: G                 N
  --------------------------------------------
  kworker/u192:42/44933 is trying to acquire lock:
  ffff888118a00948 ((wq_completion)nvmet-wq){+.+.}-{0:0}, at: touch_wq_lockdep_map+0x26/0x90

  but task is already holding lock:
  ffff888118a00948 ((wq_completion)nvmet-wq){+.+.}-{0:0}, at: process_one_work+0x53e/0x660

  3 locks held by kworker/u192:42/44933:
   #0: ffff888118a00948 ((wq_completion)nvmet-wq){+.+.}-{0:0}, at: process_one_work+0x53e/0x660
   #1: ffffc9000e6cbe28 ((work_completion)(&amp;queue-&gt;release_work)){+.+.}-{0:0}, at: process_one_work+0x1c5/0x660
   #2: ffffffff82d4db60 (rcu_read_lock){....}-{1:3}, at: __flush_work+0x62/0x530

  Workqueue: nvmet-wq nvmet_rdma_release_queue_work [nvmet_rdma]
  Call Trace:
   __flush_work+0x268/0x530
   nvmet_ctrl_free+0x140/0x310 [nvmet]
   nvmet_cq_put+0x74/0x90 [nvmet]
   nvmet_rdma_free_queue+0x23/0xe0 [nvmet_rdma]
   nvmet_rdma_release_queue_work+0x19/0x50 [nvmet_rdma]
   process_one_work+0x206/0x660
   worker_thread+0x184/0x320
   kthread+0x10c/0x240
   ret_from_fork+0x319/0x390

Move async event work to a dedicated nvmet-aen-wq to avoid reentrant
flush on nvmet-wq.

Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Chaitanya Kulkarni &lt;kch@nvidia.com&gt;
Signed-off-by: Keith Busch &lt;kbusch@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>nvmet-fcloop: Check remoteport port_state before calling done callback</title>
<updated>2026-03-12T11:09:44+00:00</updated>
<author>
<name>Justin Tee</name>
<email>justintee8345@gmail.com</email>
</author>
<published>2025-12-04T20:26:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=31d3817bcd9e192b30abe3cf4b68f69d48864dd2'/>
<id>urn:sha1:31d3817bcd9e192b30abe3cf4b68f69d48864dd2</id>
<content type='text'>
[ Upstream commit dd677d0598387ea623820ab2bd0e029c377445a3 ]

In nvme_fc_handle_ls_rqst_work, the lsrsp-&gt;done callback is only set when
remoteport-&gt;port_state is FC_OBJSTATE_ONLINE.  Otherwise, the
nvme_fc_xmt_ls_rsp's LLDD call to lport-&gt;ops-&gt;xmt_ls_rsp is expected to
fail and the nvme-fc transport layer itself will directly call
nvme_fc_xmt_ls_rsp_free instead of relying on LLDD's done callback to free
the lsrsp resources.

Update the fcloop_t2h_xmt_ls_rsp routine to check remoteport-&gt;port_state.
If online, then lsrsp-&gt;done callback will free the lsrsp.  Else, return
-ENODEV to signal the nvme-fc transport to handle freeing lsrsp.

Cc: Ewan D. Milne &lt;emilne@redhat.com&gt;
Tested-by: Aristeu Rozanski &lt;aris@redhat.com&gt;
Acked-by: Aristeu Rozanski &lt;aris@redhat.com&gt;
Reviewed-by: Daniel Wagner &lt;dwagner@suse.de&gt;
Closes: https://lore.kernel.org/linux-nvme/21255200-a271-4fa0-b099-97755c8acd4c@work/
Fixes: 10c165af35d2 ("nvmet-fcloop: call done callback even when remote port is gone")
Signed-off-by: Justin Tee &lt;justintee8345@gmail.com&gt;
Signed-off-by: Keith Busch &lt;kbusch@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>nvmet-tcp: add bounds checks in nvmet_tcp_build_pdu_iovec</title>
<updated>2026-02-05T15:29:10+00:00</updated>
<author>
<name>YunJe Shin</name>
<email>yjshin0438@gmail.com</email>
</author>
<published>2026-01-28T00:41:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=52a0a98549344ca20ad81a4176d68d28e3c05a5c'/>
<id>urn:sha1:52a0a98549344ca20ad81a4176d68d28e3c05a5c</id>
<content type='text'>
nvmet_tcp_build_pdu_iovec() could walk past cmd-&gt;req.sg when a PDU
length or offset exceeds sg_cnt and then use bogus sg-&gt;length/offset
values, leading to _copy_to_iter() GPF/KASAN. Guard sg_idx, remaining
entries, and sg-&gt;length/offset before building the bvec.

Fixes: 872d26a391da ("nvmet-tcp: add NVMe over TCP target driver")
Signed-off-by: YunJe Shin &lt;ioerts@kookmin.ac.kr&gt;
Reviewed-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Reviewed-by: Joonkyo Jung &lt;joonkyoj@yonsei.ac.kr&gt;
Signed-off-by: Keith Busch &lt;kbusch@kernel.org&gt;
</content>
</entry>
<entry>
<title>nvmet: fix race in nvmet_bio_done() leading to NULL pointer dereference</title>
<updated>2026-01-21T15:21:19+00:00</updated>
<author>
<name>Ming Lei</name>
<email>ming.lei@redhat.com</email>
</author>
<published>2026-01-21T09:38:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0fcee2cfc4b2e16e62ff8e0cc2cd8dd24efad65e'/>
<id>urn:sha1:0fcee2cfc4b2e16e62ff8e0cc2cd8dd24efad65e</id>
<content type='text'>
There is a race condition in nvmet_bio_done() that can cause a NULL
pointer dereference in blk_cgroup_bio_start():

1. nvmet_bio_done() is called when a bio completes
2. nvmet_req_complete() is called, which invokes req-&gt;ops-&gt;queue_response(req)
3. The queue_response callback can re-queue and re-submit the same request
4. The re-submission reuses the same inline_bio from nvmet_req
5. Meanwhile, nvmet_req_bio_put() (called after nvmet_req_complete)
   invokes bio_uninit() for inline_bio, which sets bio-&gt;bi_blkg to NULL
6. The re-submitted bio enters submit_bio_noacct_nocheck()
7. blk_cgroup_bio_start() dereferences bio-&gt;bi_blkg, causing a crash:

  BUG: kernel NULL pointer dereference, address: 0000000000000028
  #PF: supervisor read access in kernel mode
  RIP: 0010:blk_cgroup_bio_start+0x10/0xd0
  Call Trace:
   submit_bio_noacct_nocheck+0x44/0x250
   nvmet_bdev_execute_rw+0x254/0x370 [nvmet]
   process_one_work+0x193/0x3c0
   worker_thread+0x281/0x3a0

Fix this by reordering nvmet_bio_done() to call nvmet_req_bio_put()
BEFORE nvmet_req_complete(). This ensures the bio is cleaned up before
the request can be re-submitted, preventing the race condition.

Fixes: 190f4c2c863a ("nvmet: fix memory leak of bio integrity")
Cc: Dmitry Bogdanov &lt;d.bogdanov@yadro.com&gt;
Cc: stable@vger.kernel.org
Cc: Guangwu Zhang &lt;guazhang@redhat.com&gt;
Link: http://www.mail-archive.com/debian-kernel@lists.debian.org/msg146238.html
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Ming Lei &lt;ming.lei@redhat.com&gt;
Signed-off-by: Keith Busch &lt;kbusch@kernel.org&gt;
</content>
</entry>
<entry>
<title>nvmet: do not copy beyond sybsysnqn string length</title>
<updated>2026-01-13T21:50:29+00:00</updated>
<author>
<name>Shin'ichiro Kawasaki</name>
<email>shinichiro.kawasaki@wdc.com</email>
</author>
<published>2025-12-21T07:37:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=84164acba33158208c2b0e8e5607bdd43edc0dd4'/>
<id>urn:sha1:84164acba33158208c2b0e8e5607bdd43edc0dd4</id>
<content type='text'>
Commit edd17206e363 ("nvmet: remove redundant subsysnqn field from
ctrl") replaced ctrl-&gt;subsysnqn with ctrl-&gt;subsys-&gt;subsysnqn. This
change works as expected because both point to strings with the same
data. However, their memory allocation lengths differ. ctrl-&gt;subsysnqn
had the fixed size defined as NVMF_NQN_FILED_LEN, while
ctrl-&gt;subsys-&gt;subsysnqn has variable length determined by kstrndup().
Due to this difference, KASAN slab-out-of-bounds occurs at memcpy() in
nvmet_passthru_override_id_ctrl() after the commit. The failure can be
recreated by running the blktests test case nvme/033. To prevent such
failures, replace memcpy() with strscpy(), which copies only the string
length and avoids overruns.

Fixes: edd17206e363 ("nvmet: remove redundant subsysnqn field from ctrl")
Signed-off-by: Shin'ichiro Kawasaki &lt;shinichiro.kawasaki@wdc.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Reviewed-by: Chaitanya Kulkarni &lt;kch@nvidia.com&gt;
Signed-off-by: Keith Busch &lt;kbusch@kernel.org&gt;
</content>
</entry>
<entry>
<title>nvmet-tcp: fixup hang in nvmet_tcp_listen_data_ready()</title>
<updated>2026-01-13T15:29:46+00:00</updated>
<author>
<name>Hannes Reinecke</name>
<email>hare@kernel.org</email>
</author>
<published>2025-08-18T09:32:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2fa8961d3a6a1c2395d8d560ffed2c782681bade'/>
<id>urn:sha1:2fa8961d3a6a1c2395d8d560ffed2c782681bade</id>
<content type='text'>
When the socket is closed while in TCP_LISTEN a callback is run to
flush all outstanding packets, which in turns calls
nvmet_tcp_listen_data_ready() with the sk_callback_lock held.
So we need to check if we are in TCP_LISTEN before attempting
to get the sk_callback_lock() to avoid a deadlock.

Link: https://lore.kernel.org/linux-nvme/CAHj4cs-zu7eVB78yUpFjVe2UqMWFkLk8p+DaS3qj+uiGCXBAoA@mail.gmail.com/
Tested-by:  Yi Zhang &lt;yi.zhang@redhat.com&gt;
Reviewed-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Signed-off-by: Hannes Reinecke &lt;hare@kernel.org&gt;
Signed-off-by: Keith Busch &lt;kbusch@kernel.org&gt;
</content>
</entry>
<entry>
<title>nvme-tcp: fix NULL pointer dereferences in nvmet_tcp_build_pdu_iovec</title>
<updated>2026-01-09T14:47:03+00:00</updated>
<author>
<name>Shivam Kumar</name>
<email>kumar.shivam43666@gmail.com</email>
</author>
<published>2025-12-13T18:57:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=32b63acd78f577b332d976aa06b56e70d054cbba'/>
<id>urn:sha1:32b63acd78f577b332d976aa06b56e70d054cbba</id>
<content type='text'>
Commit efa56305908b ("nvmet-tcp: Fix a kernel panic when host sends an invalid H2C PDU length")
added ttag bounds checking and data_offset
validation in nvmet_tcp_handle_h2c_data_pdu(), but it did not validate
whether the command's data structures (cmd-&gt;req.sg and cmd-&gt;iov) have
been properly initialized before processing H2C_DATA PDUs.

The nvmet_tcp_build_pdu_iovec() function dereferences these pointers
without NULL checks. This can be triggered by sending H2C_DATA PDU
immediately after the ICREQ/ICRESP handshake, before
sending a CONNECT command or NVMe write command.

Attack vectors that trigger NULL pointer dereferences:
1. H2C_DATA PDU sent before CONNECT → both pointers NULL
2. H2C_DATA PDU for READ command → cmd-&gt;req.sg allocated, cmd-&gt;iov NULL
3. H2C_DATA PDU for uninitialized command slot → both pointers NULL

The fix validates both cmd-&gt;req.sg and cmd-&gt;iov before calling
nvmet_tcp_build_pdu_iovec(). Both checks are required because:
- Uninitialized commands: both NULL
- READ commands: cmd-&gt;req.sg allocated, cmd-&gt;iov NULL
- WRITE commands: both allocated

Fixes: efa56305908b ("nvmet-tcp: Fix a kernel panic when host sends an invalid H2C PDU length")
Reviewed-by: Sagi Grimberg &lt;sagi@grimberg.me&gt;
Signed-off-by: Shivam Kumar &lt;kumar.shivam43666@gmail.com&gt;
Signed-off-by: Keith Busch &lt;kbusch@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'nvme-6.19-2025-12-04' of git://git.infradead.org/nvme into block-6.19</title>
<updated>2025-12-05T03:58:19+00:00</updated>
<author>
<name>Jens Axboe</name>
<email>axboe@kernel.dk</email>
</author>
<published>2025-12-05T03:58:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0f45353dd48037af61f70df3468d25ca46afe909'/>
<id>urn:sha1:0f45353dd48037af61f70df3468d25ca46afe909</id>
<content type='text'>
Pull NVMe updates from Keith:

"- Subsystem usage cleanups (Max)
 - Endpoint device fixes (Shin'ichiro)
 - Debug statements (Gerd)
 - FC fabrics cleanups and fixes (Daniel)
 - Consistent alloc API usages (Israel)
 - Code comment updates (Chu)
 - Authentication retry fix (Justin)"

* tag 'nvme-6.19-2025-12-04' of git://git.infradead.org/nvme:
  nvme-fabrics: add ENOKEY to no retry criteria for authentication failures
  nvme-auth: use kvfree() for memory allocated with kvcalloc()
  nvmet-tcp: use kvcalloc for commands array
  nvmet-rdma: use kvcalloc for commands and responses arrays
  nvme: fix typo error in nvme target
  nvmet-fc: use pr_* print macros instead of dev_*
  nvmet-fcloop: remove unused lsdir member.
  nvmet-fcloop: check all request and response have been processed
  nvme-fc: check all request and response have been processed
  nvme-fc: don't hold rport lock when putting ctrl
  nvme-pci: add debug message on fail to read CSTS
  nvme-pci: print error message on failure in nvme_probe
  nvmet: pci-epf: fix DMA channel debug print
  nvmet: pci-epf: move DMA initialization to EPC init callback
  nvmet: remove redundant subsysnqn field from ctrl
  nvmet: add sanity checks when freeing subsystem
</content>
</entry>
<entry>
<title>nvmet-tcp: use kvcalloc for commands array</title>
<updated>2025-12-04T22:46:16+00:00</updated>
<author>
<name>Israel Rukshin</name>
<email>israelr@nvidia.com</email>
</author>
<published>2025-11-24T06:49:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5c8d134f01556affce430a25e1551d78d45ebc9d'/>
<id>urn:sha1:5c8d134f01556affce430a25e1551d78d45ebc9d</id>
<content type='text'>
Replace kcalloc with kvcalloc for allocation of the commands
array. Each command structure is 712 bytes. The array typically
exceeds a single page, and grows much larger with high queue depths
(e.g., commands &gt;182KB).

kvcalloc automatically falls back to vmalloc for large or fragmented
allocations, improving reliability. In our case, this memory is not
aimed for DMA operations and could be safely allocated by kvcalloc.
Using virtually contiguous memory helps to avoid allocation failures
and out-of-memory conditions common with kcalloc on large pools.

Signed-off-by: Israel Rukshin &lt;israelr@nvidia.com&gt;
Reviewed-by: Max Gurtovoy &lt;mgurtovoy@nvidia.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Keith Busch &lt;kbusch@kernel.org&gt;
</content>
</entry>
<entry>
<title>nvmet-rdma: use kvcalloc for commands and responses arrays</title>
<updated>2025-12-04T22:46:16+00:00</updated>
<author>
<name>Israel Rukshin</name>
<email>israelr@nvidia.com</email>
</author>
<published>2025-11-24T06:49:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ce234d838d3b0566bcbf3fd13b546f176564ca07'/>
<id>urn:sha1:ce234d838d3b0566bcbf3fd13b546f176564ca07</id>
<content type='text'>
Replace kcalloc with kvcalloc for allocation of the commands and
responses arrays. Each command structure is 272 bytes and each
response structure is 672 bytes. These arrays typically exceed a
single page, and grow much larger with high queue depths
(e.g., commands &gt;2MB, responses &gt;170KB)

kvcalloc automatically falls back to vmalloc for large or fragmented
allocations, improving reliability. In our case, this memory is not
aimed for DMA operations and could be safely allocated by kvcalloc.
Using virtually contiguous memory helps to avoid allocation failures
and out-of-memory conditions common with kcalloc on large pools.

Signed-off-by: Israel Rukshin &lt;israelr@nvidia.com&gt;
Reviewed-by: Max Gurtovoy &lt;mgurtovoy@nvidia.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Keith Busch &lt;kbusch@kernel.org&gt;
</content>
</entry>
</feed>
