Skip to contentSkip to conversation

nvme-fabrics: reset admin connection for secure concatenation

bug report Dan Carpenter 3 participants 3 messages Mar 22, 2025 – Apr 15, 2025 NVMe

lore
Share & tools
lore
#0 lore raw

Hello Hannes Reinecke,

This is a semi-automatic email about new static checker warnings.

Commit 104d0e2f6222 ("nvme-fabrics: reset admin connection for secure concatenation") from Feb 24, 2025, leads to the following Smatch complaint:

    drivers/nvme/host/tcp.c:2359 nvme_tcp_setup_ctrl()
    warn: variable dereferenced before check 'ctrl->opts' (see line 2355)

drivers/nvme/host/tcp.c
2354

  2355		ret = nvme_tcp_configure_admin_queue(ctrl, new);
                                                     ^^^^

ctrl->opts is dereference here

2356 if (ret)
2357 return ret;
2358

  2359		if (ctrl->opts && ctrl->opts->concat && !ctrl->tls_pskid) {
                    ^^^^^^^^^^

so hopefully this check can be safely removed.

2360 /* See comments for nvme_tcp_key_revoke_needed() */
2361 dev_dbg(ctrl->device, "restart admin queue for secure concatenation\n");

regards,
dan carpenter

maintainer
#1 lore raw
Quoted 15 lines · Dan Carpenter

Hello Hannes Reinecke,

This is a semi-automatic email about new static checker warnings.

Commit 104d0e2f6222 ("nvme-fabrics: reset admin connection for secure concatenation") from Feb 24, 2025, leads to the following Smatch complaint:

     drivers/nvme/host/tcp.c:2359 nvme_tcp_setup_ctrl()
     warn: variable dereferenced before check 'ctrl->opts' (see line 2355)

drivers/nvme/host/tcp.c
2354

   2355		ret = nvme_tcp_configure_admin_queue(ctrl, new);
                                                      ^^^^
Quoted 8 lines

ctrl->opts is dereference here

   2356		if (ret)
   2357			return ret;
   2358	
   2359		if (ctrl->opts && ctrl->opts->concat && !ctrl->tls_pskid) {
                     ^^^^^^^^^^

so hopefully this check can be safely removed.

Yes it can.

Hannes, can you send a patch to remove this check?

Thanks Dan.

#2 lore raw
Quoted 25 lines · Sagi Grimberg
Quoted 22 lines · Dan Carpenter

Hello Hannes Reinecke,

This is a semi-automatic email about new static checker warnings.

Commit 104d0e2f6222 ("nvme-fabrics: reset admin connection for secure concatenation") from Feb 24, 2025, leads to the following Smatch complaint:

     drivers/nvme/host/tcp.c:2359 nvme_tcp_setup_ctrl()
     warn: variable dereferenced before check 'ctrl->opts' (see line 2355)

drivers/nvme/host/tcp.c
   2354
   2355        ret = nvme_tcp_configure_admin_queue(ctrl, new); ^^^^ ctrl->opts is dereference here

   2356        if (ret)
   2357            return ret;
   2358
   2359        if (ctrl->opts && ctrl->opts->concat && !ctrl-

Quoted 1 line

tls_pskid) {

Quoted 8 lines
Quoted 2 lines

                     ^^^^^^^^^^
so hopefully this check can be safely removed.

Yes it can.

Hannes, can you send a patch to remove this check?

Thanks Dan.

Done.

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke                  Kernel Storage Architect
[email protected]                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich