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 1FC082D0C7E; Mon, 13 Apr 2026 16:35:15 +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=1776098115; cv=none; b=IxV3SmwduL4tiCsgp2Q85XnBL58ZyqiJu/3CvbtPEW/PM/XHYF/SBhuxQS1ZTfZVcXOX+I/MBoCGFgi3+oLDQRBG6LHxim6HxlztWCSI0AyHvE8Keyi61c3UX+YuoF3YX2w2uD7xVEXC6Re+6vxHn70LYXxd/p2WRvzu94mjENk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776098115; c=relaxed/simple; bh=kIHF5fB7/L9qljiVITm1u0pLczfT4MBNRy08SM1YARg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NpvvvsBbBxGNfBCe79wn7r4hEY4JOMa1AIdoO/ecjXYODShxYKLSKzlXv2+sQ7ZnBwgLAnqRVmV+l9XcKmsDna0j4iDEaE1hZsdG9e9UwtpR2iLIUUqmkcO+Tn2Cu3bAVCAGFSp9pYjD6O/1PZ5ZoEEL4PlBe8sMJAtZzzRASdA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=2DVgtU2j; 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="2DVgtU2j" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABD9CC2BCAF; Mon, 13 Apr 2026 16:35:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776098115; bh=kIHF5fB7/L9qljiVITm1u0pLczfT4MBNRy08SM1YARg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2DVgtU2jcHBQtfYoGaRK6asFcvBNeLomMSP2nF5loIuPVuQPqWp5dctP/hfXrdnow eoM77YOoUYDMdhnLY+x2twKRbVbBKS/FVI00B9ebSlr/LbkrkjfRjhx2G5NGMEQtfG 1lqvKk17qHaX8f9KOvHcEcqAZxU+wUGTyQxnaUEw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Beno=C3=AEt=20Sevens?= , Jason Gerecke , Jiri Kosina , Sasha Levin Subject: [PATCH 5.15 398/570] HID: wacom: fix out-of-bounds read in wacom_intuos_bt_irq Date: Mon, 13 Apr 2026 17:58:49 +0200 Message-ID: <20260413155845.380987541@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260413155830.386096114@linuxfoundation.org> References: <20260413155830.386096114@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Benoît Sevens [ Upstream commit 2f1763f62909ccb6386ac50350fa0abbf5bb16a9 ] The wacom_intuos_bt_irq() function processes Bluetooth HID reports without sufficient bounds checking. A maliciously crafted short report can trigger an out-of-bounds read when copying data into the wacom structure. Specifically, report 0x03 requires at least 22 bytes to safely read the processed data and battery status, while report 0x04 (which falls through to 0x03) requires 32 bytes. Add explicit length checks for these report IDs and log a warning if a short report is received. Signed-off-by: Benoît Sevens Reviewed-by: Jason Gerecke Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/wacom_wac.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index 0ab473f372ad0..0cc979d99b3d8 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -1258,10 +1258,20 @@ static int wacom_intuos_bt_irq(struct wacom_wac *wacom, size_t len) switch (data[0]) { case 0x04: + if (len < 32) { + dev_warn(wacom->pen_input->dev.parent, + "Report 0x04 too short: %zu bytes\n", len); + break; + } wacom_intuos_bt_process_data(wacom, data + i); i += 10; fallthrough; case 0x03: + if (i == 1 && len < 22) { + dev_warn(wacom->pen_input->dev.parent, + "Report 0x03 too short: %zu bytes\n", len); + break; + } wacom_intuos_bt_process_data(wacom, data + i); i += 10; wacom_intuos_bt_process_data(wacom, data + i); -- 2.53.0