Message ID | 20200310123613.773411658@linuxfoundation.org |
---|---|
State | Superseded |
Headers | show
Return-Path: <SRS0=QSPG=43=vger.kernel.org=stable-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC7A7C18E5A for <stable@archiver.kernel.org>; Tue, 10 Mar 2020 12:45:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C31FB246A3 for <stable@archiver.kernel.org>; Tue, 10 Mar 2020 12:45:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583844327; bh=h85u4VUgbh0W1itZlCmB2tRcbwF02+Qx+y1dJNGdyKc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=1tdhwBxP/FKQwGh0mxzuSkP+pEzP9YDN6GrHGfDRKLbLtfC3uJuwl9e58eAhGVYe3 auUbOEEyt++UdkgAdcV7jKdEt+HTAYOa2BoqTnzE2F1T+5rbWi/nHYQTB5wKDPpprn wY5owWmBZvwInfxa8RfwqTZZjEHDU1zK0c6N+v/g= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727915AbgCJMp0 (ORCPT <rfc822;stable@archiver.kernel.org>); Tue, 10 Mar 2020 08:45:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:48032 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727911AbgCJMpY (ORCPT <rfc822;stable@vger.kernel.org>); Tue, 10 Mar 2020 08:45:24 -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 36468246A2; Tue, 10 Mar 2020 12:45:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583844323; bh=h85u4VUgbh0W1itZlCmB2tRcbwF02+Qx+y1dJNGdyKc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y6mBQyCmQVDg1rz1ziAQJ4EsiSf43BzM32zHULjgphmivQAe7IjuKY6qP06F5vSY8 LR7FShCVMyPvbxUyjJ0FbpG0Kf6FxAGgalGN2vdYRH5mOZV6vXpdY+eECcip6MzWd3 1o/63Hd90I2HORvRW4UC2Wx3k5HYxrqpW8aII0lY= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Johan Korsnes <jkorsnes@cisco.com>, Armando Visconti <armando.visconti@st.com>, Jiri Kosina <jkosina@suse.cz>, Alan Stern <stern@rowland.harvard.edu> Subject: [PATCH 4.9 32/88] HID: core: fix off-by-one memset in hid_report_raw_event() Date: Tue, 10 Mar 2020 13:38:40 +0100 Message-Id: <20200310123613.773411658@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200310123606.543939933@linuxfoundation.org> References: <20200310123606.543939933@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
--- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1547,7 +1547,9 @@ int hid_report_raw_event(struct hid_devi rsize = ((report->size - 1) >> 3) + 1; - if (rsize > HID_MAX_BUFFER_SIZE) + if (report_enum->numbered && rsize >= HID_MAX_BUFFER_SIZE) + rsize = HID_MAX_BUFFER_SIZE - 1; + else if (rsize > HID_MAX_BUFFER_SIZE) rsize = HID_MAX_BUFFER_SIZE; if (csize < rsize) {