From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07FC8349CE4 for ; Wed, 22 Jul 2026 18:54:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784746492; cv=none; b=Dn5b2DeOSY/y5dbzFrA5aHD8s3ksWKigTjiBs26xNfifcB56lBcMzMnVDMLLeWo7IiHMmAwanxxo2Zhx9A4KWrsM2ZqIpeTvbhGWm3v8+eZVNn+CnVWCZrtZ9ODmesCzHBqPgHykslhL/cLXqtGaLGCl0ZVmNzZpbFNmtZzqC0w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784746492; c=relaxed/simple; bh=2QyNWmp1hztpxmrpukYXG2ZnOTcS6rMAjzh9m2F9QEg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ub23hsehKRZV0ZA+7aAz7s3IYo9uUdsVjEagYeMkd3SlzdkErjwkR/FqZKCel+VbAUHDObjxUBYXMvYaOr484JAinE7DVIiImr42hMEUw1rHDNdsZpkt99JWr3PXj+greTwTN1JgT7ZWZoXkjUBf0lHxdO6q8czTEBL9PUgsZnw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XANTbUkt; arc=none smtp.client-ip=209.85.216.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XANTbUkt" Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-381c51fde6bso13302938a91.2 for ; Wed, 22 Jul 2026 11:54:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784746490; x=1785351290; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=979Piyb1AK7sVzfdlmcBmpZIlN7tZrXX3BOsLsFclTk=; b=XANTbUktEI4CgMk93t0B24XiXFiYf25FljzpL6yLIuhXnyROxzshuOmnHOmB5cIzY/ t1jlORnqEPMsC+JqNqW66RWVa24dAWYYoP9Zf2UdxWLapchELHsvhh3GHh1H7d4LMAfI G7Xku/afoS2/1JN5fV3Lp5851/hJtf+7gnvAAp3TQpqnlM2H4JLFETIZL/k5yWkzegin OGZZzqIiwwsQijTCfWSyblnCm1yhvsf2tUBaLLZ4EVd2ViXKcIPCzNdheZEZhG6/XkpJ dhWLHaEVuyj+aGqsJK9exZSYL4POO36tDiC1bNm8uXsEeeEUctYluA/njffpepBnJb4w auNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784746490; x=1785351290; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=979Piyb1AK7sVzfdlmcBmpZIlN7tZrXX3BOsLsFclTk=; b=sYvyWd+uFpw/QyRCAQsQ5awelZ2l1uF2oAQPtBf+A0HPFXbV6W4D58K4WNzQUMVjkf dB8++CW2rltHLQXyWPH/+0oOrmXs7S/JUxxIdxYmZwUomy9qht7AJKB1p28eMrHaPy9f gOmdkbG+CNZXUySYitIlOZ+ohELWK7qDK7JcWzdADhoC4Jg3cUBkRwelpJc9kJHe/va/ cs+/i/V56XweZvwGy0mtMCmMb85RIEKR7NLIHRPKkQQDFXN6g20fsi2sTfFqklkw14Id Ywc9CnOhlTuB5e4nJK3IQcSWZOX72TWlduZqI2mx44TuvMeJuYKkmUu3tNQ469BeZJDV 9+dA== X-Forwarded-Encrypted: i=1; AHgh+RqApGRGW2Xae361J+fGbhLEKYU+DdIXv25NMrMcSrgE1j/Nrr5ybiaojY/avw0ToGjoIzqic62G54h9NUQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzmOBSbTsfCd03lJt45ME/pKoTgflt3tESWzzYpWl2pfKBnHVQf crojNJyL5Ofb8TRI7VvbALq6poL+SKXgrUxUajlocjt/DcI+F98PvLKm X-Gm-Gg: AR+sD12wi79tLzo6gLt4mz4G+rtYWqDeQoTGdsoZhSb7UfytjIgoOnfhEV9DE8moQye 7yZGcK/7qFoVgNjSKkmWw0PWCroP0ug8vgF466wFEoQB+FnNKmkUPY5G3VepIpmAKTe+QM+VM1P K85x4DdgGHEKAEoIV1PpKGtzLhfmOpVBGZi0VOdgxUhnoZXAA8IPnHT5eRVyNPc9U1pXHsc++vc dDE8LYU/EMP422XQOAtFK9Q3CCNMFgJmCf/Q6Cy/GPMu89OB0ZfAtulT7/Lr73+bHpek39FwAT4 zzyiWbDEaJ7/5eUEPN+6athWpDMCn3+tZihRHraDzSnnj4sb+oAKV66Mq9KhBK2aY2Dozehh3+9 1V0gAOBnVmhDVrmC+jz3KYehZh7RWo/bfoEkMHJ5V2HZ8OAiYiwAPzkmhNZyafGFGkAjjzPYMI6 wLsqEMW7xbDL68LN3+AJP8pHq4IUstBw33gr+atlLPknM= X-Received: by 2002:a17:90b:4c42:b0:38e:a555:8fc7 with SMTP id 98e67ed59e1d1-38ea5559070mr4172247a91.38.1784746490313; Wed, 22 Jul 2026 11:54:50 -0700 (PDT) Received: from google.com ([2a00:79e0:2ebe:8:e13f:e272:947f:d8ac]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-13d130a87e9sm7978056c88.11.2026.07.22.11.54.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2026 11:54:49 -0700 (PDT) Date: Wed, 22 Jul 2026 11:54:46 -0700 From: Dmitry Torokhov To: Linmao Li Cc: Kees Cook , Vivek BalachandharTN , Richard Pospesel , Chris Diamand , 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 Message-ID: References: <20260720033030.1580891-1-lilinmao@kylinos.cn> <20260720061259.1601281-1-lilinmao@kylinos.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 Applied, thank you. -- Dmitry