From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C324D4B7A35; Thu, 17 Sep 2026 16:56:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789664185; cv=none; b=fyxeD8UjOx1LpGbNNj+scViDdJl5qAIyCIUmEVcFuncPeJjwY7Tz9Jy6GRV1rKKs2VuAuo5eF8onp8J5EzC+ALig1tlCETi6UCKfGNhGMA2bYrUKH8wd27WS32cSS3FLexBfV6KquBA1bQjZiEYq4fWUPR36NOOWobActSmjWMY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789664185; c=relaxed/simple; bh=nDHw8BJpCmC8G0SbDPuV41AgkyDCuY4SBlEFF2Nc4LY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OEwCWOBpIXWwdWztWAXDwTzhv4W+1rEUuvgY4GpTfVq6lMDCkqcqFte36ktIJ7M7cJwYVMR09ixGZw/9w60ZQyDvHOn1lIhVe4ZA6qjKC3ZBFgZx9zU4nyISGuzQIAZU/ZhvwseUMHNZwXXj6UVVLNWK+ye4GG4M11Puw1bOejM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cfFJ40+R; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="cfFJ40+R" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BABE01F000FF; Thu, 17 Sep 2026 16:56:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789664184; bh=YnGLB4y7D7vgByPke680eXAQpN7vXfn9I0JZqUKHAr8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=cfFJ40+RNDTeXaUkgK9TMLtWmp7h9LJbLI/voVAg7zc9wnm7UrUEj82WDCwNErYmO G5Eg5NbaFLNHN8S13lDhvsWwG6wclLAtLfWbYs6QZB6q9SqN3v1MHogj6Ah934owMb dRD39KviosRXODmLssJYWcFxPlX5PgnAIFPGI88k= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Wentao Liang , Alexander Lobakin , Manivannan Sadhasivam , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.18 0286/1250] net: qrtr: fix node refcount leak on ctrl packet alloc failure Date: Thu, 17 Sep 2026 16:01:21 +0100 Message-ID: <20260917151559.883352751@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260917151551.901433442@linuxfoundation.org> References: <20260917151551.901433442@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Wentao Liang [ Upstream commit 3b09ff54114566864eea59020f6b69c5bb325b9d ] qrtr_send_resume_tx() calls qrtr_node_lookup() which takes a reference on the returned node. If the subsequent call to qrtr_alloc_ctrl_packet() fails due to memory allocation failure, the function returns -ENOMEM without calling qrtr_node_release() to release the node reference. Add qrtr_node_release(node) before returning on the allocation failure path to properly release the reference. Signed-off-by: Wentao Liang Reviewed-by: Alexander Lobakin Reviewed-by: Manivannan Sadhasivam Link: https://patch.msgid.link/20260528080019.1176700-1-vulab@iscas.ac.cn Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/qrtr/af_qrtr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/qrtr/af_qrtr.c b/net/qrtr/af_qrtr.c index fcd24a7df3f00..1f40496d84a33 100644 --- a/net/qrtr/af_qrtr.c +++ b/net/qrtr/af_qrtr.c @@ -1009,8 +1009,10 @@ static int qrtr_send_resume_tx(struct qrtr_cb *cb) return -EINVAL; skb = qrtr_alloc_ctrl_packet(&pkt, GFP_KERNEL); - if (!skb) + if (!skb) { + qrtr_node_release(node); return -ENOMEM; + } pkt->cmd = cpu_to_le32(QRTR_TYPE_RESUME_TX); pkt->client.node = cpu_to_le32(cb->dst_node); -- 2.53.0