Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2533950yba; Mon, 6 May 2019 07:37:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzUGzbFzj1qTSPh5Rh/H1axDV+9WgNt+6Oz96AMFOSB5UWS93Sv9Q9i+sS4ioiJadFykk6w X-Received: by 2002:a63:d343:: with SMTP id u3mr32769246pgi.285.1557153442148; Mon, 06 May 2019 07:37:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557153442; cv=none; d=google.com; s=arc-20160816; b=08saJ72VuXW7aF4XO9uW4lRcOTnbbZMWHgvBuNVXI3g3kslBMQClytfWLL4ZpBwpJK lVfD3ZjX1WZgVcfUUa7seI+c+sg0vZUndu3Nu1E3xtQTwZhgsbgp6eB+qKVqdXcFIiS9 Z3mc4RljdA6UfIHIsJ9pRhSNVHNT/JyRr6EPJ9805z02xrhACsSW/dg76dg4Z8Y16rqI zp/wJrof9CjKivnY0clfBVMC2rkLVhFOxoJO2nysE6KrgZAiJSWqVaRAu8h1MGxpt/rl 0koCnJgzhwC8NzOv4ugVqOR2BrWiZ9O0Hc8W2dHDovAzzPDDPVQAMSUPtPvnWRnQ6y2G HLcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FnZWrm0CQbX6G26n1AKmeNkxk6SLTiWibSsEIdIoCHg=; b=0TP9eaeQC59xzL4ThYyIcvwLf1Wa5Ex34ZeQ2k5+zhosABlw3ASr6uCjxiRQSuYJZB q2eKz2VxKCs4Z/S0V7/V7yr03B8yF6HwcEi1FG2hBBm+lub/MffYnXRauMYbBaaTV02p CLPtMpzWxKXE6pbHq104Ighcjf+e+By+Ful5nbh+etEFY714Cm9sU3CvLJ5odOHdJwBo y04yteNjx2dmhLJj3xctkGvuxpsMODIBlkmKrBWNcEuyW/f2b2xImiCbF7bFKmPC3JWX cBEXgTXyFmSl8oBieevw1w1xWKLpgRtL3QaMET8q25oDiy+qm0/Up8kgognDRv2sIoY7 2FEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=P7BPkkfI; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q135si14327251pgq.429.2019.05.06.07.37.06; Mon, 06 May 2019 07:37:22 -0700 (PDT) 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=P7BPkkfI; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726949AbfEFOfb (ORCPT + 99 others); Mon, 6 May 2019 10:35:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:55578 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726373AbfEFOf3 (ORCPT ); Mon, 6 May 2019 10:35:29 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 8506021530; Mon, 6 May 2019 14:35:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557153328; bh=ficshpO8Shqw6Abdhvok6FU9UFWIkLTXgtO1J+kYecU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P7BPkkfIutkqgi7CsZ8bKjJfc0pE4zWRZ/nau/CWZJ9yv7LxuDNYGKgr/qC/xGE7d G8gXOPWg9bi89cWWLY4e3ipC+4ZSwl9JdcWhf0IOh3U/IxvAGgPMY8tyCpLuAuwNZS u2hXxsjcYo/zOuKCyZTsMsRFiESLcynXolI3mGtk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kai-Heng Feng , Jiri Kosina , "Sasha Levin (Microsoft)" Subject: [PATCH 5.0 026/122] HID: Increase maximum report size allowed by hid_field_extract() Date: Mon, 6 May 2019 16:31:24 +0200 Message-Id: <20190506143057.104585809@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190506143054.670334917@linuxfoundation.org> References: <20190506143054.670334917@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 94a9992f7dbdfb28976b565af220e0c4a117144a ] Commit 71f6fa90a353 ("HID: increase maximum global item tag report size to 256") increases the max report size from 128 to 256. We also need to update the report size in hid_field_extract() otherwise it complains and truncates now valid report size: [ 406.165461] hid-sensor-hub 001F:8086:22D8.0002: hid_field_extract() called with n (192) > 32! (kworker/5:1) BugLink: https://bugs.launchpad.net/bugs/1818547 Fixes: 71f6fa90a353 ("HID: increase maximum global item tag report size to 256") Signed-off-by: Kai-Heng Feng Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin (Microsoft) --- drivers/hid/hid-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 9993b692598f..860e21ec6a49 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1301,10 +1301,10 @@ static u32 __extract(u8 *report, unsigned offset, int n) u32 hid_field_extract(const struct hid_device *hid, u8 *report, unsigned offset, unsigned n) { - if (n > 32) { - hid_warn(hid, "hid_field_extract() called with n (%d) > 32! (%s)\n", + if (n > 256) { + hid_warn(hid, "hid_field_extract() called with n (%d) > 256! (%s)\n", n, current->comm); - n = 32; + n = 256; } return __extract(report, offset, n); -- 2.20.1