Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2555336imu; Thu, 29 Nov 2018 06:50:31 -0800 (PST) X-Google-Smtp-Source: AFSGD/W+zedZG4/7C+rEeByCNP2H6gd4ZRMH2MboRkbe+ooh14+TbTD9GHqGLCgbkAcPfXo1UrI6 X-Received: by 2002:a62:2a4b:: with SMTP id q72mr1639400pfq.61.1543503031559; Thu, 29 Nov 2018 06:50:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543503031; cv=none; d=google.com; s=arc-20160816; b=hFBXQmq9N7EmRn2zAKTmfOpzt180qpfydDb+QWcIf2CBbP3kb+jTk03WGqa2McfnKC Yh3DnLsWNiPZMD/+vd5kF9w+jJhF1Oi/HUEhkMAJ9c8JyG/fkTo1frKLaSTLz+f5HhDT wfEhSx3mB6xd/6FojPHJtfn4wtQI9NtSQTUfwVeQAnXNFDOeIA061tBpPkObgEyj2UtI hYKgA7QHZqdxb+7sQbW9Xc7bzCb1gk8oFJ0kbEyAswA/EEe9NrkJ93iN9C2sbd7TdhO/ 03yfEOv/CV4R6XRUU/V8jKGeB22/ZAvFAwX3SfZ6x/kaY3jC6KECMxdCc49M483sbkha 84RA== 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=FeMuOGhf7tcyLKF6KJc/bRVqhuz1VdF8vncGd9zcl/o=; b=k99mMwsSR9Ylw0Il2DlM53QLKc/eHoYMiWzrpW0Bi8MvjHC25V/S/Re1emmYSiN65k HCo6f5yNkAP/fVc7NkO31dItirXgpog+eynvAL3mONWLH5GD7k/0NbVCF3m63hVKm8c5 T0FYg8+pFLvwhdQ3bDBpftXq00uN37MhxHEXeEpXf19oG5XDFy62tK/6zclrqVe0+SZT 0NIDZo4Y8pbplgKBUannQ0C4Y+QwRu6ahKL5mkDEIk8hN9pPgHmsNyhpcPtT7LFWjRtc tsTz1i7zjA3IskvG56nFmqIIYOLF3v2GUaF+QTqfQ/0OoPCPKwt9JLoewRunP/PmSOo+ dJfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=B4dkdxDF; 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 q24si2470321pls.325.2018.11.29.06.50.16; Thu, 29 Nov 2018 06:50:31 -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=B4dkdxDF; 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 S1732823AbeK3Bab (ORCPT + 99 others); Thu, 29 Nov 2018 20:30:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:57588 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732149AbeK3Baa (ORCPT ); Thu, 29 Nov 2018 20:30:30 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 9879D213A2; Thu, 29 Nov 2018 14:24:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543501499; bh=DXNv0G8LLeF5oQ7HSE3R17zr/A23IPw+FjFXTzMR+uA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B4dkdxDF/nKrdE3mjT7VPsPzM860KReM0PcWIVKli0ooFChB+sYt1H+TOzCkKxFpW iefZe0rh6HttqZU7azUveh0QtB9+xEkJdG8BtKbm7TplsL8WMp2oOBu/b8nm5C2la1 mNYxe5jzt3eVa3rpI0MKU047dflyMsNzE1WqVv3w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+13cb3b01d0784e4ffc3f@syzkaller.appspotmail.com, Benjamin Tissoires , Peter Hutterer , Dmitry Torokhov Subject: [PATCH 4.14 023/100] Input: synaptics - avoid using uninitialized variable when probing Date: Thu, 29 Nov 2018 15:11:53 +0100 Message-Id: <20181129140100.762078148@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129140058.768942700@linuxfoundation.org> References: <20181129140058.768942700@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dmitry Torokhov commit f39f8688888ae74fa8deae2d01289b69b4727394 upstream. synaptics_detect() does not check whether sending commands to the device succeeds and instead relies on getting unique data from the device. Let's make sure we seed entire buffer with zeroes to make sure we will not use garbage on stack that just happen to be 0x47. Reported-by: syzbot+13cb3b01d0784e4ffc3f@syzkaller.appspotmail.com Reviewed-by: Benjamin Tissoires Reviewed-by: Peter Hutterer Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/mouse/synaptics.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c @@ -99,9 +99,7 @@ static int synaptics_mode_cmd(struct psm int synaptics_detect(struct psmouse *psmouse, bool set_properties) { struct ps2dev *ps2dev = &psmouse->ps2dev; - u8 param[4]; - - param[0] = 0; + u8 param[4] = { 0 }; ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES); ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES);