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 69AD424DCF9 for ; Fri, 1 May 2026 12:09:42 +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=1777637382; cv=none; b=tClYX1+IEqFu4pQkRPGmDSvtaFnIWBKvwHo+g/FmCZds3DYZ/dXYResEaRER2C+m43YcwZcwBB0PbaYAgqCaCeO1xom66+ZfAmqvOSCIVrKqPS5CKqEikJ3Uo5dkjw4gjpCn8lCvgg9isbxcn/ZYTEd6vrm5i639AjduCPlRtxQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777637382; c=relaxed/simple; bh=vUSh289sHgLL6DNVR1IrrsAAC8584kle2fLwEBLEFlc=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=JrXhFqJAOcQogQLWQK8yb5QduGCKEHusL5FmxraBSmohUfN34ydSkQCm0OQhfz+pdw1WUahydanSM2abzESl6rhbcxCjNIlsInwT7K0MFUr+9WzcUpIDm0YQy4NpFFKDPNoolO7BC6YV7Lznof/203J9PZy1H7+qhIsq07oDR48= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=GW9v7vtu; 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="GW9v7vtu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05AA2C2BCB4; Fri, 1 May 2026 12:09:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777637382; bh=vUSh289sHgLL6DNVR1IrrsAAC8584kle2fLwEBLEFlc=; h=Subject:To:Cc:From:Date:From; b=GW9v7vtusoc3jkiwmPk1zDc5mkKfVv1AAGSJM5GxR2IwFB3L4HNJfZZEIZhvH+FUJ nGnodn5p1MzJcini86KFwTapi0z3WAhRf/xp6Ocs/TtHGufdJigIAgP7XTQFoyph5f SCyeNQWoOIFR2+FbsH+CarxVuc6/etFaK3CrUAug= Subject: FAILED: patch "[PATCH] net: qrtr: ns: Free the node during ctrl_cmd_bye()" failed to apply to 6.1-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-unneeded-foster-afe0@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 6.1-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-6.1.y git checkout FETCH_HEAD git cherry-pick -x 68efba36446a7774ea5b971257ade049272a07ac # git commit -s git send-email --to '' --in-reply-to '2026050140-unneeded-foster-afe0@gregkh' --subject-prefix 'PATCH 6.1.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,