From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 26709359701; Fri, 9 Jan 2026 12:36:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767962214; cv=none; b=ePnhyYV8HhPeLqg7N91VL23sfIbL85UVr6t8vFH7ATwXWi8lzRUYMSwBaHshghCcBDgdVVp9k6GIafAsVts386fL68tkDTHGF2Cug0YNo3eer2hkQrcirrOjt98WPWsYycyHrWHCBzAmO6kr8V+sIMOk5cjnfjSNh5ZN5y8tmag= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767962214; c=relaxed/simple; bh=kUPLV/BQoquMBodr1PHn5HrZBicHOs3B6VE1tDoNanE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Avq4KLuGecOqZn4kJ9CMjOhRUiX+n19RcAEslJxBE1tPcktt3HlyBa/O3sOFAK8OHsOE67+aLN1Bqr7R3uQzzSYCFkf2sqNgu2wkGgeRw9pY03UM4M27Vc5ED6TdKTTyBWrANUhZco3KOUsJusAbFVBP4/IgSnifxwt2LYqdf60= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yYD+5Ug5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="yYD+5Ug5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4EE5C4CEF1; Fri, 9 Jan 2026 12:36:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1767962214; bh=kUPLV/BQoquMBodr1PHn5HrZBicHOs3B6VE1tDoNanE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yYD+5Ug5i4ZV6diiaMV6TUM30BbUfdfFVsrJd+orsmwC5K7ZuEZ4vKCyKoLrwVi5w Mic8GH5PNls2NHd2DmjvNPBoq+OS6Yloy45NyXBZ1OCE7oAoUDwlwfMEm1qey0pOTv XcOFg4bCzij5ot7eoklOeuC7+g6L6BmTgt3+OAzE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Junjie Cao , Dmitry Torokhov Subject: [PATCH 6.1 287/634] Input: ti_am335x_tsc - fix off-by-one error in wire_order validation Date: Fri, 9 Jan 2026 12:39:25 +0100 Message-ID: <20260109112128.330629254@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260109112117.407257400@linuxfoundation.org> References: <20260109112117.407257400@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Junjie Cao commit 248d3a73a0167dce15ba100477c3e778c4787178 upstream. The current validation 'wire_order[i] > ARRAY_SIZE(config_pins)' allows wire_order[i] to equal ARRAY_SIZE(config_pins), which causes out-of-bounds access when used as index in 'config_pins[wire_order[i]]'. Since config_pins has 4 elements (indices 0-3), the valid range for wire_order should be 0-3. Fix the off-by-one error by using >= instead of > in the validation check. Signed-off-by: Junjie Cao Link: https://patch.msgid.link/20251114062817.852698-1-junjie.cao@intel.com Fixes: bb76dc09ddfc ("input: ti_am33x_tsc: Order of TSC wires, made configurable") Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/touchscreen/ti_am335x_tsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/input/touchscreen/ti_am335x_tsc.c +++ b/drivers/input/touchscreen/ti_am335x_tsc.c @@ -86,7 +86,7 @@ static int titsc_config_wires(struct tit wire_order[i] = ts_dev->config_inp[i] & 0x0F; if (WARN_ON(analog_line[i] > 7)) return -EINVAL; - if (WARN_ON(wire_order[i] > ARRAY_SIZE(config_pins))) + if (WARN_ON(wire_order[i] >= ARRAY_SIZE(config_pins))) return -EINVAL; }