Re: [PATCH] nvme-fabrics: fix DHCHAP secret leak on parse failure
Keith Busch <[email protected]>
| Newsgroups | org.infradead.lists.linux-nvme,org.kernel.vger.linux-kernel,org.kernel.vger.stable |
|---|---|
| Message-ID | <aoXM61XULtnUeVg5@kbusch-mbp> |
On Thu, Aug 13, 2026 at 04:31:07PM +0800, raoxu wrote: > From: Xu Rao <[email protected]> > > nvmf_parse_options() duplicates dhchap_secret and dhchap_ctrl_secret > with match_strdup() before validating the DHHC-1: representation. > > If validation fails, the parser returns -EINVAL before the temporary > string in p is assigned to opts->dhchap_secret or > opts->dhchap_ctrl_secret. nvmf_create_ctrl() subsequently frees opts, > but nvmf_free_options() cannot release the unassigned temporary string. > Each rejected option therefore leaks one allocation. Thanks, applied to nvme-7.3.