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 E8AF1403E9B; Tue, 21 Jul 2026 18:39:14 +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=1784659156; cv=none; b=BFyrGS2fHIFg3QoUMopLfgzZXLZmub5AG3999JvWsBtXLhitaJxyA1ANHSgZEJqESngPfjj8RKOxPUo0tGstjpxdrZIN8GM6LrdKuXJfSvA0dBVFJd+9hx39oq1xmz4Ls5SFHWzeZlFQx2RjL0/nTxuUWAWBKRIR42YaGFMEZvI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784659156; c=relaxed/simple; bh=1KkINnyhfPhhkcbRxd6Or1ycoPEZDJWDT2kLTVt6eH0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IsmDsUOmUVrbwr+odnz02G7NsxZVNRPNv6yRO1s759y61JGIjRw8U687hF0vbBqyqk3sDqMRpipZwBLwAsE1CmQBnMEzMmtpLPQpOnd2Pw4dmw5m9VPRqAF8jqZS7HobvWDHtUmmSHy99nGkn4h53Pyd2W8Rr/jCh8asiPxWQ+A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=bWvD/EcV; 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="bWvD/EcV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 463471F00A3D; Tue, 21 Jul 2026 18:39:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784659154; bh=hklqxRooBGsc3wX+DnDecYNJob6dJPGj9RkXr62ckHE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=bWvD/EcV2YeAEBifio4Kkv+tHszCtWvMh/tJIyxG+z7B5ay2uU9U3zg7S/MFwb8BI mE7TBVZ1iNDeyTMv4NmTCDTRnExRqmIha5y8nYo3KOnTj7D+53Q8wSdPyq0wfakEu7 447e+jxMyDyxvGsH0OnAViCX7b6OoEnaE2Y7ofIg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Shitalkumar Gandhi , Miquel Raynal , Stefan Schmidt Subject: [PATCH 6.18 1414/1611] ieee802154: ca8210: fix cas_ctl leak on spi_async failure Date: Tue, 21 Jul 2026 17:25:30 +0200 Message-ID: <20260721152547.244613304@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152514.750365251@linuxfoundation.org> References: <20260721152514.750365251@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 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Shitalkumar Gandhi commit e09390e439bd7cca30dd10893b1f64802961667a upstream. ca8210_spi_transfer() allocates cas_ctl with kzalloc_obj(GFP_ATOMIC) and relies entirely on the SPI completion callback ca8210_spi_transfer_complete() to free it. The spi_async() API only invokes the completion callback on successful submission. On failure it returns a negative error code without ever queuing the callback, which leaves cas_ctl and its embedded spi_message and spi_transfer orphaned. Every kfree(cas_ctl) in the driver is inside the completion callback, so there is no other reclamation path. ca8210_spi_transfer() is called from ca8210_spi_exchange(), the interrupt handler ca8210_interrupt_handler(), and from the retry path inside the completion callback itself. The exchange and interrupt handler paths loop on -EBUSY, so under sustained SPI bus contention every retry iteration leaks a fresh cas_ctl (~600 bytes per occurrence). Fix it by freeing cas_ctl on the spi_async() error path. While here, correct the misleading error string: the function calls spi_async(), not spi_sync(). Fixes: ded845a781a5 ("ieee802154: Add CA8210 IEEE 802.15.4 device driver") Cc: stable@vger.kernel.org Signed-off-by: Shitalkumar Gandhi Reviewed-by: Miquel Raynal Link: https://lore.kernel.org/20260421073259.2259783-1-shitalkumar.gandhi@cambiumnetworks.com Signed-off-by: Stefan Schmidt Signed-off-by: Greg Kroah-Hartman --- drivers/net/ieee802154/ca8210.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/net/ieee802154/ca8210.c +++ b/drivers/net/ieee802154/ca8210.c @@ -920,9 +920,10 @@ static int ca8210_spi_transfer( if (status < 0) { dev_crit( &spi->dev, - "status %d from spi_sync in write\n", + "status %d from spi_async in write\n", status ); + kfree(cas_ctl); } return status;