The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Linmao Li <lilinmao@kylinos.cn>
Cc: Kees Cook <kees@kernel.org>,
	 Vivek BalachandharTN <vivek.balachandhar@gmail.com>,
	Richard Pospesel <pospeselr@gmail.com>,
	 Chris Diamand <chris@diamand.org>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	 stable@vger.kernel.org
Subject: Re: [PATCH v2] Input: byd - synchronize timer deletion before freeing private data
Date: Wed, 22 Jul 2026 11:54:46 -0700	[thread overview]
Message-ID: <amER82tgDcz2wcs_@google.com> (raw)
In-Reply-To: <20260720061259.1601281-1-lilinmao@kylinos.cn>

On Mon, Jul 20, 2026 at 02:12:59PM +0800, Linmao Li wrote:
> 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 <lilinmao@kylinos.cn>

Applied, thank you.

-- 
Dmitry

      reply	other threads:[~2026-07-22 18:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20  3:30 [PATCH] Input: byd - synchronize timer deletion before freeing private data Linmao Li
2026-07-20  6:12 ` [PATCH v2] " Linmao Li
2026-07-22 18:54   ` Dmitry Torokhov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=amER82tgDcz2wcs_@google.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=chris@diamand.org \
    --cc=kees@kernel.org \
    --cc=lilinmao@kylinos.cn \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pospeselr@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=vivek.balachandhar@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox