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 C3DDB470117; Tue, 25 Aug 2026 13:53:45 +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=1787666026; cv=none; b=K7g4f4/W15DGuzHbDUI06oWG2RarmKy1W7HdqXrhZ5bap0j0ZrWdYeS0yC3Pe5dWNzr4iISj9TMR5RR34pOOjKS7LJHj7OOHN9HkDleUpdDjRhJtd6jhSSuyFjfNcBMI7aCTAwnBv+k7gLBmPqkrphiWLlVn2t7owJIqYuE3Q/8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787666026; c=relaxed/simple; bh=mY+gnfv+wJMeGbFq5pYtwxTV4TnnWTgp5VIF+Le3oCM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=j4BWdtXRqijwXCa71BJgHzlfnElC2yDAoXWoEEKNeLdVNY8wr9a5JsBbHzH8RctCc/4nWi4+ACq4fcHU9SmuygXXJ9hTGWyVC4EZHe/vw6oMVGsBeBqNKyGM9MXHJEq0x+mUspxM4kn+WalTQik8+2ijx+iXtupER4jrgVsY/B8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1YVK9Smv; 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="1YVK9Smv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22CFB1F00A3A; Tue, 25 Aug 2026 13:53:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1787666025; bh=DMIuV9mvxLkbBDk/5qmckoCoyTfzhJ0WKMWGkW21wXo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=1YVK9SmvMF9Z/Xv2vH3cPV6dd95Re6P3vTIzDKDVjxFEq5KU3xdydVJ6qWUTmgFPs C9kE0sxTdBgMcqeuBMDlTepf1y662vXnL0Xc9oWUUGqZzTNuTSa0ksQcXnlgt9hNcq VAee5rwX6Y1NG427T6gPrL1OuR7v7YSBNVxXfwRk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Linmao Li , Dmitry Torokhov , Sasha Levin Subject: [PATCH 6.1 60/79] Input: byd - synchronize timer deletion before freeing private data Date: Tue, 25 Aug 2026 15:26:40 +0200 Message-ID: <20260825132544.037507518@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260825132541.677185791@linuxfoundation.org> References: <20260825132541.677185791@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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Linmao Li [ Upstream commit c83e79c0842ed29860648bcce5022ef0ba5001c6 ] byd_disconnect() uses timer_delete() before freeing the driver's private data. This does not wait for a running byd_clear_touch() callback, which dereferences the private data and its psmouse pointer. A callback racing with disconnect can therefore access the private data after it has been freed. The timer can also still be re-armed by byd_process_byte() while the disconnect is in progress. Use timer_shutdown_sync() before freeing the private data: it waits for a running callback and turns any later re-arm attempt into a no-op. Fixes: 2d5f5611dd0d ("Input: byd - enable absolute mode") Cc: stable@vger.kernel.org Signed-off-by: Linmao Li Link: https://patch.msgid.link/20260720061259.1601281-1-lilinmao@kylinos.cn Signed-off-by: Dmitry Torokhov [ changed `del_timer()` to `timer_shutdown_sync()` since 6.12 predates the `del_timer()` → `timer_delete()` rename ] Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/input/mouse/byd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/input/mouse/byd.c +++ b/drivers/input/mouse/byd.c @@ -426,7 +426,7 @@ static void byd_disconnect(struct psmous struct byd_data *priv = psmouse->private; if (priv) { - del_timer(&priv->timer); + timer_shutdown_sync(&priv->timer); kfree(psmouse->private); psmouse->private = NULL; }