From: Alec Hall <signshop.alec@gmail.com>
To: "Jose Villaseñor Montfort" <pepemontfort@gmail.com>,
linux-input@vger.kernel.org
Cc: Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <bentiss@kernel.org>,
linux-kernel@vger.kernel.org, Alec Hall <signshop.alec@gmail.com>
Subject: Re: [PATCH] HID: magicmouse: prevent unbounded recursion in magicmouse_raw_event()
Date: Wed, 15 Jul 2026 19:04:59 -0400 [thread overview]
Message-ID: <20260715230651.12456-1-signshop.alec@gmail.com> (raw)
In-Reply-To: <20260715053526.574725-1-pepemontfort@gmail.com>
On Tue, Jul 14, 2026, Jose Villaseñor Montfort wrote:
> A double report only ever wraps two normal reports; it is never
> legitimately nested. Refuse to re-enter the DOUBLE_REPORT_ID case from a
> recursive call so the recursion depth is bounded to two [...]
Reviewed the logic: gating re-entry into the DOUBLE_REPORT_ID case on the
new "nested" flag caps recursion at two levels, and since a legitimate
double only ever wraps two non-double reports, valid traffic parses
exactly as before. The guard placement (before the size checks and the
split) and the wrapper preserving the callback signature both look right.
I also stacked this on top of the pending Magic Keyboard/Trackpad battery
series and ran it on a Magic Trackpad 2 over Bluetooth: normal pointer plus
multi-finger gestures (which drive the DOUBLE_REPORT_ID path), and battery
reporting, all keep working with no regressions or splats in dmesg.
Reviewed-by: Alec Hall <signshop.alec@gmail.com>
Tested-by: Alec Hall <signshop.alec@gmail.com>
prev parent reply other threads:[~2026-07-15 23:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-15 5:35 [PATCH] HID: magicmouse: prevent unbounded recursion in magicmouse_raw_event() Jose Villaseñor Montfort
2026-07-15 23:04 ` Alec Hall [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260715230651.12456-1-signshop.alec@gmail.com \
--to=signshop.alec@gmail.com \
--cc=bentiss@kernel.org \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pepemontfort@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox