Skip to content

Commit 48969fd

Browse files
martin-gpyigaw
authored andcommitted
fabrics: sanitize traddr & trsvcid handling during connect-all
During a connect-all using the JSON config file, there are instances where traddr and trsvcid end up with garbage values eventually leading to connect invalid failures: nvme connect-all -J /usr/local/etc/nvme/config.json.gen.psk.orig -vv ... connect ctrl, 'nqn=nqn.1992-08.com.netapp:sn.48391d66c0a611ecaaa5d039ea165514:subsystem.subsys_CLIENT116_0,transport=tcp,traddr=▒o,host_traddr=192.168.1.6,trsvcid=4420 ,hostnqn=nqn.2014-08.org.nvmexpress:uuid:e6550026-173e-4959-ba74-be367844bd8a,hostid=e6550026-173e-4959-ba74-be367844bd8a,dhchap_secret=DHHC-1:01:gTtZdM+d+SjkxHcCcJKuI0OQKEnIJiXFASAlNDQP94FD/lKe:,ctrl_loss_tmo=600,concat' Failed to write to /dev/nvme-fabrics: Invalid argument free(): double free detected in tcache 2 Aborted (core dumped) ... Signed-off-by: Martin George <[email protected]>
1 parent d801e1e commit 48969fd

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

libnvme/src/nvme/fabrics.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2083,6 +2083,8 @@ static int _nvmf_discovery(struct libnvme_global_ctx *ctx,
20832083
int tmo = fctx->cfg.keep_alive_tmo;
20842084
struct libnvmf_context nfctx = *fctx;
20852085

2086+
sanitize_discovery_log_entry(c->ctx, e);
2087+
20862088
nfctx.subsysnqn = e->subnqn;
20872089
nfctx.transport = libnvmf_trtype_str(e->trtype);
20882090
nfctx.traddr = e->traddr;
@@ -2747,6 +2749,8 @@ static int nbft_discovery(struct libnvme_global_ctx *ctx,
27472749
libnvme_ctrl_t cl;
27482750
int tmo = fctx->cfg.keep_alive_tmo;
27492751

2752+
sanitize_discovery_log_entry(c->ctx, e);
2753+
27502754
nfctx.subsysnqn = e->subnqn;
27512755
nfctx.transport = libnvmf_trtype_str(e->trtype);
27522756
nfctx.traddr = e->traddr;

0 commit comments

Comments
 (0)