Re: [PATCH v2] HID: intel-thc-hid: intel-quickspi: validate GET REPORT response size
From: HyeongJun An
Date: Tue Oct 27 2026 - 05:46:20 EST
Hello Even,
Thank you for picking this up, and thanks to Rui for testing it.
On Tue, Oct 27, 2026 at 10:58:20AM +0800, Even Xu wrote:
> - qsdev->report_len = sizeof(body_hdr->content_id) + input_len;
> + report_len = sizeof(body_hdr->content_id) + input_len;
> + if (report_len > qsdev->report_buf_size) {
One question about this bound. The DATA case accepts a content_len up
to max_input_len, and the GET response adds the content ID on top of
that. A GET_FEATURE or GET_INPUT_REPORT response of the same size then
gives report_len = max_input_len + 1, which this version rejects when
max_input_len is the larger of the two lengths. v1 compared against the
allocation, which has the output report header to spare.
Can a response that large happen? If it can, comparing input_len would
keep the same limit as the DATA case:
if (input_len > qsdev->report_buf_size) {
Best regards,
HyeongJun