Return-Path: 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=-5.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_MUTT 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 A3D57C282C2 for ; Wed, 13 Feb 2019 14:22:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6EE07222C1 for ; Wed, 13 Feb 2019 14:22:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=kroah.com header.i=@kroah.com header.b="Xe+5ZcRQ"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="wdJV/GJI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388802AbfBMOWb (ORCPT ); Wed, 13 Feb 2019 09:22:31 -0500 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:45599 "EHLO wout2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730572AbfBMOWb (ORCPT ); Wed, 13 Feb 2019 09:22:31 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 514E7334C; Wed, 13 Feb 2019 09:22:30 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 13 Feb 2019 09:22:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=mpjIQXKy/9IiZgSKhwh/aVZWpoN y4zbsK9zU4gjliXI=; b=Xe+5ZcRQWWoPof3UE8ic5ru7pm3FJk0G623ugJDlRjC izZjcGPlYl/ixRda6jKUqi8Bn93Q/cdqjSsCjiflyZnJS7d7c5uojWe7DCQyKyeP zehtWbr/4A9r5CoFVTmcSqX6/2L4rVKnbDAkgYl+GRUf/NRki2JdueFbKbAItgl7 V5ZtEZxIB2rmjxWRzNtU3Rz1886UgGipFUU0X12ES7ZaivWShjd6mYhv+nyLfsMf RUYAOscp1PfqclXCWAhbKkxviqzPtq0kbPf62eJcV9+pTDDxBaC++3qaZKrH6sND 6l396ctdmdHr9BLuytURXhEztXlPP47SBiVEwzORnCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=mpjIQX Ky/9IiZgSKhwh/aVZWpoNy4zbsK9zU4gjliXI=; b=wdJV/GJIEgnLh6IctuusIs mOkCdDHHNCvf3GUBu6qjq9Dm4odMVVWsP8tbB9xZi5WLtIgWOCSCs+nT3r0iRqcW l8GUIUFrSVMGaHtDqu9pT+rlw8I60bVL/s2uuValaqWser6DD0DBGBWh72tMR2z6 XrHKAuud0mITBVggS0fBkPIVkmOhYBehEMnJlSuijTG7ZikT4AtEZ427YfLgPtQo IxH/NnwWtcgyNsuN2xm+L9gwL8m0O6oGv7M9jr0uJBs7HP7c2EkVzcSAMkJJSRIi lbIwOrWeVtv+w0C+T6C4piIjbQiF9hOOlOFEjiXxJtHrzKHSXQZMfdYjd9bMMcsQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtfedgiedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpeffhffvuffkfh ggtggujggfsehttdertddtredvnecuhfhrohhmpefirhgvghcumffjuceoghhrvghgsehk rhhorghhrdgtohhmqeenucffohhmrghinheprhgvughhrghtrdgtohhmnecukfhppeekfe drkeeirdekledruddtjeenucfrrghrrghmpehmrghilhhfrhhomhepghhrvghgsehkrhho rghhrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost (5356596b.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 301D410318; Wed, 13 Feb 2019 09:22:29 -0500 (EST) Date: Wed, 13 Feb 2019 15:22:27 +0100 From: Greg KH To: Vladis Dronov Cc: stable@vger.kernel.org Subject: Re: [PATCH 4.14] HID: debug: fix the ring buffer implementation Message-ID: <20190213142227.GE10202@kroah.com> References: <20190211153648.7745-1-vdronov@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190211153648.7745-1-vdronov@redhat.com> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Mon, Feb 11, 2019 at 04:36:48PM +0100, Vladis Dronov wrote: > commit 13054abbaa4f1fd4e6f3b4b63439ec033b4c8035 upstream. > > Ring buffer implementation in hid_debug_event() and hid_debug_events_read() > is strange allowing lost or corrupted data. After commit 717adfdaf147 > ("HID: debug: check length before copy_to_user()") it is possible to enter > an infinite loop in hid_debug_events_read() by providing 0 as count, this > locks up a system. Fix this by rewriting the ring buffer implementation > with kfifo and simplify the code. > > This fixes CVE-2019-3819. > > Backport to v4.14: 2 tree-wide patches 6396bb22151 ("treewide: kzalloc() -> > kcalloc()") and a9a08845e9ac ("vfs: do bulk POLL* -> EPOLL* replacement") > are missing in v4.14 so cherry-pick relevant pieces. > > Link: https://bugzilla.redhat.com/show_bug.cgi?id=1669187 > Cc: stable@vger.kernel.org # v4.14 > Fixes: cd667ce24796 ("HID: use debugfs for events/reports dumping") > Fixes: 717adfdaf147 ("HID: debug: check length before copy_to_user()") > Signed-off-by: Vladis Dronov Thanks for all 4 of these backports, now queued up. greg k-h