Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2012319pxb; Fri, 24 Sep 2021 17:56:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwAMVlCTkxVD+jry0+XxJyjWdZ5fdaVZWZttu4cDXSrchxqq/0YUpZS7NlpjumRI4zrF3y X-Received: by 2002:a17:906:8510:: with SMTP id i16mr4882075ejx.442.1632531387382; Fri, 24 Sep 2021 17:56:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632531387; cv=none; d=google.com; s=arc-20160816; b=GpGCFX8VFPIOrHXzb+Qlz1x7kIbAmfH7wG5WygBj0GZcRStUwzUaydx+k75lduBnki TXVGPXBeCEyG/K5AhKtfUWCwj9go6oL8YWn8FOFkFAC+2qiXDrcCAph4R5IObGZDfkKo +1XbUImEcjf+xwIISsJybSxN2ixmjBTc2z+WsBFjuV/LOMvLillKhxBh1OttDY9jf9fe rKFDgLa5QI7hoeNcngu4Pp/ep/EsSJGmwNV+t03vGWOGYpw5LhNaiRk4kyVSO0ul17NV 8A/0xL/6YhR5F4pVR5Jd81N7elozndTc+B6HoEhssGKntn8ghqsib+0Bn/aUTvTMHUD4 oe+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=pr0RZOMzxXrMHFBdCZaR3+l8sas8VDW0nrMQnd+FOgM=; b=Tl91pg+hnxsYnrmEeWjGAlTa3Bitx5F+eqYcFCHYAn8Z8GoQgDhHOQ3NFvHXcPwwsz duoqx4WSzw6QlilNsYbY2fZC3DOGLIftzxeintHhNv2mdqUTycwaNvXc1GIc1nR52aZi 5O66baTP9FyjyiyY1lXkENKNDHR1Ubi11yG1tD1QUsfeGtYjdJDyarNigEiWUrz9eqd7 SLGJ3dKKRWJ5xTGbfw+3xjscX0OMRXgLaBmA7MGxxA33/AsJVFHl1s2eJzAH+r6GcvRO PN+YJDbERqzpBJFGqvu0Sf4s3aRoILnxHX3mEKxIlXZb+tVg5qEKpm/fqT8Ri9O9C+5a bC2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=dzR2B3Pv; 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=gmx.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cc25si1186664edb.495.2021.09.24.17.56.03; Fri, 24 Sep 2021 17:56:27 -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=@gmx.net header.s=badeba3b8450 header.b=dzR2B3Pv; 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=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345984AbhIXOTc (ORCPT + 99 others); Fri, 24 Sep 2021 10:19:32 -0400 Received: from mout.gmx.net ([212.227.17.20]:39995 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344675AbhIXOTb (ORCPT ); Fri, 24 Sep 2021 10:19:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=badeba3b8450; t=1632493072; bh=pr0RZOMzxXrMHFBdCZaR3+l8sas8VDW0nrMQnd+FOgM=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=dzR2B3PvydKfjx4kez0+Shf+7KWXKBoI85+xrYcqvfoXDa0xDrdbwgWDk1ZHmIwY5 XXWayzjA9LBRtIMuUQbGdLckIoNEM+Zx+v9Vn8lKbw0VnXSY8zy9rSXopAF+hfNlmi Gv0ltwrNM8zRwqGnvwmLPpamOWIEvrR+V0IdfxEc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.178.51] ([46.223.119.124]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MEm27-1mf3V52q67-00GJ9w; Fri, 24 Sep 2021 16:17:52 +0200 Subject: Re: [PATCH] tpm: fix potential NULL pointer access in tpm_del_char_device() To: Jason Gunthorpe Cc: Jarkko Sakkinen , peterhuewe@gmx.de, p.rosenberger@kunbus.com, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20210910180451.19314-1-LinoSanfilippo@gmx.de> <204a438b6db54060d03689389d6663b0d4ca815d.camel@kernel.org> <50bd6224-0f01-ca50-af0e-f79b933e7998@gmx.de> <20210924133321.GX3544071@ziepe.ca> From: Lino Sanfilippo Message-ID: Date: Fri, 24 Sep 2021 16:17:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210924133321.GX3544071@ziepe.ca> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:oWjlOrtiKQPng30WZ0cwBATS5seyB+BK20TFO6LvBOAyir8R5v0 83Q0Zh73oZzZHgMBZIG+V+Y6zSE8TqfzIwG12mo++4SYVd2P0bRprVMnUPHrGb7KnpdkaOE aMTMeQJB9zucxFSLJVR+/UTWa3I/yLvOb9SN54sS2wV6/NpadaXABr2andOHvzFxCVgodLQ oaeWXGfHRQpLvCVaALcBg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:np5Jp9L7dRg=:tAasIpqrbfKwrh1T4UY/mT o2J2BaBJKO197LSAo6f9u9dtC/fhmmIibqKT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ZI= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 i= s 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 =3D bcm2835_spi_remove(pdev); if (ret) dev_err(&pdev->dev, "failed to shutdown\n"); } Regards, Lino