Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp885213pxb; Wed, 27 Oct 2021 14:27:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDBQPV5eyUo4ktqyIUm/VDF9C8yr/aF5SJ5IFMiDhVtm+C4l3acx+nGAHW+r1fNDZm5pYY X-Received: by 2002:a17:902:7c10:b0:13e:e11e:8d1c with SMTP id x16-20020a1709027c1000b0013ee11e8d1cmr221615pll.55.1635370058344; Wed, 27 Oct 2021 14:27:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635370058; cv=none; d=google.com; s=arc-20160816; b=bHv9AfB4sLAEtb6vJ0IxBZM0Nu8fX/SVn9ACdnaxtdyzPOuTRC2Q2yD5rYSLMRZGLa nLrLGz2gVzv54Cy05u+A4wrEdo9sht4KqHcm16Z3SKkrOFY3eGI/RLei3ubA6LzBJ36i 3lOrAeXcOQXMgox50dbFqhBEQrv0haOlzJZqtgI555bYYr6E272pdqOC6432BQaqbpeM Y9YKmpTj0EA2Uh6gOkWfeyFLdk3rrcn+2MxcKfZuPnmt63P2gzR9eGTa2Yr2M8REQChb ksHk9aIX51ZQpZQTKghbiwOZ+w9drPK21bBQuJslTQMi+kPiGSBqEBRgtvY89T9TT5Qo TV9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=WrdD/BEWpLjOdP0EnZAGVsCrqeO2Yh12BjXsE4rhk5A=; b=xBjIjmNUriycsB8Qlcefyu0hmbOEhM372z39QMsMODPMuiT8I9jxET8+aMD0pKZvZD lCG/weMJ92jPV2ilnJjU2B5bo8VzVFtMLpGObu8tr66I3+WZq2N/+l28h/9i2ZEiOTQC LQFX1yMXAPBc/AbNkli9XAtLq8MsSF9LgvCI6l+nj3JUTRaU/Q1LHsyPylQCN12JfRPX 8N9txnWuERIs9lF+sB7YDGq2j4aja9JdH9ldG7el7TmadPECI2NYSA5dBB2hnFOQRlp2 /gr7XCe3HvStNX1O4jwp5rzsGSBomV2JooCzphBnV0MGKFPHNxFiGu1oLM+J1NVV5A1J o3Uw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y139si1722508pfb.222.2021.10.27.14.27.25; Wed, 27 Oct 2021 14:27:38 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237490AbhJ0PHC (ORCPT + 97 others); Wed, 27 Oct 2021 11:07:02 -0400 Received: from mga12.intel.com ([192.55.52.136]:52586 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235373AbhJ0PG5 (ORCPT ); Wed, 27 Oct 2021 11:06:57 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10150"; a="210262584" X-IronPort-AV: E=Sophos;i="5.87,187,1631602800"; d="scan'208";a="210262584" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2021 08:04:31 -0700 X-IronPort-AV: E=Sophos;i="5.87,187,1631602800"; d="scan'208";a="597390938" Received: from rtrevest-mobl.amr.corp.intel.com (HELO intel.com) ([10.252.136.107]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2021 08:04:31 -0700 Date: Wed, 27 Oct 2021 08:04:29 -0700 From: Ben Widawsky To: YE Chengfeng Cc: "alison.schofield@intel.com" , "vishal.l.verma@intel.com" , "ira.weiny@intel.com" , "dan.j.williams@intel.com" , "Jonathan.Cameron@huawei.com" , "linux-kernel@vger.kernel.org" , linux-cxl@vger.kernel.org Subject: Re: drivers/cxl: suspected null pointer dereference in core/bus.c Message-ID: <20211027150429.ofg4vnwmnkj4aiky@intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21-10-27 11:35:25, YE Chengfeng wrote: > Hi, > > https://github.com/torvalds/linux/blob/master/drivers/cxl/core/bus.c#L98 > > We notice that in multiple call sites, the return pointer of to_cxl_decoder is not null-checked, could it be a potential null-pointer-dereference problem? > > This is detected by our experimental static analysis tool, it could be false positive, we manually check and report those we think may be true issues. Would you like to have a look at them? > > Thanks so much, > Chengfeng add linux-cxl... If NULL is returned, it's a driver bug. The WARN_ON and subsequent NULL deref oops is desirable.