Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1865973pxb; Fri, 24 Sep 2021 13:54:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJza6WlyvfKs8SSet25eIzflJvtKbEt74PRkmk9viacdAixBNoWwyhIRJ2d7GPYH83i4EpMn X-Received: by 2002:a05:6e02:b2e:: with SMTP id e14mr10176825ilu.82.1632516878094; Fri, 24 Sep 2021 13:54:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632516878; cv=none; d=google.com; s=arc-20160816; b=K6a8FyzSbdKkI0UfHXy9Eul2fRUNsEkvlva2sb+RKL5Gwef0gJAUeLRWKF01oFmHgT 3mexZ6GVDTCjukMj6+vBTcE/GJqfIf1r68vpLZeDh3v+r4Fw5FoAteT6y6XnScwWjIRS QcACFfaFSppflQaQ7fvU9CvXNRsfX1mRTGTa68gwyRFef2WnkZmKuDXeLrxHyIXCXx5W KwRRCKkz/H58i1XT94Yo1W1N0jxuBeNz5pcCmzifnvax5pH7nUMUpywu/xL3NOMAxYgT iwcyk218iDur+XnXgymXp+SDb4aAvCwt9Ce6EOOobHOfF88FiZ9rO3FiIem83U8HH1vz k82g== 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:dkim-signature; bh=7cWc4yzdb0VnFfnu4UMB5K2rNfvo1h4uviMaG/9Luy8=; b=ZWimRIGr+wc9HjWr87JbWglheykNA4z/qvKYanGpydKn2ztKSsBJTIOpMiGJzaOS2X JirHaM398Y6ZSkCZE1jQrNyI4xXEUsS04C1a7V+rgzQmvKLOu650EnhvEB1AG5R4BWwz ayV6KMm0ZhGCV89iWOKUOUPu27PPBDi1LxLo4V2Y7Xga8Ap1sO54/m8qD5fuDDiygGIO akd8H6yoXrIcA/u3g1ib6EyYqk++G6b4Ww3IzTgZLPZOFZgkXSeqFmI8AZyVYUVo57hg 4rADJo1sG9BsG3pmkxB33F8WPCctA5HCQQ7UqsuXu/w4y+TgAixprNY7AlYeg2Hu0GPZ NOeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=jUq7bdAP; 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 k17si14739872jav.64.2021.09.24.13.54.25; Fri, 24 Sep 2021 13:54: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; dkim=pass header.i=@ziepe.ca header.s=google header.b=jUq7bdAP; 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 S1346629AbhIXOWI (ORCPT + 99 others); Fri, 24 Sep 2021 10:22:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346674AbhIXOWH (ORCPT ); Fri, 24 Sep 2021 10:22:07 -0400 Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47CDFC06161E for ; Fri, 24 Sep 2021 07:20:34 -0700 (PDT) Received: by mail-qk1-x72a.google.com with SMTP id 73so28275313qki.4 for ; Fri, 24 Sep 2021 07:20:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=7cWc4yzdb0VnFfnu4UMB5K2rNfvo1h4uviMaG/9Luy8=; b=jUq7bdAP6GfaQzVHqsEAN1yhZxpZXIpCQX6jGOig1ZIcsJ16N5sRYGiVzSBsnsrAQF +Q80Vj1jInTt6ZbMMlSOTBWvZykFl6FWvPtSP1LUG2/LkzZ8kE5Os1NmxLaXE4V3EOik X4TQbe6kou6y73WNqR4j5gIhSIuvW6ThKo4o2nA0DX6LcOa63bN4ad0XkoP1B8nAcnVe pNI5vwGwzYcMVcEGk0VictQerdTKB20vJVowJCn21NzV+VienIlUX6NPY52Ziy8SE4Ef phvB07TanfmqYer6svKLlkxX1/VR927Lxk8YbXE40sT3O/ts9yJ1ORRwbTyitYbfTLGB 7edw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=7cWc4yzdb0VnFfnu4UMB5K2rNfvo1h4uviMaG/9Luy8=; b=WBTJKUL4WHhCxYbgmpONIreTew8g+9rUPZRDYe8lxonh/ofWRtELxqiCwENs8rNRK/ pUT/COHb9ItZyffbU4rs1WsBbwyc3nVoUsTbyE+HtB4c8461T+GdZhy/NJWyRnTiwrQD cC/h87XX1l1x7LrwM5BxrToKqH7SLsJOz+1O6wCMmM6StjORHskSrihiS7csc4VRMblv tIMwlmkmMK8g+M+igS6tEb1rutWD6fXMEG0FWOCUXRl0rBZZUfWV6wP71MNrFzyPwJho kJfOJWEEbXf+NDw4KPR02QNySf6pWEkddpk/WJQrJ/1+6rU4phPTgZ/bS0bnsZFLgEHu B69Q== X-Gm-Message-State: AOAM532qCnkjm8SwxGC7eoNZNF3JogMk6HgBzjxj48thwmR7sNM1UoF8 xnloMv784A4Aqb2cskF6tiAeFw== X-Received: by 2002:a05:620a:238:: with SMTP id u24mr10627934qkm.404.1632493233224; Fri, 24 Sep 2021 07:20:33 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-162-113-129.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.113.129]) by smtp.gmail.com with ESMTPSA id c16sm5531221qkk.113.2021.09.24.07.20.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 07:20:32 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1mTm40-005CHZ-8x; Fri, 24 Sep 2021 11:20:32 -0300 Date: Fri, 24 Sep 2021 11:20:32 -0300 From: Jason Gunthorpe To: Lino Sanfilippo Cc: Jarkko Sakkinen , peterhuewe@gmx.de, p.rosenberger@kunbus.com, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] tpm: fix potential NULL pointer access in tpm_del_char_device() Message-ID: <20210924142032.GY3544071@ziepe.ca> References: <20210910180451.19314-1-LinoSanfilippo@gmx.de> <204a438b6db54060d03689389d6663b0d4ca815d.camel@kernel.org> <50bd6224-0f01-ca50-af0e-f79b933e7998@gmx.de> <20210924133321.GX3544071@ziepe.ca> 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 Fri, Sep 24, 2021 at 04:17:52PM +0200, Lino Sanfilippo wrote: > On 24.09.21 at 15:33, Jason Gunthorpe wrote: > > On Fri, Sep 24, 2021 at 03:29:46PM +0200, Lino Sanfilippo wrote: > > > >> So this bug is triggered when the bcm2835 drivers shutdown() function is called since this > >> driver does something quite unusual: it unregisters the spi controller in its shutdown() > >> handler. > > > > This seems wrong > > > > Jason > > > > > Unregistering the SPI controller during shutdown is only a side-effect of calling > bcm2835_spi_remove() in the shutdown handler: > > static void bcm2835_spi_shutdown(struct platform_device *pdev) > { > int ret; > > ret = bcm2835_spi_remove(pdev); > if (ret) > dev_err(&pdev->dev, "failed to shutdown\n"); > } That's wrong, the shutdown handler is only supposed to make the HW stop doing DMA and interrupts so we can have a clean transition to kexec/etc It should not be manipulating other state. Jason