Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp617693pxb; Wed, 27 Oct 2021 09:07:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyz1M/26fE2FbW/nC3fr8u9xbEBpPeoGSMT/y2hpZe+/uC1vrfOnr2tLf62FoNpwZ2Y6dY X-Received: by 2002:a05:600c:4c09:: with SMTP id d9mr6663216wmp.129.1635350821908; Wed, 27 Oct 2021 09:07:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635350821; cv=none; d=google.com; s=arc-20160816; b=d1NI1nuFE5bfy4N6X2zVLXGZdjDoekljIEZVLV6zLNSbk55Ss48Q4fq7vjZfhTg4zu zPpNkE1Zm8lFxsdnpcfEJscoE7YrZ4MMUp/QPQ8n5l9WxT4RPRS2VeJ6As5gLPe8Pf8a 8eRiNDIxwRGpCHXaRGq0549Z/rf9Vn0AMeJUQLVjtJlo+jjawcu+xdlq+iKshEHdyrL+ uiRID4NdoD/weeLWZZb1pR9ES7b2eskwpxfTafdA0E8+gRIW6GajGzspTsfjMxQ1ooyX au07FW5+aexX9/h6GJVvgla1j6MDqHgz3kPrnxNmce9yzH1v5YPnms+Ds512PunJxcKb l2RQ== 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=qJd47H91uJX8+/3t4JLqpBvc8MLAZ0S5YqMa2lE+7T0=; b=bz1uWuY31wLj0k1nOvStBvYBJA6sXPEDI/B1bFW0kg/D72xj0ewo2+APvxJagpHLKo U1zdzUhIbuJ1/OoDFgVnwEl1fTU0BNarcrlZrQOEL/AxMHV2pqB+M5Axxpeu2ugNJt5Q axo/yCpQaq1L6+Aahz2PKLyQj6stmBUUlhOsBPkA7t/BVjdqACsKg4wem7es7vCTO1cU gu8sVUiWHys2gmdDDusXuxRG8mtpTApFLPXmzTrBrrHnzk665rS320P22od8rPJC6dQc awjLB3BBg7itTzooSaccJoaxJ7mdiLjotugoBByV196eoAwp5iAjWbT57x9Su95Zx2Zp Qz0A== 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 i12si443066edc.272.2021.10.27.09.06.35; Wed, 27 Oct 2021 09:07:01 -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 S238862AbhJ0C61 (ORCPT + 99 others); Tue, 26 Oct 2021 22:58:27 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:56350 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238838AbhJ0C6Z (ORCPT ); Tue, 26 Oct 2021 22:58:25 -0400 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtp (Exim 4.92 #5 (Debian)) id 1mfZ6U-0000zs-Ty; Wed, 27 Oct 2021 10:55:51 +0800 Received: from herbert by gondobar with local (Exim 4.92) (envelope-from ) id 1mfZ6P-0006NJ-9Z; Wed, 27 Oct 2021 10:55:45 +0800 Date: Wed, 27 Oct 2021 10:55:45 +0800 From: Herbert Xu To: YE Chengfeng Cc: "davem@davemloft.net" , "nicolas.ferre@microchip.com" , "alexandre.belloni@bootlin.com" , "ludovic.desroches@microchip.com" , "linux-kernel@vger.kernel.org" Subject: Re: drivers/crypto: suspected null-pointer dereference at atmel_sha_init Message-ID: <20211027025545.GA24480@gondor.apana.org.au> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 26, 2021 at 09:07:43AM +0000, YE Chengfeng wrote: > Hi, > > https://github.com/torvalds/linux/blob/master/drivers/crypto/atmel-sha.c#L431 > > We notice that the return pointer of atmel_sha_find_dev could be null, and it seems that null-check is missing at #line 431. If it returns null pointer, there will be a null pointer dereference problem at #line 437. We check that other call sites of this interface perform null-check, while this doesn't, so we suspect that this could be a problem. > > This is detected by our experimental static analysis tool, it could be false positive, so we manually check and report those we think may be true bugs. Would you like to have a look at them? It could be a real issue when the device is hot unplugged. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt