Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp482925pxu; Tue, 6 Oct 2020 11:00:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvXw3nQ0XzcmJrE6Kg33Ns245/lwzbQ35ZvPnXZpU0aOP45F0BW4HZCpwsp9MZL3GGASfQ X-Received: by 2002:a05:6402:37a:: with SMTP id s26mr6672831edw.268.1602007218307; Tue, 06 Oct 2020 11:00:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602007218; cv=none; d=google.com; s=arc-20160816; b=s8kNvhQmvF0llAW3KblTVsFWRBlG9YRWNGUI4VJmU4LqZFI1w9AQVZc49BXlH1jsHC 4238L5N7VoBScQNOTIl33gadI+uUmbvMgdqHKO12LTBSbqSU3CswLWX5FspHcGr1iBLB tPvB3kdiJ5y2ed0uuRLS0EUxpiE6RgzNj77fz4eQbFB9+znaBFyqd2w7KhbpkLKT7/FJ s85tt5udAAXJg0FeSIRTLi63JBSipX/pJfsiAgFuxGChjxb+juuotrk1rwBys+lCxgO7 FfU0nGUnZ1al2eNP+4FSg3vyKs/mSmuPZ8TxXeFIcC+8VwrK8mQTelxaR3AckveQ4Trk 28og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=JcO8ginY374P4aER1MTrwBA2BRuyP500DT4IE9oZ3uY=; b=zlw6sXVle8mPeNvRKQ/IF2k4a6jkRqRUl5znJ5QHnzRywZOWUPbaz6qPUR6j23PnPX lcioOTISq3wGpscv4t1rJDMGLu+69tn5nwos+gb0qkfEKP6oBV2zUX0wXIUohq4EuxLS tI6r0W6lr/Inm9dBt8mVmzFafm/1LRuu6ejZOowFSBcbxq5Ec6hn8HaHycCdFGJlnZDE bVxHjlUKwFN5s5xTFxN4HRlY50+MbamjxA9XE5/eGdBxpdkD7kzjKWWUkLsnGJuPt1Z6 ahzvbyHaG/ltzPIQ+8lNx3vsHkql7QktTFH9Jz8gw3xkocg+4xdwGmiW8w2lxFoJxDHR 2gUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b12si3055053edv.217.2020.10.06.10.59.54; Tue, 06 Oct 2020 11:00:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726623AbgJFR6q (ORCPT + 99 others); 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