From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 51C4524DCF9 for ; Fri, 1 May 2026 12:09:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777637385; cv=none; b=iSz/qC0+OdqzNZdvfo8y2bn2pUMzZpRuxEYOFSziEmjw0krlIl/3whYdZ1HRdYg12/EcLpKvLZyadkFInCT1qfmWjOWjFYKDaYkMV9TzQUrYFimULEH3LJXTRPtwkS6TsiTtf6Qs14kujCh5vvgvlJvsfl34KFGI5N2n1+kZ77o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777637385; c=relaxed/simple; bh=Gks5MXNClqd1370zZRitc6suPIMVSt3zlqSlbnQW7HE=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=jK7R6yTidxO/m1kyZ+8dXSSBFh22VUBv7QYOeswc7pleIzh8wpcKPAweK/EA8laEKGBEK5bbbP9n8mbzkU6U0id9ctZ7BjdnEu68ZqMv65/Cawv4G8anTA2qVww837rsbtrSeWVJsUAyFazorDyfJHLr27bAaPwjtBDH925t5uo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=sQwfj0W6; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="sQwfj0W6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7C59C2BCB4; Fri, 1 May 2026 12:09:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777637385; bh=Gks5MXNClqd1370zZRitc6suPIMVSt3zlqSlbnQW7HE=; h=Subject:To:Cc:From:Date:From; b=sQwfj0W6l70lu28n3SqZ+XtSw2e9nxGglyz9chsOogZRq1LQe7fTbdbB2kabpHiwL CTGQsdoL3v19pDJlQPtRsdGCTBnsVozu8976ZJzwXZQp37+43dlBVP+a2AVDKvqyKp 2wJpd4XmPAnl2jiAmfQ5+Yc70UmoYN90z5B9t4nY= Subject: FAILED: patch "[PATCH] net: qrtr: ns: Free the node during ctrl_cmd_bye()" failed to apply to 5.15-stable tree To: manivannan.sadhasivam@oss.qualcomm.com,kuba@kernel.org Cc: From: Date: Fri, 01 May 2026 14:09:40 +0200 Message-ID: <2026050140-pedicure-recluse-8dc9@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.15-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y git checkout FETCH_HEAD git cherry-pick -x 68efba36446a7774ea5b971257ade049272a07ac # git commit -s git send-email --to '' --in-reply-to '2026050140-pedicure-recluse-8dc9@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 68efba36446a7774ea5b971257ade049272a07ac Mon Sep 17 00:00:00 2001 From: Manivannan Sadhasivam Date: Thu, 9 Apr 2026 23:04:14 +0530 Subject: [PATCH] net: qrtr: ns: Free the node during ctrl_cmd_bye() A node sends the BYE packet when it is about to go down. So the nameserver should advertise the removal of the node to all remote and local observers and free the node finally. But currently, the nameserver doesn't free the node memory even after processing the BYE packet. This causes the node memory to leak. Hence, remove the node from Xarray list and free the node memory during both success and failure case of ctrl_cmd_bye(). Cc: stable@vger.kernel.org Fixes: 0c2204a4ad71 ("net: qrtr: Migrate nameservice to kernel from userspace") Signed-off-by: Manivannan Sadhasivam Link: https://patch.msgid.link/20260409-qrtr-fix-v3-3-00a8a5ff2b51@oss.qualcomm.com Signed-off-by: Jakub Kicinski diff --git a/net/qrtr/ns.c b/net/qrtr/ns.c index 5b08d4d4840a..1b9a90240a68 100644 --- a/net/qrtr/ns.c +++ b/net/qrtr/ns.c @@ -359,7 +359,7 @@ static int ctrl_cmd_bye(struct sockaddr_qrtr *from) struct qrtr_node *node; unsigned long index; struct kvec iv; - int ret; + int ret = 0; iv.iov_base = &pkt; iv.iov_len = sizeof(pkt); @@ -374,8 +374,10 @@ static int ctrl_cmd_bye(struct sockaddr_qrtr *from) /* Advertise the removal of this client to all local servers */ local_node = node_get(qrtr_ns.local_node); - if (!local_node) - return 0; + if (!local_node) { + ret = 0; + goto delete_node; + } memset(&pkt, 0, sizeof(pkt)); pkt.cmd = cpu_to_le32(QRTR_TYPE_BYE); @@ -392,10 +394,18 @@ static int ctrl_cmd_bye(struct sockaddr_qrtr *from) ret = kernel_sendmsg(qrtr_ns.sock, &msg, &iv, 1, sizeof(pkt)); if (ret < 0 && ret != -ENODEV) { pr_err("failed to send bye cmd\n"); - return ret; + goto delete_node; } } - return 0; + + /* Ignore -ENODEV */ + ret = 0; + +delete_node: + xa_erase(&nodes, from->sq_node); + kfree(node); + + return ret; } static int ctrl_cmd_del_client(struct sockaddr_qrtr *from,