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 EA7C94315F; Wed, 19 Jun 2024 13:17:25 +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=1718803046; cv=none; b=cWh13ryA9frgHhPzpczPRn5Lrl4/2GqHbw4m1VH15Lwdv0khbshOh6MM3NaxUGpbu3cr4GGUsi+2YH0U1qyZcAThTa7VXxdUv//era4zsSgSss0jAEXwJtSNvoH/Q5/kq/uvk5dPVBjRfcjY2p7f5+82mju8YK57GAvdy3eRCEg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718803046; c=relaxed/simple; bh=+39HVRNSI9LMu6kKw6KJJgx5VQ/neKwR8Jm2x57wS3o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=U1MIYWzsXDU+utFsQ0UnttkQ7zGz8JzHEcqUNJQfBRXE1vvIDC9WqNBTJY5i1ilB5OeMXwdPBNO8Za0tl9evhp+Ar+/FcHWIhsZmq2E3fCI17LlVwQIUiOS5ezslY5NL30m6SPQBIZNKiZnghAeIfnplEOIEUyRIm+euJIhXFT0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=QFMaMBMt; 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="QFMaMBMt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C5F7C2BBFC; Wed, 19 Jun 2024 13:17:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718803045; bh=+39HVRNSI9LMu6kKw6KJJgx5VQ/neKwR8Jm2x57wS3o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QFMaMBMt0zX9Hz6BrFNHms6/lIABOUtJAQZvYxhW4qGbJw9tw4RcwzGv5h9mMR9V1 /1J0+Ce+vSP3iA/8Q8+nGZvyyCyHjfRnPDMZuGnkyJBJmZ/C0HMdGQJGDXw/LUzQL6 QuwMP6n1vryigP4AwJyE89gMI5yn0Vt7GEGFdbIM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+5186630949e3c55f0799@syzkaller.appspotmail.com, Alan Stern , Nikita Zhandarovich , Jiri Kosina , Sasha Levin Subject: [PATCH 6.9 134/281] HID: core: remove unnecessary WARN_ON() in implement() Date: Wed, 19 Jun 2024 14:54:53 +0200 Message-ID: <20240619125614.999541406@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240619125609.836313103@linuxfoundation.org> References: <20240619125609.836313103@linuxfoundation.org> User-Agent: quilt/0.67 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.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nikita Zhandarovich [ Upstream commit 4aa2dcfbad538adf7becd0034a3754e1bd01b2b5 ] Syzkaller hit a warning [1] in a call to implement() when trying to write a value into a field of smaller size in an output report. Since implement() already has a warn message printed out with the help of hid_warn() and value in question gets trimmed with: ... value &= m; ... WARN_ON may be considered superfluous. Remove it to suppress future syzkaller triggers. [1] WARNING: CPU: 0 PID: 5084 at drivers/hid/hid-core.c:1451 implement drivers/hid/hid-core.c:1451 [inline] WARNING: CPU: 0 PID: 5084 at drivers/hid/hid-core.c:1451 hid_output_report+0x548/0x760 drivers/hid/hid-core.c:1863 Modules linked in: CPU: 0 PID: 5084 Comm: syz-executor424 Not tainted 6.9.0-rc7-syzkaller-00183-gcf87f46fd34d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 RIP: 0010:implement drivers/hid/hid-core.c:1451 [inline] RIP: 0010:hid_output_report+0x548/0x760 drivers/hid/hid-core.c:1863 ... Call Trace: __usbhid_submit_report drivers/hid/usbhid/hid-core.c:591 [inline] usbhid_submit_report+0x43d/0x9e0 drivers/hid/usbhid/hid-core.c:636 hiddev_ioctl+0x138b/0x1f00 drivers/hid/usbhid/hiddev.c:726 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:904 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:890 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f ... Fixes: 95d1c8951e5b ("HID: simplify implement() a bit") Reported-by: Suggested-by: Alan Stern Signed-off-by: Nikita Zhandarovich Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/hid-core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index de7a477d66656..751a73ae7de75 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1448,7 +1448,6 @@ static void implement(const struct hid_device *hid, u8 *report, hid_warn(hid, "%s() called with too large value %d (n: %d)! (%s)\n", __func__, value, n, current->comm); - WARN_ON(1); value &= m; } } -- 2.43.0