Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2610060ybc; Mon, 18 Nov 2019 01:45:04 -0800 (PST) X-Google-Smtp-Source: APXvYqxBtOOJXZIA7H0KRvXfSSHHHJK2TJoBnwX5fj9VXesSsNKNbA4sPps9vd1xkl/jIztWzE81 X-Received: by 2002:a17:906:6a43:: with SMTP id n3mr25405890ejs.31.1574070303956; Mon, 18 Nov 2019 01:45:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574070303; cv=none; d=google.com; s=arc-20160816; b=xaxNGRVP4Dh2lPM5yTXV5UhNFnklsvwIYqbbJFza0dyObncmDMEm7kC0nbhcDChBMY 1zOSCEHive11pMPWYUPydM7KaK3utqBoYB+EHn1ic32o2h8SNGNYaW3P4hGoxGrGaQVa /qokLz6qkNfS2sDhOXNU5JfIpcq0dOxqc0PCWZ8qgvu5dEuNmpLLS974N69ZA7pHF8Yq Cp0TLIftNdgqsjWTFYESKRhBL3rA3hYuNowDiqU9F6aY8vEi++Q4LXFAkk0QgewkkiNd b7w9PcNwpusXk25UjKUPkvWk7GTRh5Z8MYvoYt5V8D1/840r5Fy2fkUi5y38KC+9kW50 9T/g== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=2K0wvDeLJaW8sYE1jy+QQGz6cSrIUDN55exId+Sge8Y=; b=dnKgpSE+ggjJSR1iI2LCfUo3AcB4WOrRnDl2nIXYcnGOrSkKJurCEFwDDM9E/grDIR 2QsjRRuLDF/73a/c0sMCzGtqcL+6KYegkS+vQTXv3D1qGRgQSDKJybMesUJuTqZEXyoW Fiop10UjE4mn2sP64PqfYtu3PKg3qaZUtxPCHpdX8qTvIm1TVRGJgL11cTCpiQfuQgq3 FlfAj+vBeM41V2S4u//SxQGepj3Wh4FMSvTn1acZbvx5XnqOAWYLUI95tkUzos4F3Ko1 IxNI198OUnrMurzS62SMrvFr81e+kUe7jYMPAqaBR/EtCCbOZgkRp1JjStaACpbEhEQj QUSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=D7j6LC5h; 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=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 q23si14633082eda.167.2019.11.18.01.44.40; Mon, 18 Nov 2019 01:45:03 -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=@redhat.com header.s=mimecast20190719 header.b=D7j6LC5h; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726568AbfKRJnh (ORCPT + 99 others); Mon, 18 Nov 2019 04:43:37 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:40060 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726490AbfKRJnh (ORCPT ); Mon, 18 Nov 2019 04:43:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574070215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2K0wvDeLJaW8sYE1jy+QQGz6cSrIUDN55exId+Sge8Y=; b=D7j6LC5htBBByzR4SJIWinAiI4mIkL7/q8XHLdaW4xHTWoKdMqrWR0p2mL7HwfC7CFwejF MrCtEHeS9s+wtRtbKq9X0syx/Hck+HWj5HfRRp9eYRdzjeI8vgKnetE9g4ZISr1e7vs+qH /Gq9wDMQCf4bR/3A2pxwa32LSdh1cnY= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-232-IJRyYxmFMJm8ziglMNy3bA-1; Mon, 18 Nov 2019 04:43:34 -0500 Received: by mail-qv1-f70.google.com with SMTP id g33so12112881qvd.7 for ; Mon, 18 Nov 2019 01:43:34 -0800 (PST) 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=v6BPHFPKvorTEt7xRKiDYcS9E+a1exQkd1rgkDj9f8k=; b=Ps6aB6gwKJvz13ZRzj4275PCtWop0Twa29btcTpfla0ZHbI3Csdpnq2et6Qcl7/Kcj H1C3hH7PqrfAS8CJVh/fpyPv0cb5I8mSwrQqTGuZ/uyB5Vi4EeE4nAEpc7gVYJvqu5jn emhhbAru7iaQmdnBK2wXG2drbDGknZvP7hy98hlkfrOIGFshuubzdpZuyWznC2bm9mWK e/cGtgnfYN6X1ribPhkBVNAcL3QybmFPlajeQYuE88U0IrCKYXJq9M2pg3KYQBPr9Tb7 kb1hm9JCPuQ+zJ95YAwbNjA1dIUq7vy/fUlUVWmnUpdslFYqwwD2Sr3io46jA2EPkhgS PChw== X-Gm-Message-State: APjAAAWM0jjuFsDh5QE0sFrnzLnr3RfwzZ50rY2xvk+jDonmpktcjrLn 2iys7JbJtHyewMz+BB8FUJzJhPsU0RGQvmVhBnmgVxWEAlL/r4t19+Z2irdd4hpb05W5Fx7O3m0 2KXDNOn1j8HUe4DOC4lwgDCvklwqmC9ktp8ac4inp X-Received: by 2002:ad4:4042:: with SMTP id r2mr14849480qvp.196.1574070214015; Mon, 18 Nov 2019 01:43:34 -0800 (PST) X-Received: by 2002:ad4:4042:: with SMTP id r2mr14849462qvp.196.1574070213673; Mon, 18 Nov 2019 01:43:33 -0800 (PST) MIME-Version: 1.0 References: <20191105141807.27054-1-tranmanphong@gmail.com> In-Reply-To: <20191105141807.27054-1-tranmanphong@gmail.com> From: Benjamin Tissoires Date: Mon, 18 Nov 2019 10:43:21 +0100 Message-ID: Subject: Re: [PATCH] HID: hid-lg4ff: Fix uninit-value set_autocenter_default To: Phong Tran Cc: "open list:HID CORE LAYER" , lkml , linux-kernel-mentees@lists.linuxfoundation.org, syzbot+1234691fec1b8ceba8b1@syzkaller.appspotmail.com X-MC-Unique: IJRyYxmFMJm8ziglMNy3bA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 5, 2019 at 3:18 PM Phong Tran wrote: > > syzbot found a problem using of uinit pointer in > lg4ff_set_autocenter_default(). > > Reported-by: syzbot+1234691fec1b8ceba8b1@syzkaller.appspotmail.com > > Tested by syzbot: > > https://groups.google.com/d/msg/syzkaller-bugs/ApnMLW6sfKE/Qq0bIHGEAQAJ This seems weird to me: the syzbot link above is about `hid_get_drvdata(hid)`, and, as I read it, the possibility that hid might not have an initialized value. Here you are changing the initialized values of value, entry and drv_data, all 3 are never used before their first assignment. I have a feeling this particular syzbot check has already been fixed upstream by d9d4b1e46d95 "HID: Fix assumption that devices have inputs". Cheers, Benjamin > > Signed-off-by: Phong Tran > --- > drivers/hid/hid-lg4ff.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c > index 5e6a0cef2a06..44dfd08b0c32 100644 > --- a/drivers/hid/hid-lg4ff.c > +++ b/drivers/hid/hid-lg4ff.c > @@ -468,10 +468,10 @@ static int lg4ff_play(struct input_dev *dev, void *= data, struct ff_effect *effec > static void lg4ff_set_autocenter_default(struct input_dev *dev, u16 magn= itude) > { > struct hid_device *hid =3D input_get_drvdata(dev); > - s32 *value; > + s32 *value =3D NULL; > u32 expand_a, expand_b; > - struct lg4ff_device_entry *entry; > - struct lg_drv_data *drv_data; > + struct lg4ff_device_entry *entry =3D NULL; > + struct lg_drv_data *drv_data =3D NULL; > unsigned long flags; > > drv_data =3D hid_get_drvdata(hid); > -- > 2.20.1 >