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 1A6CE3C198B for ; Tue, 20 Jan 2026 13:17:26 +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=1768915046; cv=none; b=tnfxfBHBLs4oPPjcZHaKgOK9vmqNUvdHSgiElMvHPWRF5PsxdJx8d4R4JNQIQLOlBHxoc/iZFuHJWQHIBL5v7yJnhZgXECVx8KSdBlq84LywopR5FGLQiy66PVbHu7vuIKmR9TimSLgu4gKiOw2cEiQHYWTASN+9tNwxXRYdwjM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768915046; c=relaxed/simple; bh=P+rIsnOtoBAFR4Z7jUliM4DJkWAwXSiVbuONWTkaToY=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=eveTtL9TmJvDCfHqp+/QJQXSJ2NdhwxCGS6QMznLe/lWEIvNw9jzLrFeEeM1YwGc4xXI3V0PY1CYPfC2XGXHP0OMhSmN57g6lFZ+PGvLPqWEYxbGIM84+E1UR+kUxNAQ4x4KWsxxcTXe+g/Vrzh4s+QJ8PRy6fJG5kp58NqRcpI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=0aOui6mC; 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="0aOui6mC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94819C16AAE; Tue, 20 Jan 2026 13:17:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1768915046; bh=P+rIsnOtoBAFR4Z7jUliM4DJkWAwXSiVbuONWTkaToY=; h=Subject:To:Cc:From:Date:From; b=0aOui6mCUQNNZ0AohnT4F8H9X7omELst1IDbnB2dx2Aja9deDsMuQXY3nCyWDzJRs JvJUAyDf2fwp54iytTVrEtHlZQ8FU16llyriHKuBa+HgzWK8Y5xwyrtd8tY0ekC4N2 oGBOulEUg6K40sFlnBkTsAfh30jKE3ZEJtGrLwd8= Subject: FAILED: patch "[PATCH] can: gs_usb: gs_usb_receive_bulk_callback(): fix URB memory" failed to apply to 5.10-stable tree To: mkl@pengutronix.de Cc: From: Date: Tue, 20 Jan 2026 14:17:23 +0100 Message-ID: <2026012023-busily-bunkbed-12df@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.10-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.10.y git checkout FETCH_HEAD git cherry-pick -x 7352e1d5932a0e777e39fa4b619801191f57e603 # git commit -s git send-email --to '' --in-reply-to '2026012023-busily-bunkbed-12df@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 7352e1d5932a0e777e39fa4b619801191f57e603 Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Tue, 23 Dec 2025 21:21:39 +0100 Subject: [PATCH] can: gs_usb: gs_usb_receive_bulk_callback(): fix URB memory leak In gs_can_open(), the URBs for USB-in transfers are allocated, added to the parent->rx_submitted anchor and submitted. In the complete callback gs_usb_receive_bulk_callback(), the URB is processed and resubmitted. In gs_can_close() the URBs are freed by calling usb_kill_anchored_urbs(parent->rx_submitted). However, this does not take into account that the USB framework unanchors the URB before the complete function is called. This means that once an in-URB has been completed, it is no longer anchored and is ultimately not released in gs_can_close(). Fix the memory leak by anchoring the URB in the gs_usb_receive_bulk_callback() to the parent->rx_submitted anchor. Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices") Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260105-gs_usb-fix-memory-leak-v2-1-cc6ed6438034@pengutronix.de Signed-off-by: Marc Kleine-Budde diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c index a0233e550a5a..d093babbc320 100644 --- a/drivers/net/can/usb/gs_usb.c +++ b/drivers/net/can/usb/gs_usb.c @@ -751,6 +751,8 @@ static void gs_usb_receive_bulk_callback(struct urb *urb) hf, parent->hf_size_rx, gs_usb_receive_bulk_callback, parent); + usb_anchor_urb(urb, &parent->rx_submitted); + rc = usb_submit_urb(urb, GFP_ATOMIC); /* USB failure take down all interfaces */