Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp4062498rwr; Sat, 22 Apr 2023 19:43:41 -0700 (PDT) X-Google-Smtp-Source: AKy350Z3NJ3UFSxvEu0S774Xf7+RyzGqitMfM7rr41bVdMlfDCRzbWHWahnJoWmcIYKvu0G/Cptn X-Received: by 2002:a05:6a21:339a:b0:ee:d41e:7a1f with SMTP id yy26-20020a056a21339a00b000eed41e7a1fmr11553202pzb.2.1682217821377; Sat, 22 Apr 2023 19:43:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682217821; cv=none; d=google.com; s=arc-20160816; b=eovMK+CFVPAxshmycc09dsj9on8C6vryfUiW68yjoiud0yuo0CgpQ4OvuJIbrAb4Bo idbAFT+fUNppwRjva/wRXZyCgqeJU0nOeX9In1v1ebHR99oZyjudBRgEYWODSNPKRGz/ e1yMd/bjFZTByhfrFxvtUW7+Tr0X5usLhm4qCc0lYzsO/EtAj8w35XmL4voB+rWEyGU1 BhL+Xp7DOOc1aMm6k1TC31vo36tbZMHfwAJZol/rh3f3TCHJWPDmXcdrVwlxlVCBdy9d 1SnfpE7kC0evYoPrdiMhwv4R7iQ0JED0O0ty/PvoQV7gHFu5QXzcludrTqZKfQ+zsbQ/ yIWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=vya3D5y/KOAhDWFzwGNXiKKA07E3G1dQLHRJ/nBp33U=; b=idE2z9/dILcy07myUHfVp4tjrc+EBTavYXHTir9B50BkTOrqVzIHb8tIu5u0hp5e8l E1HwYR/QzPlj3Ym4/KA998BcnlvoaRtlnhqB8Q8+V6DPE4hzxVtRX08i/fTy2X3AwzRs z3nu51kJ+kwLeQmJqBPj0Vii1IJDkMskYwoLrxPRIUo4ZvPLe7VDWeJWUcdGKvDPrFua tFa/821CQTrSgqn3Rc2I8ayZmttlppI31bsfuwmadBQNo9G/1XyHDy/8V23pKyqvI5KM 1vqEAJ2vnNjyz1ddwBamqKlV0llIq6/2Knm/P6ZxTLR4HR9gBNR6rEPoeKDzxtfDRCZx eM9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t191-20020a6381c8000000b004fc2def26adsi5288268pgd.197.2023.04.22.19.43.25; Sat, 22 Apr 2023 19:43:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230025AbjDWCfB (ORCPT + 99 others); Sat, 22 Apr 2023 22:35:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229771AbjDWCfA (ORCPT ); Sat, 22 Apr 2023 22:35:00 -0400 Received: from hust.edu.cn (unknown [202.114.0.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24B1A1BF0; Sat, 22 Apr 2023 19:34:58 -0700 (PDT) Received: from [IPV6:2001:250:4000:5113:78e9:d35:fdff:4057] ([172.16.0.254]) (user=dzm91@hust.edu.cn mech=PLAIN bits=0) by mx1.hust.edu.cn with ESMTP id 33N2XTsv018716-33N2XTsw018716 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Sun, 23 Apr 2023 10:33:29 +0800 Message-ID: Date: Sun, 23 Apr 2023 10:33:29 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH] Input: xpad - fix GPF in xpad_probe To: Dan Carpenter , Dan Carpenter Cc: Vicki Pfau , kernel-janitors@vger.kernel.org, Dmitry Torokhov , Pavel Rojtberg , Nate Yocom , Mattijs Korpershoek , John Butler , Matthias Benkmann , Christopher Crockett , Santosh De Massari , hust-os-kernel-patches@googlegroups.com, syzbot+a3f758b8d8cb7e49afec@syzkaller.appspotmail.com, "Pierre-Loup A. Griffais" , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230414125603.686123-1-dzm91@hust.edu.cn> <011c00e7-c351-4331-8be4-1c184d5773e1@kili.mountain> <3ccc85bd-0541-4ffb-a207-dfc533a2c0aa@kili.mountain> From: Dongliang Mu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-FEAS-AUTH-USER: dzm91@hust.edu.cn X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/4/23 03:48, Dan Carpenter wrote: > The warnings from this are quite promising. > > When you're writing a check, you start with a simple idea and then try > it and then filter out the common false positives. > > The first 10 warnings are from loops like: > > p = NULL; > > for (i = 0; i < limit; i++) { > if (i == 0) > p = non_null(); > else > *p = something(); > } > > Smatch doesn't handle loops correctly. (I know how to fix this but I've > never gotten around to it because it would make Smatch slow)... > > So instead of that maybe I would do a hack to silence this type of > warning. Not sure what... > > drivers/usb/gadget/udc/amd5536udc_pci.c:61 udc_pci_remove() warn: pointer dereferenced without being set '&udc->gadget' > This one is interesting. Seems like a real bug. > > drivers/mtd/ubi/block.c:391 ubiblock_create() warn: pointer dereferenced without being set 'dev->gd' > > This one too. So maybe we could make this a separate warning where > NULL dereferences happen on error paths. Or maybe when they happen in > printks. > > So there are ways to take this first draft and massage it and get > fewer false positives, by filtering false positives or taking things > which work and creating new checks instead. Hi Dan, thanks for your efforts. After finishing the current task list, we can first ask senior students to check this result quickly and then assign highly-to-be True Positive to students. BTW, do you have any plans to improve the code readability, directory orgranization, documentation etc. of Smatch? It's hard even for senior students to start with. > Anyway, results attached. > > regards, > dan carpenter >