From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D8B442CAEF for ; Wed, 12 Aug 2026 10:59:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786532377; cv=none; b=seBfxTPsrcUACs9jPcCjDXi5VBbNchHvU+aR+E6lND7PHNaxPsQOuiRZX/ujw05p2qxXLcOBSCgayByI5gvjyV+ssFjU9nYcpr9a2FVkWmfVta/SZID6c/lI3zdpP5A97oupwvS40iTrEb2860w1jfTMN1N8JkfHdwHRBhOqjmM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786532377; c=relaxed/simple; bh=RAYL+HImpy2MxY1r4xQwqPshEhKI6Z/GM/3pC/Um+P4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jFQfk91D8YEZrm0XtCKFlyDy3qEJAQvqPCuBm1cEUQjeRfdbLIPeHl10Q+GnGVoTSYGIQK3yhCOIr1Yuq7JNG10C2o77Um4RcqgKXsO8TPcyMrzlctURvyhskeUJXG9NN4bokWzVmFpJ+GU114OquFYLR3hvZpbXJglhrudV9w0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=pJfoZUhl; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pJfoZUhl" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-2d01663d816so8258875ad.1 for ; Wed, 12 Aug 2026 03:59:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786532376; x=1787137176; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=v1giYEEFDAdDWhpqNCDj5Oim4DUh+IAW8TxGs1lj9Po=; b=pJfoZUhlBouoFBaVnliAjcznbN9wpc/nwod7oU6sR83N4ijA2Bt+sCrQR6zISYiuYB +k/pT10opEfbdax6RO5j9tC36EVxdKBBjIWd4XMLVTzr7xhRs9vkS7JZ+gTtLyr7aNFa 4Fv7f8FcWTYkpv8qjaiIAfiNx8I1aLfidhpHlMxEpSK8ityjTChhBp3neX6QBTo6vlD5 5xp4COG98yKD+pz5ZojA/bhvpSc92v5pUSHV289xwP9qK9KLswobrpMGwwwjKcVLp/YL fVNdXvY8T8tHPVrh0sGa2G3EZ3toQ5yqUUcVQWgsp1iCoO6i6iYO+U/Qzm7IPWSKswtA au1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786532376; x=1787137176; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=v1giYEEFDAdDWhpqNCDj5Oim4DUh+IAW8TxGs1lj9Po=; b=mP6OxIucsrfi8Ke4SzDxJ4p0xBCHf1ZXY9TAYcRyfukxEoJyQNyuIqBjtJP6oxou4R O23acPRCKJ23M3vcl6ihs/xPOZ5MPwKc8YeaVi2fwmCUvUi1TAFC0XQsWvA2i3tYi84i UrjzWU4okp1MZrw72dHL2GeyTWEfWQy7HPHgVdnKNexD5mZfm7B18dQjOYKqG7vy3+yv KKv0GNJYZST45dxh9Z8FiAXodO+uW6zVMzj73ku54Ghf1Y2lYEZxbwESAHHwtEl6SXDb Wp6vzQclJKFY3WfehIqHpg5lIwo08zhcTG4/5j2ReslpML2s40mHJOhiVRqdprrwv1vf rJkQ== X-Forwarded-Encrypted: i=1; AHgh+RoaPXuXj57MvtWIXhrF9ZPZ0f73JLdKsWgx3QVxwZFqnWLZmOcU8RyOKqoErrRlCH9VjmTpRhKDYaEN5Jc=@vger.kernel.org X-Gm-Message-State: AOJu0YzJGKupaGTnEiOr7DrG7qrkR+vQXcajJh9qJ8ECqQFzme4lJsnP 9XG2lleun2vbJSSy7qwugkeFlOyAenZVJ1Xb8PLnYZn1FBc8Dqw2Z4H1 X-Gm-Gg: AR+sD118a2hQfdRfXg/jnxYt+Ne+hpdHDicRaKiil6Bkw1KgqPgr/PbqiLGwCW7mz4k 3PwRwytphKNeAs66CQgzIVv0W4u6agoW+j3x7mLqaiMLrmSyXgRwakMrijl8z+Iyu2pIubh8ATo fdb9tUolKRld2Lsb/Gxm71ZKihFHpj5Jyvd0TGtd+ZTz33+9SyiLjQLVz0eSZYeQKc0Ukg0hrr/ yCLGdIvRvSGQPCqQC/unCClz6j1oWLbM9rnzQImQ66qIMat91CzocHjn1QirgIAuWxOq9QpsaMv 5uh5nEyzMn9GkBD3tilKPPZU0mB/GmE7hrAEarXu9ScmuQkkiHPiKfCIe5U1YH9XPyV+EtVbJMw RsrdD8NYjKxoUCBYRdqaIkGAHLeQK+TjUjhD7ySOQX7y6Y6Np7ufKCXYbHzvV0i3WDxII5eqynd DdNdZ5DK8qzCTIFRwVZ4jhDEHBpObcPqTbodxzK6Qw6nUxnOrDVSYtWVVCbQWfUJH1XNdm25o= X-Received: by 2002:a17:903:11c6:b0:2d2:da8e:9017 with SMTP id d9443c01a7336-2d3452f5c1cmr47925805ad.8.1786532375860; Wed, 12 Aug 2026 03:59:35 -0700 (PDT) Received: from ubuntu.. ([219.241.133.184]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2d351151177sm4574795ad.31.2026.08.12.03.59.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Aug 2026 03:59:35 -0700 (PDT) From: Rihyeon Kim To: kbusch@kernel.org Cc: hch@lst.de, sagi@grimberg.me, axboe@kernel.dk, justin.tee@broadcom.com, nareshgottumukkala83@gmail.com, paul.ely@broadcom.com, kch@nvidia.com, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] nvme-fc: fix double free of fabrics options when nvme_add_ctrl() fails Date: Wed, 12 Aug 2026 19:59:31 +0900 Message-ID: <20260812105931.55438-1-rihyeon8648@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hello, Thanks for the review. > Can't you move the setting from the "fail_ctrl:" label to the > "out_put_ctrl:" one instead of duplicating it for both? Yes. I had kept both because I was not sure the put inside nvme_uninit_ctrl() could not be the last one, which would run nvme_fc_ctrl_free() before out_put_ctrl: cleared the pointer. As far as I could tell nvme-tcp and nvme-rdma use the same uninit-then-put ladder, and testing does not show it either. I swept fail-nth 1..200 over the connect write with fcloop and failslab: unpatched hits the report at 17, and with the clear moved all 200 pass, 21 of the injections landing in nvme_alloc_admin_tag_set(), so fail_ctrl: is covered as well. It also looks like moving it drops the window where opts is already NULL while the fabrics sysfs attributes, which do not check it, are still there. v2 on the way. Thanks, Rihyeon