Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp30695imm; Tue, 16 Oct 2018 17:15:36 -0700 (PDT) X-Google-Smtp-Source: ACcGV63Uo21Ge/rI12mr+BI7zhUMO+4UbOc2wRER1yOwtIAAoea0pf2FdwGyz5y0YZyipCc/t09X X-Received: by 2002:a63:ce14:: with SMTP id y20-v6mr22825601pgf.248.1539735336100; Tue, 16 Oct 2018 17:15:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539735336; cv=none; d=google.com; s=arc-20160816; b=jl4FsZnJZa6y240o6MkaOVcZ1oEqooNb+9Ioz2dpM3ZAW3JwCZoJWXm3qKckt5BKjV m4f7/sKsDheK2Njd6/WGtnHvRC3g1vpm6Q7DDSFVY6+AYtl/S/nCmbrc0EXhHSeavhUr H2t7Lz1AfsRJw9tUQ8e06vY4xiWe+HwA1NBIzuxVTegDud7l2Uzyj5vsGKdtgkP/mPrr eNYBxUtyh1Ew9GQpBjKQY9jUodPu5UjE3XI92XDknDp/9+WyoqDffTpxEtpRssVEMgR8 W258Ah8Ds20P6sZz1aqLM2Mrs3/lO0jV1XxepC0ZBziAzWwKCs3UFWvL21M33b9Vxvlj dwcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=XiXPBvpwZyEOdYgHHTrfA/QhSdmg86uDorOtSXr8haM=; b=xx11qPHA8LQFzXpswQyBr3XVKXTIRwjk6jMhWO/idjAxiJ1IRyykjXvd7L/PRdxNEC r4UWlPQAKzfQQabKbs0rqRB4A32nWN4APWa4ll/eXZ1I/B3iyBoDRG2iUt3rzRD+ZA9c eJWkuy3S8VMXxKeQcl82O5Dy0AT8mZoWb0emZj5WkV+nnEUSNKvhNM6GnRYqoacdumET nitNiTQNtY66wGObvG97bpJh/ni/pDbhGzIhoeEvLSXwl/Q5qantrX/0cLl+PSJNoAhj uWfNrbIz6q4F0JlVqO1EhD9iADqz16WTZQawiJEv6c+YON3ncS+BFdHrVZlAqvz4xR6e l1vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EMRZvkY6; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n25-v6si15358746pgl.508.2018.10.16.17.15.14; Tue, 16 Oct 2018 17:15:36 -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=@gmail.com header.s=20161025 header.b=EMRZvkY6; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727449AbeJQIHo (ORCPT + 99 others); Wed, 17 Oct 2018 04:07:44 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:34826 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727171AbeJQIHo (ORCPT ); Wed, 17 Oct 2018 04:07:44 -0400 Received: by mail-pf1-f193.google.com with SMTP id l17-v6so12259642pff.2; Tue, 16 Oct 2018 17:14:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=XiXPBvpwZyEOdYgHHTrfA/QhSdmg86uDorOtSXr8haM=; b=EMRZvkY6BRskYRvtbwX8/MATg9yoAP6hbm6cliY4BpvN6ewwbjcl+WY3MI95wZv1TJ TmhWb+HqiWJPtt21P/03Rm6eRVrxYSNqsfifHTKmFB4hL0xMKUFj8TOHEiSZB0Vve66m quGGZGp+S+l13vJ2+yWs/vIS0xc+1zHcMcC9hIKL4saQKyL2HJKqiRicivDnUgP8h794 A6hcfwYgCPk8eHijtBgbXA90E7oX4mfCYzTbq1RfAT+NseqNHVlOb6XPdiziwQIyWUxx IBdYIvqYAX2fX6UHt89jKv8g1Ynb9CdKtU2ciHoYoGD771yW1q/QfOg/bstIMlOnhhrh z3Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=XiXPBvpwZyEOdYgHHTrfA/QhSdmg86uDorOtSXr8haM=; b=O0bpnRQaPa3DSqWIpP47HVkLilGNnThzi6fcdCMKJjfHC8NlV+Y6EqCTkZABk7Dz/B E0b1GPXnm3qYcN93nJE+ExxwkDIU6wFTsoQOjk85688LAIY3q2Ldfyvjg7KskrrgQdSi Uo2u0lTkMbKjRoBrnuVOSo9mWwRsaIODNLNp6TlpTY2c2q9QuGpfLFT8pY1m4oUIJZ/T yrHBPJNkHjRStoTHk3hPQr4bQoGyMNfu/hS6vQedp8J1vK/VNl621W2Dek1dnI9qXY/m rkdAs3AzsnuS32pFfXa6ZIP3n6FwkA3M98RKn792buFV9Yx+jJrMqcHiyFPxpFRB6if2 2kFw== X-Gm-Message-State: ABuFfoijRu/O7M6pTK+ECtuwaTLvgYB6jF0Wmayzv5v5zoOxviDuMP7k wslsUfEfyXcdX/ldoTarlprZ8NLxTwk= X-Received: by 2002:a62:6801:: with SMTP id d1-v6mr24183237pfc.7.1539735287137; Tue, 16 Oct 2018 17:14:47 -0700 (PDT) Received: from dtor-ws ([2620:15c:202:201:3adc:b08c:7acc:b325]) by smtp.gmail.com with ESMTPSA id t69-v6sm20940240pgd.43.2018.10.16.17.14.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Oct 2018 17:14:46 -0700 (PDT) Date: Tue, 16 Oct 2018 17:14:43 -0700 From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: Benjamin Tissoires , linux-kernel@vger.kernel.org Subject: [PATCH] Input: synaptics - avoid using uninitialized variable when probing Message-ID: <20181017001443.GA232819@dtor-ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 not use garbage on stack that just happen to be 0x47. Reported-by: syzbot+13cb3b01d0784e4ffc3f@syzkaller.appspotmail.com Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/synaptics.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 55d33500d55e..5e85f3cca867 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c @@ -99,9 +99,7 @@ static int synaptics_mode_cmd(struct psmouse *psmouse, u8 mode) 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); -- 2.19.1.331.ge82ca0e54c-goog -- Dmitry