Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4669439ybv; Tue, 11 Feb 2020 00:59:38 -0800 (PST) X-Google-Smtp-Source: APXvYqy+0W9Zcp/MIKlUhXrgw3wL6H1U6SHOHk2bJRzbushNCeulXwr3CASzc2wR686JGjmABDPm X-Received: by 2002:a9d:1928:: with SMTP id j40mr4491426ota.68.1581411578281; Tue, 11 Feb 2020 00:59:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581411578; cv=none; d=google.com; s=arc-20160816; b=lK42wqKn+VnlNkKtCysoVghEC434q10XCZ+2zXO5F9l/bO1yaUNujaXS5dDqA3FqZm GR/jAYm8g8JX08yu4cjDNhB3dfCoub1TgKbwSSwP6Qcyis43yqzIoi1oLd2S2qUUbPaj DgGWC9ufJ45dTrIRiRY6B2/FHD7oaSt5IteVBiEK0iLNguTp76lSsAKSL+kbLapvwxKX 2geqtgMAJvfyWM2IHLmQEA7UwCxhTlojWTRmOLKOimxhP6qRFTWja66sxjYG/c5/mzG1 dK246tXbuFaocPchixneNQZ2eyyr936w8T5AIDqrxsKyfg1ybNMwAr9yXcqd5A2nSNtd mXYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=LEOm2cqYV0lNSH+T19xbcHwiyd2M2JK+xNaVn36bDvE=; b=hdvTC5VxbXGt0Pd84fW5kV6fGmQuyNfUMLOAdBNVNqW/CgVq9KhJPcQAa470OV2oHT Vh73e91oVCwy9uJ/MRDf2jNxs6CzQ4sESxDhApmdpINRarlFjo3dROTJ3ZvTq80oMStr UsaPL9SFT8u6c8/HIuGRTlQ81FdA98uK/iuIOt9d8lMBKAfI5BIcCCIAbqZZBxI1tYZT De0dTIHqvkzp3yz3IJXqtmRj17QcwYCBNl07WpCl9LhnEKCNt1s36yRkJA3Gc51+7gmC ZBYVUSxfsvpbJjSicAcYCUftg3K1SlpK1902ATFW1G1iyz+fb2J5dI+NQEJad4a2oYPh FaSw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sony.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l17si1698309otk.218.2020.02.11.00.59.26; Tue, 11 Feb 2020 00:59:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sony.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727945AbgBKIfF (ORCPT + 99 others); Tue, 11 Feb 2020 03:35:05 -0500 Received: from seldsegrel01.sonyericsson.com ([37.139.156.29]:4107 "EHLO SELDSEGREL01.sonyericsson.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727264AbgBKIfF (ORCPT ); Tue, 11 Feb 2020 03:35:05 -0500 Subject: Re: [PATCH] HID: Extend report buffer size To: Alan Stern , Johan Korsnes CC: Jiri Kosina , Greg Kroah-Hartman , Kernel development list , References: From: peter enderborg Message-ID: <91e0077e-b229-e43f-6f5c-5088b0c0f561@sony.com> Date: Tue, 11 Feb 2020 09:35:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Language: en-GB X-SEG-SpamProfiler-Analysis: v=2.3 cv=V88DLtvi c=1 sm=1 tr=0 a=T5MYTZSj1jWyQccoVcawfw==:117 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=IkcTkHD0fZMA:10 a=l697ptgUJYAA:10 a=z6gsHLkEAAAA:8 a=fs2oqwGesLN0DGMJwG0A:9 a=QEXdDO2ut3YA:10 a=d-OLMTCWyvARjPbQ-enb:22 X-SEG-SpamProfiler-Score: 0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/10/20 4:01 PM, Alan Stern wrote: > On Mon, 10 Feb 2020, Peter Enderborg wrote: > >> In the patch "HID: Fix slab-out-of-bounds read in hid_field_extract" >> there added a check for buffer overruns. This made Elgato StreamDeck >> to fail. This patch extend the buffer to 8192 to solve this. It also >> adds a print of the requested length if it fails on this test. >> >> Signed-off-by: Peter Enderborg >> --- >> drivers/hid/hid-core.c | 2 +- >> include/linux/hid.h | 2 +- >> 2 files changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c >> index 851fe54ea59e..28841219b3d2 100644 >> --- a/drivers/hid/hid-core.c >> +++ b/drivers/hid/hid-core.c >> @@ -290,7 +290,7 @@ static int hid_add_field(struct hid_parser *parser, unsigned report_type, unsign >> >> /* Total size check: Allow for possible report index byte */ >> if (report->size > (HID_MAX_BUFFER_SIZE - 1) << 3) { >> - hid_err(parser->device, "report is too long\n"); >> + hid_err(parser->device, "report is too long (%d)\n", report->size); >> return -1; >> } >> >> diff --git a/include/linux/hid.h b/include/linux/hid.h >> index cd41f209043f..875f71132b14 100644 >> --- a/include/linux/hid.h >> +++ b/include/linux/hid.h >> @@ -492,7 +492,7 @@ struct hid_report_enum { >> }; >> >> #define HID_MIN_BUFFER_SIZE 64 /* make sure there is at least a packet size of space */ >> -#define HID_MAX_BUFFER_SIZE 4096 /* 4kb */ >> +#define HID_MAX_BUFFER_SIZE 8192 /* 8kb */ >> #define HID_CONTROL_FIFO_SIZE 256 /* to init devices with >100 reports */ >> #define HID_OUTPUT_FIFO_SIZE 64 > The second part of this patch is identical to the "HID: core: increase > HID report buffer size to 8KiB" patch submitted by Johan Korsnes a few > weeks ago. You might want to submit just the first part of your patch, > or not submit anything at all. > > Alan Stern > > Korsnes patch is not in Torvalds tree nor is it requested for stable. How do we get it there?