Re: [PATCH] nvme-fabrics: fix DHCHAP secret leak on parse failure

From: Christoph Hellwig

Date: Mon Aug 17 2026 - 03:39:07 EST


On Thu, Aug 13, 2026 at 04:31:07PM +0800, raoxu wrote:
> From: Xu Rao <raoxu@xxxxxxxxxxxxx>
>
> nvmf_parse_options() duplicates dhchap_secret and dhchap_ctrl_secret
> with match_strdup() before validating the DHHC-1: representation.

Looks good:

Reviewed-by: Christoph Hellwig <hch@xxxxxx>

Btw, I think the size and structure of nvmf_parse_options helped to
get to this. If you are interested in a little improvement project
in this area, it would be nice to add a separate helper for the parsing
of each option so that the strdup allocations are limited to that
scope (and don't reuse the p variable used for the token).