mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Xu, Even" <even.xu@intel.com>
To: HyeongJun An <sammiee5311@gmail.com>
Cc: "jikos@kernel.org" <jikos@kernel.org>,
	"bentiss@kernel.org" <bentiss@kernel.org>,
	"srinivas.pandruvada@linux.intel.com"
	<srinivas.pandruvada@linux.intel.com>,
	"Zhang, Rui1" <rui1.zhang@intel.com>,
	"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: RE: [PATCH v2] HID: intel-thc-hid: intel-quickspi: validate GET REPORT response size
Date: Wed, 28 Oct 2026 07:24:18 +0000	[thread overview]
Message-ID: <SJ0PR11MB770409A05C3F3D6C45CC53AEF46F2@SJ0PR11MB7704.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20261027094124.223069-1-sammiee5311@gmail.com>



> -----Original Message-----
> From: HyeongJun An <sammiee5311@gmail.com>
> Sent: Tuesday, October 27, 2026 5:41 PM
> To: Xu, Even <even.xu@intel.com>
> Cc: jikos@kernel.org; bentiss@kernel.org; srinivas.pandruvada@linux.intel.com;
> Zhang, Rui1 <rui1.zhang@intel.com>; linux-input@vger.kernel.org; linux-
> kernel@vger.kernel.org; stable@vger.kernel.org
> Subject: Re: [PATCH v2] HID: intel-thc-hid: intel-quickspi: validate GET REPORT
> response size
> 
> 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.

It's a valid question.
Based on my experience with enabling, touch vendors typically leave some headroom when setting the max input size and max output size, and in most cases, the packet size doesn't reach either limit.

> 
> 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) {

Given that we've left enough headroom, this is a good suggestion. Let's go ahead with it.

Best Regards,
Even Xu

> 
> Best regards,
> HyeongJun

      reply	other threads:[~2026-10-28  7:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27  2:58 Even Xu
2026-10-27  9:41 ` HyeongJun An
2026-10-28  7:24   ` Xu, Even [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=SJ0PR11MB770409A05C3F3D6C45CC53AEF46F2@SJ0PR11MB7704.namprd11.prod.outlook.com \
    --to=even.xu@intel.com \
    --cc=bentiss@kernel.org \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rui1.zhang@intel.com \
    --cc=sammiee5311@gmail.com \
    --cc=srinivas.pandruvada@linux.intel.com \
    --cc=stable@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®