Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp315315imm; Wed, 17 Oct 2018 00:05:52 -0700 (PDT) X-Google-Smtp-Source: ACcGV62YlaI8ZL4oDW0ZeCbc8wS8RX9G4HmDzdMvi/D1t38rq81ttHsACpkuwIdvScLapwH3uiwF X-Received: by 2002:a62:1316:: with SMTP id b22-v6mr25401775pfj.37.1539759952789; Wed, 17 Oct 2018 00:05:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539759952; cv=none; d=google.com; s=arc-20160816; b=k+GpGqDzDL5rrSjcFT9xSuHeOypZJguevFXCD6kZU8NohQNM95syyv6K8j9zBUUFy3 LCyHCjC2A+MoJYF9o3/C+kige5SwrzGlQBO/H2MbIaH+F7ppnSDAEsE5vaunv2qOHC3N orz5qd55Bd5YACvhvWv0rGu9+1xYSM1uD09dVObKOq2xnGb25Psohs+i67zzQR2IWqqu 2WyQ28nBFRe5SpYi6t9xF14yRaIVYkHmrVxEobDLv73icosFFqp2YLipkPf0HK1qhEQ/ INtJJJ51Xi539r3wbXYJB8a0oNqeXy2/WK5jbBawcGWf90eKnmCKvW6f8GIb6u0u+pyJ VXXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=KyRTlU7dUazYBNZfdRoBS3BJUOLw+w6qfmZrPKhB8jU=; b=NrF+WZ5EEM9yZDa/816c3UtOf5URPc95aLbVf38N6AHVGd17kopxTnc7kETMA/1VPI gWZR6D/6Ra11R72EPoqOsLfAOek0hWtXwneoqzvrR5DSkctxHYVhZA8j79GpUms4x7IE JEBwbU2+dMa6mOsGFYDY78oz71Ap7tc5GHaLB4T+PuAadS5kA6w5gsZfH+E6Funfhk5N LaQcuDYUcDdpPF1OtZmaDSeEnCbTN6Hz3U0AKvqeO06p9buNTPYZX1VeXVRbqGil89+K /+cG9AzAxYScUEXTsHf7S5d+ZYWBXRsYLASGW3TWO9v6EF5m65pPMOK5OqarrmKlK8c6 bqtA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si17194194plk.405.2018.10.17.00.05.37; Wed, 17 Oct 2018 00:05:52 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727483AbeJQO5j (ORCPT + 99 others); Wed, 17 Oct 2018 10:57:39 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:43505 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727219AbeJQO5j (ORCPT ); Wed, 17 Oct 2018 10:57:39 -0400 Received: by mail-lf1-f68.google.com with SMTP id p34-v6so18929809lfg.10 for ; Wed, 17 Oct 2018 00:03:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KyRTlU7dUazYBNZfdRoBS3BJUOLw+w6qfmZrPKhB8jU=; b=ILKYBFYra/uhDxsdtPwdKSqRad7WuQfWSJZzFdu9sjYOYXqo4ZmKH41L6vmAgjsN48 O2MO1vAmT5MiUI6UzxGP5ipjssd81xw4lDnznlNxPMEhCnDbz/nxVoI0nLirXmF6mk/k LLEqU/01cFN634yOimAf16ZgyXrDLsqKE13rE2mkDm846LtGiYp144xEHJK9HI9CM+w5 uuNoQ4OVz77qAmHeCMQRNuK7IvZy7WZtcAMe3f4dMxAhhh3n0EzQ1XhU2f1ic+dl1c2l ktrBEa7D5tm2V8QOkNW8Qp1ySDBqNUHk0lox9NRt0XWoo/aG0VtrQSmthOF1mHWztMUF Bj7w== X-Gm-Message-State: ABuFfohWqBGFmmNK8Yv5At54mzSpkJNePIiNplO3ZSDsQ8RufvWrG0GX uwUbLW4EP8aD2wB7K2nY3g7U1Ad8XXK9p6+P8AU1xA== X-Received: by 2002:a19:cd81:: with SMTP id d123-v6mr9994859lfg.104.1539759803759; Wed, 17 Oct 2018 00:03:23 -0700 (PDT) MIME-Version: 1.0 References: <20181017001443.GA232819@dtor-ws> In-Reply-To: <20181017001443.GA232819@dtor-ws> From: Benjamin Tissoires Date: Wed, 17 Oct 2018 09:03:12 +0200 Message-ID: Subject: Re: [PATCH] Input: synaptics - avoid using uninitialized variable when probing To: Dmitry Torokhov Cc: "open list:HID CORE LAYER" , lkml Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 17, 2018 at 2:14 AM Dmitry Torokhov wrote: > > 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 > --- Reviewed-by: Benjamin Tissoires Cheers, Benjamin > 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