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

Christoph Hellwig hch at lst.de
Mon Aug 17 00:36:56 PDT 2026


On Thu, Aug 13, 2026 at 04:31:07PM +0800, raoxu wrote:
> From: Xu Rao <raoxu at uniontech.com>
> 
> 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 at lst.de>

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).



More information about the Linux-nvme mailing list