Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5087022ybv; Tue, 11 Feb 2020 08:57:47 -0800 (PST) X-Google-Smtp-Source: APXvYqzgqm3SieRIK3SCsci+KWi+lQT6ZCe4E5AKz9RxIff16W9qYsE7BJJF+E8LnofgOoA1B1Qz X-Received: by 2002:a05:6808:249:: with SMTP id m9mr3557855oie.5.1581440267303; Tue, 11 Feb 2020 08:57:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581440267; cv=none; d=google.com; s=arc-20160816; b=MgYSrAr629JUAI63Pg9fo2Qa2LO7M3LhC/4U7b7lDsf+wwMqGJdX/PUHXWiAbcCb/O hOE70swn/6YaffxIOxzjof8De21KHe/aEoAz41VL67RIxazQAext0qtjgS4YRT3FlzT7 i2dh4wagzG5cOQJPva+kxqJvQCxLXlQfoirA1CNS6bKqFMae63cL0t3wW/9EzNRCU5bA tfKg+0hV67MRwISfGfvNG79HUFvSVeQ7yf9naXuU8YunsBMyJab//Kffb09u4PDSNJmv Tx5Li/YxBXBmWKBVcihrS7JaxwnprW9vtavSMryntjuNrnq23OkQeNAbYiaOYyhmNtcC wKdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=ed79Vw6u6dsKpmore8NOG65HtxIPdkAoQ3diohSeK/4=; b=ZV0htajxAWvDt1f7Z+TIpRO29UqvPiLU2nHvhl9ToA8kMdY5kiaDsXkMHGes/pQbFl /FanyGTpyXSXqSuw/jbc8hw/l5yCf2DgGRlPN5olVi/s8RE6VYe9RMMMQA1cNDmiTUPm HFUIHC8WTqD9exTRnqHXw+0voYKB93mkn7MYlVy/vnvtJh7+LGY1VVjvfph4gWDZZcNz r7pNrsHD8KFqXFpgeSnWxlzbVgHYjvtSNFOHe2dzJ7GnsHSb35oicxZn6swNiuQXVl6J J0+HkRtGBvwMILXcrXdtUQDm1MKalCiVWNuGBnJGb0Zji6fgAmfBOLHPS5iXLT+jg8Ea XvPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Uaz/KHVY"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c5si2310628oto.74.2020.02.11.08.57.33; Tue, 11 Feb 2020 08:57:47 -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; dkim=pass header.i=@kernel.org header.s=default header.b="Uaz/KHVY"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730288AbgBKPBY (ORCPT + 99 others); Tue, 11 Feb 2020 10:01:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:41410 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728063AbgBKPBY (ORCPT ); Tue, 11 Feb 2020 10:01:24 -0500 Received: from pobox.suse.cz (prg-ext-pat.suse.com [213.151.95.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7BF6E2086A; Tue, 11 Feb 2020 15:01:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581433283; bh=y2EbHrP06L5OaU1623dq+EIafyEnQOLyL46r5Dkjrpo=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=Uaz/KHVYLGOszKR34MSUWB52cAjb8lmuCshYOv+e/VCKiXQsORIqdpuKMX0xn7QuO 6axmkMTSXl4WkHQJC5xsUTxKQiPx/c8ObwVSJxQ4aD2NMQQfq1N5finJEKfJ9WfwM3 SOuidlMVJL42uzyrnkWbIkJ7eyBmMVG51FboHqqY= Date: Tue, 11 Feb 2020 16:01:06 +0100 (CET) From: Jiri Kosina To: Alan Stern cc: peter enderborg , Johan Korsnes , Greg Kroah-Hartman , Kernel development list , stable@vger.kernel.org Subject: Re: [PATCH] HID: Extend report buffer size In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 11 Feb 2020, Alan Stern 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? > > Bring the whole matter to Jiri's attention. He is the person who will > take care of it. I have been a bit swamped during past few days. Johan's patch is in my list of things to process either today or tomorrow. Thanks, -- Jiri Kosina SUSE Labs