Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp5894481ybh; Wed, 7 Aug 2019 13:18:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpEtQxOGsuIY/YJRnHhCpqJ+zEQeTIsoyh5r7pcH2nEw5DoQ9I0zlZcg61VDLR0z7zxFpi X-Received: by 2002:a17:902:2f05:: with SMTP id s5mr5531546plb.170.1565209086984; Wed, 07 Aug 2019 13:18:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565209086; cv=none; d=google.com; s=arc-20160816; b=GqqKDK1RxrKo6IeMJww0Y6NsOh/40Io7/BLMuvR17iZV0m4gzcuPUO8r1T0ypapMNm XxzETNc6nTWAzFln4Jh0oH63jaazxZ6U9SY9QTsrK8sJ8udH3ts2wyUs+V7VW58EyGO3 yJ8D2GjRqxY/aTHuMz4VcFm1I6MDGv/fNONQIFleuaeEvozYZmWo5Y3Jpwt+vAwv4wHH btpuKEyDALRpQsO0xSJc9S3TsYvlVwEHjmq0nB2gv8+xzai4aZSurYATXpP8g+QAnf0J y5ubbJhE1ipFWXN75GDH7ELby1860C0MUh/UrJhxHG0rsIslGfV+EnYDYl0/wQdI8YbK n0xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=Gg3//kSYxZ3hfasGJ09OzX75vf31+tbuVhHl8sgo9LM=; b=YrmuVr1hD0wjVKdI/36UmcdXa3r+x2WvCrWE708Qu5+bd3ibcasLB322P64lrSwij1 kVUGyk/UnR0Jcqu6dcuphZb3ag70pWyuQR4K80fDmdRmNHs47Ac2L05yxx5aAr9loLhx 3n6jtjqlXawfqE3f6I/198BoCNoi6Y/u4C/rjTQmU0AbEc1gyhJZi4ixMDuPw5EN5njj 7nWQNIPD8B4UMCoiTtGiAPx4MmXK8DW4F1a5RqYvLWS6r2KRNNX/+h9ILRHeyLXUJ34J 6BxyrdqgVY9sztjW1I5uRlyxePgJShW7dKQUeY34f/QN2x3wiv+1fs0uX9iKyMWCP0LM nIqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=MkjcNjs3; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k65si48512575pge.422.2019.08.07.13.17.51; Wed, 07 Aug 2019 13:18:06 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=MkjcNjs3; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389374AbfHGUQM (ORCPT + 99 others); Wed, 7 Aug 2019 16:16:12 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:33166 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387969AbfHGUQM (ORCPT ); Wed, 7 Aug 2019 16:16:12 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x77KG9Yb080819; Wed, 7 Aug 2019 15:16:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1565208969; bh=Gg3//kSYxZ3hfasGJ09OzX75vf31+tbuVhHl8sgo9LM=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=MkjcNjs3K4sFjoAq2DXmIu7gOyxrc9EAzIb/RvRJbvGnqeER5J7DPS+a3D7j1X6b9 ThT+nJ5vC0E3KVAKpIpHF3VRLRA9Bia61YX/EFUtXJqtqyA/R+BmfvsrkOONbCTAYh +okTFSCKFZZytuJfqZEybd097/YJmUwDJeEU2UXY= Received: from DFLE107.ent.ti.com (dfle107.ent.ti.com [10.64.6.28]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x77KG90h047223 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 7 Aug 2019 15:16:09 -0500 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Wed, 7 Aug 2019 15:16:09 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Wed, 7 Aug 2019 15:16:09 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x77KG9Ia025291; Wed, 7 Aug 2019 15:16:09 -0500 Date: Wed, 7 Aug 2019 15:16:09 -0500 From: Bin Liu To: Jia-Ju Bai CC: , , Subject: Re: [PATCH] usb: musb: Fix a possible null-pointer dereference in musb_handle_intr_connect() Message-ID: <20190807201609.GD14027@uda0271908> Mail-Followup-To: Bin Liu , Jia-Ju Bai , gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190729090428.29508-1-baijiaju1990@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20190729090428.29508-1-baijiaju1990@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 29, 2019 at 05:04:28PM +0800, Jia-Ju Bai wrote: > In musb_handle_intr_connect(), there is an if statement on line 783 to > check whether musb->hcd is NULL: > if (musb->hcd) > > When musb->hcd is NULL, it is used on line 797: > musb_host_poke_root_hub(musb); > if (musb->hcd->status_urb) > > Thus, a possible null-pointer dereference may occur. > > To fix this bug, musb->hcd is checked before calling > musb_host_poke_root_hub(). > > This bug is found by a static analysis tool STCheck written by us. > > Signed-off-by: Jia-Ju Bai Applied. Thanks. -Bin.