From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB023C41604 for ; Tue, 6 Oct 2020 17:58:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7E0D2206D4 for ; Tue, 6 Oct 2020 17:58:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726725AbgJFR6q (ORCPT ); Tue, 6 Oct 2020 13:58:46 -0400 Received: from netrider.rowland.org ([192.131.102.5]:41705 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726197AbgJFR6q (ORCPT ); Tue, 6 Oct 2020 13:58:46 -0400 Received: (qmail 426512 invoked by uid 1000); 6 Oct 2020 13:58:45 -0400 Date: Tue, 6 Oct 2020 13:58:45 -0400 From: Alan Stern To: Sudip Mukherjee Cc: "Harley A.W. Lorenzo" , "gregkh@linuxfoundation.org" , "linux-kernel@vger.kernel.org" , "linux-safety@lists.elisa.tech" , "linux-usb@vger.kernel.org" Subject: Re: [PATCH] usb: host: ehci-sched: avoid possible NULL dereference Message-ID: <20201006175845.GC423499@rowland.harvard.edu> References: <20201005213149.12332-1-sudipm.mukherjee@gmail.com> <20201006012544.GB399825@rowland.harvard.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201006012544.GB399825@rowland.harvard.edu> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 05, 2020 at 09:25:44PM -0400, stern@rowland.harvard.edu wrote: > On Mon, Oct 05, 2020 at 11:19:02PM +0000, Harley A.W. Lorenzo wrote: > > On Monday, October 5, 2020 5:31 PM, Sudip Mukherjee wrote: > > > > > find_tt() can return NULL or the error value in ERR_PTR() and > > > dereferencing the return value without checking for the error can > > > lead to a possible dereference of NULL pointer or ERR_PTR(). > > > > Looks fine to me. There is in fact no checks of the return value > > before a dereference here, and this solves that. > > > > Reviewed-by: Harley A.W. Lorenzo > No, this patch is wrong. In fact, these calls to find_tt() cannot > return NULL or an ERR_PTR value. Sudip, if you would prefer to submit a patch that adds comments to those call sites explaining that find_tt() will not return NULL or an error, that would be okay. Alan Stern