Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2545065imu; Thu, 29 Nov 2018 06:40:56 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xd1Xb2bPHjgokLtPsr55/Grq2mSpyFdIdROeebYeYMIzfpA790k+12Vl4rjq0cD//JjjKr X-Received: by 2002:a17:902:50e:: with SMTP id 14mr1698889plf.141.1543502456187; Thu, 29 Nov 2018 06:40:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543502456; cv=none; d=google.com; s=arc-20160816; b=k0moFzj7Fupa7fXGZFLr4R1AAE3IJTSw1JIuqUkkOi3s4O/X8PBnAVNiZMIDzE8nmr cAOLtHHyYmNkx6n9GaDZRxCt9QLQoYIJ9On7ItmibrBnULR/ucHNSmHbTnmivbkds4Aw w3zqd9zo3EXUNmIVlrtUciTc6vfCkx0GxZ+wsSx3DDL+6gUXGEeooQa8Fx54ZV1R4U8i 4mgTq8gof3atshfpnCWlaQDF8W2cDtkn+qcVVV+4oAIo3j5PNSe4MldVPfm1h+V9CGEM 1yq1S3l9nKKCfuYst54+uStzngYXj1g2q/l96x91imJZI2wfkTF7KJyPgdcaMeanJ4ns y5uA== 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=+t26UmJF4tvj1zXA6HMEhwyfIAFkL/j8VzsSGjg9J8Q=; b=ToffTGETnTo0OiX2I0aLExD3DQREFwgoG0Lv+ptcEcoXCb+aku9+Co7jhfOm0b1iSC ZL0XJ1eFaLjBo/FIx8h1jHaY5h9T6SEiLTP0eSrkDYIozdI5gKW2GS1h/ZwnkJYbYnMr scL9Cge0rH174OqzOyvAgpefvR9+BYOeRfA7b6fbyhQNXKdKLqTy3771zNVMxxcnl+/h 2MehyV/S61YBuovhbHjumtwep/E9Eudqiatuk4oxhmYDYA+9unpNoagv4q9lnaXgU3Pk m2E6ZmrBXxM8zwaFQIljB1dVTnQtyPCJ8grBALkiwQqTppmng4Zcu6jJGz965CGSBKdS 9h2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zt3N3zAL; 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 a9si2173959pff.126.2018.11.29.06.40.29; Thu, 29 Nov 2018 06:40:56 -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=zt3N3zAL; 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 S2388432AbeK3Be6 (ORCPT + 99 others); Thu, 29 Nov 2018 20:34:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:36500 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731958AbeK3Be6 (ORCPT ); Thu, 29 Nov 2018 20:34:58 -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 9894621479; Thu, 29 Nov 2018 14:29:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543501765; bh=M6c5hRMz7pL/OawZwQjAyT9GpwHVXbEh5W0HVn7f1Zc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zt3N3zALQe2YoGmKlNYSPq1mwohsSKsNEQ7EKtcG44YIPJSjOVl9MYHIUGLFWArAG tHRY7ZBoQWQZkHuwAV+Zi6YrQXBfF+FvK4HEGi8iDQwn72dXdpaT4+2SKgzaf1V0h4 5b9rjU3MjyxX3sgwkZdgMgYdbGVAtKTramu99kmQ= 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.19 032/110] Input: synaptics - avoid using uninitialized variable when probing Date: Thu, 29 Nov 2018 15:12:03 +0100 Message-Id: <20181129135922.565401586@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129135921.231283053@linuxfoundation.org> References: <20181129135921.231283053@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.19-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);