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 6EB2426A1B9 for ; Thu, 30 Apr 2026 13:51:39 +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=1777557099; cv=none; b=M2ZsI/I+H2V3C49tKdcP9fmB1oq1h162qdwUTdpSFFiPw218KmEPs8y9V5/sTAfAWxCEmmem8TYfJW4foHrRTgmLRMhYmkk9JHBrfe0GTCHH2vaiaXUV9ua2C9kw/WLiyFJ9Ak6/rK4urpMoRJOKFvEHYeFZzsBlnBgg08btuKE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777557099; c=relaxed/simple; bh=03Np4t1/F9gyYP6MvmAp7JH8+0y5QFXe6/3y/EAYQgM=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=aievzrGQH+32cusQCRGgZlgX6zV8e669JE1KueGmfN+OkBO9hgyahJKcEhG1bmfzKQckUr8G1VDlFJCrpDb3gDXXoHymYxF5te0yluOAGyGNtGjdNbBu193j1oNaQ4NktkooJ8sdF1jwB9+zEDLWpnSwRddg2QrUhBlOr9zvaaU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=H0jMC1lf; 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="H0jMC1lf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7D03C2BCB3; Thu, 30 Apr 2026 13:51:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777557098; bh=03Np4t1/F9gyYP6MvmAp7JH8+0y5QFXe6/3y/EAYQgM=; h=Subject:To:Cc:From:Date:From; b=H0jMC1lfcLuJx8H1z3lIsvuJh3c3C3xJ2tb/3uxnGrcuVPKlDJ5VkNOWVQGvIr0QT BUKSQMY3Irdk9pSV8OfLXvYntcKIYo8yvIOcdSpTSLwTyjkVaOMeHgF92zNx2P26pW /HCUtvY8Q+8rfLK9UlGRc+76xM19xfcyBk0ARniM= Subject: FAILED: patch "[PATCH] wifi: mwifiex: fix use-after-free in" failed to apply to 6.1-stable tree To: git@danielhodges.dev,johannes.berg@intel.com Cc: From: Date: Thu, 30 Apr 2026 15:51:27 +0200 Message-ID: <2026043027-lurch-equivocal-ad0b@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 ae5e95d4157481693be2317e3ffcd84e36010cbb # git commit -s git send-email --to '' --in-reply-to '2026043027-lurch-equivocal-ad0b@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From ae5e95d4157481693be2317e3ffcd84e36010cbb Mon Sep 17 00:00:00 2001 From: Daniel Hodges Date: Fri, 6 Feb 2026 14:44:01 -0500 Subject: [PATCH] wifi: mwifiex: fix use-after-free in mwifiex_adapter_cleanup() The mwifiex_adapter_cleanup() function uses timer_delete() (non-synchronous) for the wakeup_timer before the adapter structure is freed. This is incorrect because timer_delete() does not wait for any running timer callback to complete. If the wakeup_timer callback (wakeup_timer_fn) is executing when mwifiex_adapter_cleanup() is called, the callback will continue to access adapter fields (adapter->hw_status, adapter->if_ops.card_reset, etc.) which may be freed by mwifiex_free_adapter() called later in the mwifiex_remove_card() path. Use timer_delete_sync() instead to ensure any running timer callback has completed before returning. Fixes: 4636187da60b ("mwifiex: add wakeup timer based recovery mechanism") Cc: stable@vger.kernel.org Signed-off-by: Daniel Hodges Link: https://patch.msgid.link/20260206194401.2346-1-git@danielhodges.dev Signed-off-by: Johannes Berg diff --git a/drivers/net/wireless/marvell/mwifiex/init.c b/drivers/net/wireless/marvell/mwifiex/init.c index 5c9a46e64d23..0c8925013724 100644 --- a/drivers/net/wireless/marvell/mwifiex/init.c +++ b/drivers/net/wireless/marvell/mwifiex/init.c @@ -391,7 +391,7 @@ static void mwifiex_invalidate_lists(struct mwifiex_adapter *adapter) static void mwifiex_adapter_cleanup(struct mwifiex_adapter *adapter) { - timer_delete(&adapter->wakeup_timer); + timer_delete_sync(&adapter->wakeup_timer); cancel_delayed_work_sync(&adapter->devdump_work); mwifiex_cancel_all_pending_cmd(adapter); wake_up_interruptible(&adapter->cmd_wait_q.wait);