All of lore.kernel.org
 help / color / mirror / Atom feed
From: Davide Beatrici <me@davidebeatrici.dev>
To: Benjamin Tissoires <bentiss@kernel.org>
Cc: Terry Junge <linuxhid@cosmicgizmosystems.com>,
	linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
	jikos@kernel.org, benjamin.tissoires@redhat.com
Subject: Re: [PATCH] HID: validate report length and constants
Date: Fri, 05 Dec 2025 00:43:31 +0100	[thread overview]
Message-ID: <8aefde3322ab7676034cae9d291fc5b6@davidebeatrici.dev> (raw)
In-Reply-To: <b3131f6c322ac4c62c4b00142b55fde7@davidebeatrici.dev>

> report 8 has csize=16 rsize=16
> report 0 has csize=1 rsize=8
> report 0 is too short, (1 < 8)
> 
> Which means we do enter the test and execute the memset()...

I added further debug prints to trace the flow after that:

hid-generic 0003:373B:1107.000F: report 8 has csize=16 rsize=16
hid-generic 0003:373B:1107.000F: Calling hiddev_report_event()
hid-generic 0003:373B:1107.000F: Calling hidraw_report_event()
hid-generic 0003:373B:1107.000F: Calling hid_process_report()
hid-generic 0003:373B:1107.000F: Calling hidinput_report_event()
hid-generic 0003:373B:1107.000E: report 0 has csize=1 rsize=8
hid-generic 0003:373B:1107.000E: report 0 is too short, (1 < 8)
hid-generic 0003:373B:1107.000E: Calling hidraw_report_event()
hid-generic 0003:373B:1107.000E: Calling hid_process_report()
hid-generic 0003:373B:1107.000E: Calling hidinput_report_event()
hid-generic 0003:373B:1107.0010: report 0 has csize=7 rsize=7
hid-generic 0003:373B:1107.0010: Calling hidraw_report_event()
hid-generic 0003:373B:1107.0010: Calling hid_process_report()
hid-generic 0003:373B:1107.0010: Calling hidinput_report_event()

The last report is a normal mouse movement.

  reply	other threads:[~2025-12-04 23:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-02  5:36 [PATCH] HID: validate report length and constants Davide Beatrici
2025-12-02  8:22 ` Benjamin Tissoires
2025-12-02 19:41   ` Davide Beatrici
2025-12-02 21:40     ` Terry Junge
2025-12-02 21:54       ` Davide Beatrici
2025-12-04  9:53         ` Benjamin Tissoires
2025-12-04 19:48           ` Davide Beatrici
2025-12-04 23:43             ` Davide Beatrici [this message]
2025-12-08  8:54               ` Benjamin Tissoires
2025-12-12  6:22                 ` Davide Beatrici

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=8aefde3322ab7676034cae9d291fc5b6@davidebeatrici.dev \
    --to=me@davidebeatrici.dev \
    --cc=benjamin.tissoires@redhat.com \
    --cc=bentiss@kernel.org \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxhid@cosmicgizmosystems.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.