[PATCHv2] nvme: authentication error are always non-retryable

Hannes Reinecke hare at suse.de
Mon Feb 26 02:54:13 PST 2024


On 2/26/24 11:36, Daniel Wagner wrote:
> On Mon, Feb 26, 2024 at 11:24:35AM +0100, Daniel Wagner wrote:
>> On Mon, Feb 26, 2024 at 09:06:28AM +0100, Hannes Reinecke wrote:
>>> Any authentication errors which are generated internally are always
>>> non-retryable, so set the DNR bit to ensure they are not retried.
>>>
>>> Signed-off-by: Hannes Reinecke <hare at suse.de>
>>
>> Tested-by: Daniel Wagner <dwagner at suse.de>
> 
> Well, I called it success too early.
> 
> Now other tests are starting to fail, e.g. nvme/044 for loop and fc is
> looping now:
> 
> loop:
> [   67.481520] nvmet: ctrl 1 fatal error occurred!
> [   67.484296] nvme nvme0: qid 0: authentication failed, error -111
> [   67.531033] [1538] nvmet: ctrl 1 stop keep-alive
> [   67.532903] ==================================================================
> [   67.534283] BUG: KASAN: double-free in nvme_loop_create_ctrl+0x87c/0xbe0 [nvme_loop]
> [   67.535591] Free of addr ffff888101b1c000 by task nvme/1538
> 
> [   67.536454] CPU: 0 PID: 1538 Comm: nvme Tainted: G        W          6.8.0-rc3+ #39 3d0b6128d1ea3c6026a2c1de70ba6c7dc10623c3
> [   67.538326] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS unknown 2/2/2022
> [   67.538326] Call Trace:
> [   67.538326]  <TASK>
> [   67.538326]  dump_stack_lvl+0x5b/0x80
> [   67.538326]  print_report+0x163/0x800
> [   67.538326]  ? __virt_addr_valid+0x2f3/0x340
> [   67.538326]  ? nvme_loop_create_ctrl+0x87c/0xbe0 [nvme_loop e19ff72683e84a1bbd49637ed7792592f1a14d32]
> [   67.538326]  kasan_report_invalid_free+0xa7/0xe0
> [   67.538326]  ? nvme_loop_create_ctrl+0x87c/0xbe0 [nvme_loop e19ff72683e84a1bbd49637ed7792592f1a14d32]
> [   67.538326]  ? nvme_loop_create_ctrl+0x87c/0xbe0 [nvme_loop e19ff72683e84a1bbd49637ed7792592f1a14d32]
> [   67.538326]  poison_slab_object+0x11c/0x180
> [   67.538326]  __kasan_slab_free+0x33/0x80
> [   67.538326]  ? nvme_loop_create_ctrl+0x87c/0xbe0 [nvme_loop e19ff72683e84a1bbd49637ed7792592f1a14d32]
> [   67.538326]  kfree+0x119/0x310
> [   67.538326]  nvme_loop_create_ctrl+0x87c/0xbe0 [nvme_loop e19ff72683e84a1bbd49637ed7792592f1a14d32]
> [   67.554302]  nvmf_dev_write+0x22ff/0x2ae0 [nvme_fabrics cd628fee4abd75b95095eaf559203a0a73425269]
> [   67.554302]  ? common_file_perm+0x14e/0x210
> [   67.554302]  vfs_write+0x1cd/0xb60
> [   67.554302]  ? kasan_quarantine_put+0xb4/0x1c0
> [   67.554302]  ? kmem_cache_free+0x11e/0x2e0
> [   67.554302]  ksys_write+0xd7/0x1a0
> [   67.554302]  do_syscall_64+0xb1/0x180
> [   67.554302]  ? syscall_exit_to_user_mode+0x24d/0x350
> [   67.554302]  ? do_syscall_64+0xc0/0x180
> [   67.554302]  ? kmem_cache_free+0x11e/0x2e0
> [   67.554302]  ? syscall_exit_to_user_mode+0x24d/0x350
> [   67.554302]  ? do_syscall_64+0xc0/0x180
> [   67.554302]  entry_SYSCALL_64_after_hwframe+0x6e/0x76
> [   67.554302] RIP: 0033:0x7fc80410afd4
> [   67.554302] Code: 84 00 00 00 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 90 90 80 3d 55 ea 0e 00 00 74 13 b8 01 00 00
>   00 0f 05 <48> 3d 00 f0 ff ff 77 54 c3 0f 1f 00 48 83 ec 28 48 89 54 24 18 48
> [   67.554302] RSP: 002b:00007ffd31d002c8 EFLAGS: 00000202 ORIG_RAX: 0000000000000001
> [   67.554302] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fc80410afd4
> [   67.574292] RDX: 0000000000000149 RSI: 0000000001bee310 RDI: 0000000000000003
> [   67.574292] RBP: 0000000000000000 R08: 0000000000000149 R09: 0000000001bee310
> [   67.574292] R10: 00007fc80400b2a8 R11: 0000000000000202 R12: 0000000000000000
> [   67.574292] R13: 0000000000000000 R14: 00007fc8047cd000 R15: 00000000005659f8
> [   67.579476]  </TASK>
> 
> 
Maybe this?

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 0a8a595070c0..ca1984620492 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -4413,6 +4413,8 @@ void nvme_remove_admin_tag_set(struct nvme_ctrl *ctrl)
                 blk_put_queue(ctrl->fabrics_q);
         }
         blk_mq_free_tag_set(ctrl->admin_tagset);
+       ctrl->admin_q = NULL;
+       ctrl->fabrics_q = NULL;
  }
  EXPORT_SYMBOL_GPL(nvme_remove_admin_tag_set);

Cheers,

Hannes




More information about the Linux-nvme mailing list