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 A521C426D36 for ; Tue, 20 Jan 2026 13:17:34 +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=1768915054; cv=none; b=cC58G028fZvp3PN5vdJb24lNxc7Lo4eRC+x2IXS3wx/dcQ97rqHQSwakqsbvlKyt/k4wEYlcH0KjYz6Ipl+dx1gx/i9Cv98yE55/9tgpzqQBPqI5UTCIfwqDN/lg21GNf+IcetPbYdRPm4RYR3vicRcupALmnf9u241DiZHGoXY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768915054; c=relaxed/simple; bh=x2ksLz/7T5Zy9e3ltY9gMH/1nH6cvKUWDZO9+FArhto=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=n0GYaSZNAyPE9do80cxKun1AUcW2iP38bEv/6iiiqoHH5crixd/HlwryMhje5erRFCiN2qa5Xv3GD3ww6OgVbnEQzix8IBdu4S73b/FivasIDLaKc1Mz0U0oYvHWw+UCawsPjeKC60ThUytaOOm1PNc/G4xyAqvLzrYELrGgYYA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1AUyIW9+; 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="1AUyIW9+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 285F9C16AAE; Tue, 20 Jan 2026 13:17:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1768915054; bh=x2ksLz/7T5Zy9e3ltY9gMH/1nH6cvKUWDZO9+FArhto=; h=Subject:To:Cc:From:Date:From; b=1AUyIW9+SecWReWJSR7PMZlzm3AHVmzMZRqdmBGreTqgvqyVqQeowsQUPB1lLjPJf N2FiXOInOlTLDlyb3mytVCr6jl3nrP08Vt2J921vr8OUgJnZZakpt5P/5HAo4R0wtM 4pelwJxsOMhdAYJNiElsawiQ5k7ZSHW3zKGZcqkQ= Subject: FAILED: patch "[PATCH] can: gs_usb: gs_usb_receive_bulk_callback(): fix URB memory" failed to apply to 5.15-stable tree To: mkl@pengutronix.de Cc: From: Date: Tue, 20 Jan 2026 14:17:23 +0100 Message-ID: <2026012023-ranged-machinist-edb4@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 7352e1d5932a0e777e39fa4b619801191f57e603 # git commit -s git send-email --to '' --in-reply-to '2026012023-ranged-machinist-edb4@gregkh' --subject-prefix 'PATCH 5.15.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 */