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 3BE902F5328; Sun, 1 Mar 2026 01:49:20 +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=1772329760; cv=none; b=pO0bYIjYmWVMX3x1oA6kwH7eJbIMZkkU+b5IaUhl2xN/MqYsDv8DGu9B4nC/5glXdC9fy1Jw4addGQp8USmfRXXTuabMOL4jlN9/KjUeLbGUyS0KIH4vRTNQWJn24FAJQFDlMkL72YGeQCs+SVPhYjjgXVNBkrLYtd2cCK18tQE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772329760; c=relaxed/simple; bh=pIDYsAU0QFaDBCZp0mEOqVf03EEnJQaA4N+58a45G2I=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=GMKjeEzYWaKHyU9F4cFwGISnSFh2ekYXWjum7bdY7AqylXotc4eLiyGa2AVyRs+qfEJ/u+hPbadAuAtfKEcBxqbxzHlJMKXqwE2eM95SfuGM3bwRhe2BwrB5hwx84rranqSIK5nxf08xysXLKvHKPNEhWn2HZYrUBShixCx3n3w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BVrZZ7E4; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BVrZZ7E4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A161EC19424; Sun, 1 Mar 2026 01:49:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772329760; bh=pIDYsAU0QFaDBCZp0mEOqVf03EEnJQaA4N+58a45G2I=; h=From:To:Cc:Subject:Date:From; b=BVrZZ7E421r75ZvCzRJlmdSZcxZy60NMYa6aa5iRGjwclaWp7kvGHaq0pZmRpzvtu 1TmtQWhZvLpof6mZU649EjDTVFa/xfm+s6GEeeLZrY4g6PrsxF7RvfTvQcRuHN44rY TpodiB6hwJPf3hIxS5bF/9j+jo7QbcUPyZ6VS6KvJWFAw3LZgWOemvx9h5RpBxd4ua k8+OoINbnfUhOEhavVe4nWW9wq0ATLNhJH5sgtVI0kj06lRjmjiY87Li+5MSfY5sXT VYYLjZLSYOeK7QzVvSFFkzfagIPXSwHQKEyscnvpQ6PvWaCIvXTxQzitlt1rPdejEA fexqNmhqGE8vA== From: Sasha Levin To: stable@vger.kernel.org, gnoack@google.com Cc: Jiri Kosina , linux-input@vger.kernel.org Subject: FAILED: Patch "HID: magicmouse: Do not crash on missing msc->input" failed to apply to 5.15-stable tree Date: Sat, 28 Feb 2026 20:49:18 -0500 Message-ID: <20260301014918.1713730-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Hint: ignore X-stable: review Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.15-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . Thanks, Sasha ------------------ original commit in Linus's tree ------------------ >From 17abd396548035fbd6179ee1a431bd75d49676a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Noack?= Date: Fri, 9 Jan 2026 11:57:14 +0100 Subject: [PATCH] HID: magicmouse: Do not crash on missing msc->input MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fake USB devices can send their own report descriptors for which the input_mapping() hook does not get called. In this case, msc->input stays NULL, leading to a crash at a later time. Detect this condition in the input_configured() hook and reject the device. This is not supposed to happen with actual magic mouse devices, but can be provoked by imposing as a magic mouse USB device. Cc: stable@vger.kernel.org Signed-off-by: Günther Noack Signed-off-by: Jiri Kosina --- drivers/hid/hid-magicmouse.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c index 7d4a25c6de0eb..91f621ceb924b 100644 --- a/drivers/hid/hid-magicmouse.c +++ b/drivers/hid/hid-magicmouse.c @@ -725,6 +725,11 @@ static int magicmouse_input_configured(struct hid_device *hdev, struct magicmouse_sc *msc = hid_get_drvdata(hdev); int ret; + if (!msc->input) { + hid_err(hdev, "magicmouse setup input failed (no input)"); + return -EINVAL; + } + ret = magicmouse_setup_input(msc->input, hdev); if (ret) { hid_err(hdev, "magicmouse setup input failed (%d)\n", ret); -- 2.51.0