From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.175 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796017350; b=vaY7+xZNJxDUaF0Ia0l5IhSSUA0wOl8SPn2eevxPWx+m5q+XgmAet44hLwkRzR7Jz4NG xoq0N4TenqzGF+gnRbRRzkDVlMN03ar7jtI483OiQvNs3+7WJlmgMV8RWYR0dFqaCMrXL Z5CiR2mwilSCyR3PNi/8hTuL48mEzmjGosTz/WkDCgqRcVYT0ETPchny2V5UYYW8KpIwA gqvopdstyzykdWuTAbCCkXbfcykl7xAnZa9g2/1QZkxMZpC1ADsgmgt8newHBjlZBYbQS gUKelFGttxu5Eljvnmo5aDZJCXe7ArmyRDX9IJkNuLHgOeJwHYLZtnhyewtPZpDjK8A== 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=Idp3+l6Mrok/mNQI5yqom9KKD7XwuVdq8XBaf1uHQ4YQk6iUSzrrcEj/Iqsx9s6NcRKw 05uOe2EzOmAMIcCkIUJ1YDNbAx5oFYpAMu3q4aZ62z1y9IhJs9lAdgNxKrS+6Ega2zl9S VSf+Gp5KmCRlJbe9t9rUCqlLCkFJHRGqaICRa9r5Lrllj1hccx6jAlHoQn4ZBr39YzcLw M1jCaG4qGnTsB6iqM3IeIrI05sPdvb2yP9l5JDoBfPUYgiVs1oWF2rCWmt29L1D8knhTN VTxT+u4IVQ65bhASduV3qG/NLNSwa91t/8GhuNpMf6rilgvKS09+9mKv1tSaiFoTXEw== 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.175 Received: from mail-dy1-f175.google.com (mail-dy1-f175.google.com [74.125.82.175]) (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 4C940606A331 for ; Mon, 30 Nov 2026 05:42:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4C940606A331 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-f175.google.com with SMTP id 5a478bee46e88-380c28f9e35so10996367eec.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=oLN1gF2mWAzGl08RedPSo7BDXfCEMhxr4YrixcYDvc/5Qryeq7NBYhQ1iW+dBEmsxS 43nfkZpsTK0m62U0gMLBdz3/phJQCRtRoTMf3es0cJ3Qq/LUAvZQcPxmctYDiMbMqoZQ va10HKR7Wfyundd6J3QR1jip3txQoxJpLGdKwC078TEGT1S0sDsbHPtvUTa/IYrAjm2u TcN1JTCpvaOBPOKs2hJ+ROf6fdYbx8CIuvlbSXyvRQZqciwS9mVBf5w+b697+AplsJTx ozdU1gTyloJWXt6/4eEg4aWH1agjsg0WBHUO4YNgMdji9YUxSTqvMZ+tRaN2F1XYglSP mstw== X-Forwarded-Encrypted: i=1; AL+hErGlEpt1UJFgaYYAIThkHsO75Xi+X88TSYY8sye0rPMEkAc1ymmC9LTLeK0Pekb+EzlPpZDwYQg=@vger.kernel.org X-Gm-Message-State: APuU4Z+s9bEryeygl84stQigvJTzF2vje0kn07mp2MutoInW/Qc0K7Li eXpsNgTmlk9uJ/u/o/Ht5FAs1JDMrkwwo4MV83u6dkksq59Zp3zTgIt/ X-Gm-Gg: AZFdTZewG2j45YF0N4q+KdxeplRpFSABNqb5gSWl2ncRwo4UIvvxaeLaBI9N1qrAXfE Q2omvlENwqjERIXD1pWLMK8UUy1PDEtalTbVYJkheUkRVDGwP/s/Lp6A0jkrhUasVk+l+f944pO siunRfn9k+WEpg6FpFvKXjCCk2W5WS+ugNG2S36LwQrXt98dinySZ87GFPorDKd99y4Canfpmnw IvHZoSMCw3H3k+JEp0m1g7mrDiVnnRGpDnRLls6wOfJlaVwFSdfj8yVPmU+TU+/Kt2vd6qIkjJ2 gQhqWLYBZGTZNmFwVjZ44B2PnNfPLWs3UEGKpEoeE4XHCOxYW01Ce+irMr3oQ6k6kL6OGSOloGe DVoCqNRA48E6H+pyH/C0dUCCQ6QbZ/4W+PjvKIzJR0VdtXuTNli+RgMqGdM+VohyKse7hghXWnE b0ikcX226jgJ2GCAt1JzOskQKuMvrnEJ6vklkqeD3znfppXUB7APuVKoXMdXr97YqGtbSXAJANI hDPmkHgXytkjHrPpHaZBoaQBbUjxuoDx8/NX7zqQPKkNqJInS9WYMr7niKIFAXZ+WRO2q/0oqx9 SpC1UCF2FM8HcOerwFERCgV+zclfXCVaHEPKxWNkE1WQlnDXcrXqZ6U6J0Nq8QXSwhcf 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: stable@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