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 0BA25346E55; Sat, 30 May 2026 17:49:09 +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=1780163351; cv=none; b=qe1k+L8FY5Evbgb06673uprnV4opB0c/mG0//AoNi2eocRh2UKWaGoFuxYMNx4o0WTjOqPX34/77unygqcpMmuO9bjrSHcdOM63Z9HpjVEMh9B3ohqRdkmvRbyKfK1Tv/n+/1pNrCh9bnD6hIzx+3S6no2yh3mr3UnL6T7Nyphs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780163351; c=relaxed/simple; bh=M3NetrKi7ubpmgXfH0UDvILM/nk3cPFj0yx9w03JcjY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=g/UvC2axtP6V4EIyG8kzzhvo/3fTLF60+c00LBS1HctIxKAXxch9rxaWqB6RmFEozgq/87A4hcTf+VTxLDbUpvyCIq/A/G5QtcG2RVmYAB4j422nibSBgHibOhoHJkC5rTP8gX0bCtdsCXnUNuAGfL2OQjID4a/ohmZaEJZvI1o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Q/ToUOpT; 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="Q/ToUOpT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18A7B1F00893; Sat, 30 May 2026 17:49:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780163349; bh=cDyMtiELO3UYBh8GMLP+uZXzTMmFocjORpIdGtgfB2Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Q/ToUOpTG/5B4RnyyG2UPaVn+ZXn3YMgDzmnRlwpwfFtCFtFKEBhahYFao8rNHt7i e3EzHKsKZJHwEIdF4cKVVNSGLNopATT/Gh3GRnd9w9tgaN+kv82MWWaj40CBB0PKJF sHUokRP/y7GiWIKqU0r/doPaviaS5hl13T/Brn6Q= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable@kernel.org, Yifan Wu , Juefei Pu , Yuan Tan , Xin Liu , Luxiao Xu , Ren Wei , Paolo Abeni Subject: [PATCH 5.15 201/776] net: strparser: fix skb_head leak in strp_abort_strp() Date: Sat, 30 May 2026 17:58:35 +0200 Message-ID: <20260530160245.705672679@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260530160240.228940103@linuxfoundation.org> References: <20260530160240.228940103@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 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Luxiao Xu commit fe72340daaf1af588be88056faf98965f39e6032 upstream. When the stream parser is aborted, for example after a message assembly timeout, it can still hold a reference to a partially assembled message in strp->skb_head. That skb is not released in strp_abort_strp(), which leaks the partially assembled message and can be triggered repeatedly to exhaust memory. Fix this by freeing strp->skb_head and resetting the parser state in the abort path. Leave strp_stop() unchanged so final cleanup still happens in strp_done() after the work and timer have been synchronized. Fixes: 43a0c6751a32 ("strparser: Stream parser for messages") Cc: stable@kernel.org Reported-by: Yifan Wu Reported-by: Juefei Pu Co-developed-by: Yuan Tan Signed-off-by: Yuan Tan Suggested-by: Xin Liu Tested-by: Yuan Tan Signed-off-by: Luxiao Xu Signed-off-by: Ren Wei Link: https://patch.msgid.link/ade3857a9404999ce9a1c27ec523efc896072678.1775482694.git.rakukuip@gmail.com Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman --- net/strparser/strparser.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/net/strparser/strparser.c +++ b/net/strparser/strparser.c @@ -45,6 +45,14 @@ static void strp_abort_strp(struct strpa strp->stopped = 1; + if (strp->skb_head) { + kfree_skb(strp->skb_head); + strp->skb_head = NULL; + } + + strp->skb_nextp = NULL; + strp->need_bytes = 0; + if (strp->sk) { struct sock *sk = strp->sk;