From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.176 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796017350; b=4L4zXptHMyBj1mO9NjmIDnSfyf5Hz8rS9rfr//GhdzCU3QwNFm2r1bFFzNJB+znMYPNL g/VOBgxFPwiU8jN1ltLD2fqVKSP0qoi1n7R1iOMKHHbeIYwMeA2m3/CbHlVz9WCyIORtW u9qBmd7t5ZlOdbeja1t6AHX+djD3vVs2Ljyu9koTCv3Dp+fTTh0whm/LbvMnian0Bo8ji /9SiUXjGek32yQTDawdrU3rCWNBgQ0lt7Yx1wN2ZHnUSeVpaISP4SCJyJA6znvsLrqv6V eGORLskb1RjTpgBWsCI9/MQuekRU9Ahh8uv1thOAiVpTSmYaNIjKNto1vfMdosa6Yjg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796017350; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type:Content-Transfer-Encoding: Content-Disposition; bh=pLQ6qXoF1253La/nJQ8AF4SLvLLCKBgjJsfaZKm9KQw=; b=pwsy06BIt2+bCqX9FCC8OW3qjzE9iIJ6d9MoqYaZAFIF099cmtnZn4YCvVSQ01z+4vt7 4n+7l3T0eEMkDl03KZ+xQR4Lfy66GmvpjLtycC8lUANwcZeORk1KF2DFN0HdhTRsWO124 w93hukU4pKQRgujHLtDc95ZW1aLqJHjDWXh5AF5UU/mk+8E/sXMU9j2hev/OJnPKfLFx1 rRolZx9tJ7zDIcpJtCyPCfc5EdU28mwo1nfUxIti7+jIvfnYg8VxxOYPWnLXZ7OO8/DP0 jw/Gkeco/Ip+oESsFM/VuITJdz0lGXevQNydvG+/sdpc1oysh0C76F7ZT6G0vToW2qA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=UosD442j; arc=none smtp.remote-ip=74.125.82.176 Received: from mail-dy1-f176.google.com (mail-dy1-f176.google.com [74.125.82.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D760606A31C for ; Mon, 30 Nov 2026 05:42:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3D760606A31C 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.a=rsa-sha256 header.s=20260707 header.b=UosD442j Received: by mail-dy1-f176.google.com with SMTP id 5a478bee46e88-380c28f9e35so10996366eec.1 for ; Sun, 29 Nov 2026 21:42:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796017349; x=1796622149; darn=vger.kernel.org; h=content-disposition:content-transfer-encoding:content-type :mime-version:references:in-reply-to:subject:cc:to:from:message-id :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=pLQ6qXoF1253La/nJQ8AF4SLvLLCKBgjJsfaZKm9KQw=; b=UosD442j/Pu3z2wPczfAc5eUAF+yy5hJLSgcpqSjNguKQNcXhCudBPP3oqtnqw1xnb UUosQ1Doy1qk25inxAWUwVZUVW33oVoGoIlGmlDmd6iQ/orwju0cLTyWeX04Jin8a6SY sptO2SZvtrw8IlHZNECkfHDGktfIYavfwqdn7JArpwV7XERBY/TBIqahfTmyXhBTeO5j 3JE2T0bZpHqugkUpCAf+qbXPYmhw2gAKRqLb7Golfko9nzzpcSW58EwZaI4LSC/Y+Wa/ j0HB3RyQwQ4RVyCK6WQlU6+tJu5NWOMFHnNMYmW1yZpXn6MvRZ+GOP73j370qpd/jnJo fr7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796017349; x=1796622149; h=content-disposition:content-transfer-encoding:content-type :mime-version:references:in-reply-to:subject:cc:to:from:message-id :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=pLQ6qXoF1253La/nJQ8AF4SLvLLCKBgjJsfaZKm9KQw=; b=tCheOJzkKOomZx8ahcxeZ6FuVbbL2iH6HIERMfl1GnxnJW/OONrbwi2wLdhGeu8WQ0 ggBeUe8aa8kEMp3ZMHZQPEe4GY8D0Wl5R2kDRdXhp5zvGu6+FfGntOCqmHDsTc3MPEdA EcUj3pkQiQWHiF02AQf8F0MtkdNMSdSr6aK5nMaSYdOee9HFuhdG+RGM7lTLIdUH12sz a3YAsedCyzqQDx+hgj3oFKQ10SHWzEjh5tJkP+yLMsdHyIMKM2JRIMBC1s2mk8kt8bvT 7vl9Vf10GxSCsCwzXjXvxDFcpOE39AvUM4rqpsOtf7eXf+mUkFqHIyTwnMy3lbY+f4Lq JRJA== X-Forwarded-Encrypted: i=1; AL+hErH24vJuQJYmE/F6hO36dxuu6YoCiq50S0NotCSKRXIGsaExs+BgvQVn1N6ye0WntuKOqpg0y7a4mAnixUc=@vger.kernel.org X-Gm-Message-State: APuU4Z+7IlcdF9KZ4Gd1/gnIcUqrikFNpS1SkIeGxilT/ERZF1JO/qz8 elRazjX36VQC7Mm5gyPf1zVAWFu32e6ixHmslWHbTdjgwZexxmzOvgLr X-Gm-Gg: AZFdTZd9UW5LYWvyrynwppiWb1Efn2e8SaN44fnUc1aEjchM1gIL6581Vuy3W/7thOK 0jWeXRmGzY6xRRx0C3SFcUEOb8/7/1hMSjt2BbYVvtswNhXzUEWOBQOMVzMR4qhJ98GMtVCHMYW vGn1IdwaBsI5aIAmwkmCfGcWHUlYrEDFWpU/u3+x4PopXJgfqInSNm89dwxQXqT+G8qGEs9JcAq MchIY7KBFXXko4NVYYjxR+Sv4SGyUJb3iuLF95GxgmMZtAiACFg6ZpzVs0AO7yQMuTiA1yXv6ct ktsab7Px54J/z0ptpZlR6VAszvAcafCQlZSbQOTp8gFIS0fu96AomoRf23ZDNAWnQiWgl5rKGGy 69+ak+ncQi+FjIjKkgMnTpbROMzJ4GtF1wl/3BcmL6psnF2nxwycf5a/17UCWfqoFWhddhtqBAq ePkJ64yRUhVk4cFBtahqBAzWTMJEsIonmRglkeQdNAPa9/98TZKSvbWo/32Eb2eMbMXdVue5PDD fv5Wniod89AovTPNlBC+6KqQoXNHKdgdy2hCAeSQnWBDY7/AYJ0DpmYQoid1JCssyIyQIUK+UR/ fiI0WvUAsTpkgZGphxQzQnD5+dgrv1Ujram77+10LsDYfauJTa0BKOl8IXB/ZPBAZuPi X-Received: by 2002:a05:693c:408b:b0:377:82e:2d79 with SMTP id 5a478bee46e88-384b39896edmr34970611eec.9.1796017349331; Sun, 29 Nov 2026 21:42:29 -0800 (PST) Received: from localhost ([2a00:79e0:2ebe:8:ba7e:5b43:81b2:edf]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-386f6651e2asm22146127eec.27.2026.11.29.21.42.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2026 21:42:28 -0800 (PST) Date: Sun, 29 Nov 2026 21:42:27 -0800 Message-ID: From: Dmitry Torokhov To: Lee Jones Cc: Vojtech Pavlik , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH 02/10] Input: adi - validate axis and button counts in adi_id_decode() In-Reply-To: <20261127201050.3532488-3-lee@kernel.org> References: <20261127201050.3532488-1-lee@kernel.org> <20261127201050.3532488-3-lee@kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline On Fri, Nov 27, 2026 at 08:09:56PM +0000, Lee Jones wrote: > Reject packets that would underflow axes10 or buttons, and verify that > the decoded axis and button counts fit within the corresponding > adi_abs and adi_key table sizes. > > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") > Closes: https://sashiko.dev/#/bug/linux-92046c21-e0a8-4274-a502-20ca723131b1 > Cc: stable@vger.kernel.org > Signed-off-by: Lee Jones Adding two more parallel arrays to track table lengths next to the existing three is pretty awkward, and the "adi->buttons < 4" check is also slightly loose since it still leaves adi->pad unreachable in adi_decode() when buttons is 4..8 on TPD or 4 on WGP. As mentioned on patch 1, I already have a larger adi rework that replaces the parallel arrays with a single descriptor table (along with other fixes and cleanups), and I do not think this needs a stable tag either given how few systems still have gameport adapters. I will post my series shortly and CC you on it. Thanks. -- Dmitry