From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.180 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796017350; b=5Ws41GXmnWJBGZRSYgqJh08peJWv0Dyk04tZDJEtChsQSQIAgSuW7YLCs3ZGmWSHff/K Qm9IikiiabMDxHftlxyQ+gyrR5OoQ4ry8Pb6lxuAXcngeyCbdvm3XBffDYXEYoiKJlULi xlOI7zqo7dOXfyXAl9FkvguzEaqHmGU9t3xL0ddKB+jAfamfPKFbLknZh1CxxRsMMDRnv /hsuDYugGg9YQKI9JHL7MogPS1ga7Sbrw+p8BYVRoiq/G9irQiG6vZRK5ZKCGIhyIaEVG clwc8fYfM3mDPcW8xC8Y1KZd+p8w/nJTPDUiSndfTV8ut9i0HI8BCiqJS+ioLKLQ8kw== 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=B9yGvbwj9sum38jCP4krnucHwIzWW+JNYsLfMMuzgGJdglimRGz1FCTsOG3zkx4+Mswf jl7+INBgqMp9XYvHZJ1mOiucC64L0C+xcysP06Nej3SJ+2H6mXqRR5nwIxslDBv1VBra7 FpBqn9HExRALF+pLuNW/FRrj1CA0a6AHvzj2/rcgMPJrSOEIFEGc01u5FQBQYOhwnMQ/B i/d00glLhmYyXP6/UfgBdjz95EczEvxwlpezsYqsiu9xUegphxJF6YTf0fTapOfwWuCZF aEjtHQktGjfNcRZCnE9VigRuncFzzT0xuKIAnkJJD6LRPqmw0DY5fY0p1kU3vhK8BUg== 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.180 Received: from mail-dy1-f180.google.com (mail-dy1-f180.google.com [74.125.82.180]) (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 4ABF8606A325 for ; Mon, 30 Nov 2026 05:42:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4ABF8606A325 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-f180.google.com with SMTP id 5a478bee46e88-386c336eab8so7093136eec.0 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=UAZRuEviQ8feHi76WbYeDd3sp4zd4ZOXOk1rPmlutZK33EDzxF0Y2UpzlB15Ps3ehk A4M2VSYzw0s1QN+piOwyWAC2qPJbxqNF5LnV8gNoV8OrsbJSFsDExZEd4ifFCKCEDTtd RBLeqyLV10nP04tdmsjNaENMDvAu3UtFaLvlrucbTfSP4ojrAn+18BHvqzxGDVd81L30 XGrmgNZpw56Xd/y38bmlJIRyz8z1XXHmI92inABtzzk4qC14TeLTR+muQs2tIMeg5I9i 7GI4hKlG8jAXR9/eA+VslK/N7li++nWRNFOWIiEqT6aDGGB83F6KrWh72Ob1ZpqnfKcb piMA== X-Forwarded-Encrypted: i=1; AL+hErHK/fPoaSXiSs7fQ9h4Y7aRfMpCwyaT5gxAcU9GXac4YJ0okE8PEEjlfpi9SzSb/DLPIPH4cyNrMr0kUw==@vger.kernel.org X-Gm-Message-State: APuU4Z/oUkssg5bHqKzYDFko6qaxFbcGv9odCwyoJ7lET9Sxltjzdzpt VtCaqLnOrsKYLAPYYuje5HFoO8ewuB643eUd0SYhXADCFSpYMNMbj/YP X-Gm-Gg: AZFdTZdYfwrjvbdV2ikTaOqGAFLtYELegvJzOxBRklkbr76d5U1xZrFSmYWZHoAjPNZ X40ZjVfHsQOZ9EjmNxtSkSfSbWYnHce4Yyf0DmNbRRelzAA691RubxgLDdn9DZHZJR/LhYx1krc 0kD6GcAJMx5aNO19PDwBfiVRGm4BwXdY2cwXOf4JjTDB3bVPM9djoKtVn3/f6QaR33EPXBd6Hx3 bEoIL4FebeMYBxBAXCRqKqDf9vYrg0SGqgcD0bO59YLLEGkXDUHnR7q8F2a2xFJIpqWCqd/vVtW cEj4JDo/VbW/rdzMdXiF1kS/hwhBm7XQxVnMiQ0AScS4cGnCOfMDvVJQxyRYZOEtsQbF2fc0cbT kYl4ZqsjPsz4pA/v5y6k3253xR/TXaPa1hG/rhoSFY0O8Q6IbcwBuqOspitX6mLXca05pBOQCsq osVwqRqDGjFXUMHrqlE51efaq9u0kKHD8EIE8v4S9VkhiFFfGS02jj5bPHw8+km/2cp135FjaXw gM/XHgMTTylIVS0Q8DZao66zs9q8fkYyCKnCc5fWWDmLDeZ9CJ4K/ocBYQaOG3sY+nDaa9Q9fD5 ViuBhM2OQ9dNMkSf+5vUyDFw5Zs6U+HsCz4gDb0N8p9vAIR76BY3jsd9ik2UJqXVEYVo 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-input@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