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 7FC6A223328; Wed, 27 May 2026 16:07:34 +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=1779898055; cv=none; b=FX2ljEVYsd2rT2jI6NgbT+AEk8XY9iBrOfuetxiDDl0y9kngEDySLOq4FvC2wDG7hO0LLlHYVBUQ6+FEUimn2gOk5yDeQleELgC3uZsGmb+J6HAUpAPOyj+VV3Yi+G02dhUb10N+erJ2UVAxujn80L33WkK99rBgr0EyfK9uAh8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779898055; c=relaxed/simple; bh=jQxUQxqXDVQ38i3kOKC7Iz08BQGPEPYs34lkaeVW5m0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EcNdzPwVi14oxfny5Sp19OcFe+rLrsCjehdyYh0Cn9Yt4RfQI6isrPA5TdkE76ucOBQuCXLvRJeM1HHG/k8RvK4DWYgw5+bFf47hp92b+3pOZKITi7kwEP/c/opiki0guZGFXmMOl6X8G+5ubMWHWhJvfaUoAGm6tBDcqI0ogZk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ABUJMFL1; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ABUJMFL1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7B051F000E9; Wed, 27 May 2026 16:07:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779898054; bh=G0Froaa75FijA0ZhsFa3lxZ/kcB68VjZUBiIydDsn7c=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=ABUJMFL1/WeRRa0e5FzKBeao56Lr9oVicMADW0iFxGrfgaDNvcqOc61xVMA9Niait /LyMavljqlJzr3nTp0WasrZCSYu3P8GS56fRSXCOijFE4ngIBjiVFIty39vhVns0pH NSRYSFtNPpm+ooaV7v53019pb9i7tCSQnqi0b5WiB4XiRK5b77TFAEitYhiw7h6njQ UvCLK4sWkVwHIyF3io/RpS00DJMVaA/r8tBrgXZvna7ZLCpLSoSHaZpeL3BCw8l5N0 xHx+IMaok1HWK8R8c6LILekK3W1RfsYnydQhoGM5Eg1AutZXDXPX1gQYJhVqy5zWUx R0/UfmRuRsVAA== Date: Wed, 27 May 2026 17:07:30 +0100 From: Lee Jones To: Benjamin Tissoires Cc: Ping Cheng , Ping Cheng , Jason Gerecke , Jiri Kosina , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH 1/1] HID: wacom: Fix OOB write in wacom_hid_set_device_mode() Message-ID: <20260527160730.GE712405@google.com> References: <20260513075935.1715836-1-lee@kernel.org> <20260519111354.GT305027@google.com> <20260521162212.GF3591266@google.com> <20260527155753.GD712405@google.com> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260527155753.GD712405@google.com> On Wed, 27 May 2026, Lee Jones wrote: > On Thu, 21 May 2026, Lee Jones wrote: > > > On Thu, 21 May 2026, Benjamin Tissoires wrote: > > > > > On May 19 2026, Lee Jones wrote: > > > > On Wed, 13 May 2026, Ping Cheng wrote: > > > > > > > > > On Wed, May 13, 2026 at 1:05 AM Lee Jones wrote: > > > > > > > > > > > > wacom_hid_set_device_mode() currently assumes that the HID_DG_INPUTMODE > > > > > > usage is always located in the first field (field[0]) of the feature report. > > > > > > However, a device can specify HID_DG_INPUTMODE in a different field. > > > > > > > > > > > > If HID_DG_INPUTMODE is in a field other than the first one and the first > > > > > > field has a report_count smaller than the usage_index of HID_DG_INPUTMODE, > > > > > > this leads to an out-of-bounds write to r->field[0]->value. > > > > > > > > > > > > Fix this by storing the field index of HID_DG_INPUTMODE in 'struct > > > > > > hid_data' during feature mapping. In wacom_hid_set_device_mode(), use > > > > > > this stored field index to access the correct field and add bounds > > > > > > checks to ensure both the field index and the value index are within > > > > > > valid ranges before writing. > > > > > > > > > > > > Cc: stable@vger.kernel.org > > > > > > Fixes: 5ae6e89f7409 ("HID: wacom: implement the finger part of the HID generic handling") > > > > > > Signed-off-by: Lee Jones > > > > > > > > > > Patch looks sensible to me. Thank you for your effort, Lee! > > > > > > > > > > Tested-by: Ping Cheng > > > > > Reviewed-by: Ping Cheng > > > > > > > > Thank you Ping, I appreciate your review. > > > > > > > > HID folks - any movement on this please? > > > > > > > > > > I wanted to apply it today, but the patch conflicts with our current > > > for-7.1/upstream-fixes. > > > > > > Could you rebase on top of this branch so we can take this without me > > > messing with your patch? > > > > Sure. Leave it with me. Probably be early next week. > > Are you sure this conflicted? > > I just rebased it onto hid/for-7.1/upstream-fixes without issue. Rebased patch here (not sure if it's actually different: https://lore.kernel.org/all/20260527160528.847928-1-lee@kernel.org/ -- Lee Jones