Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp241977pxb; Mon, 13 Sep 2021 18:07:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQG434acZo3kx90BD7pGKPWGZ87LD3OurjotF0TBdfMFVorwwshafseJKiMW9nZ0O5JbOu X-Received: by 2002:a05:6402:2695:: with SMTP id w21mr16331341edd.182.1631581666784; Mon, 13 Sep 2021 18:07:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631581666; cv=none; d=google.com; s=arc-20160816; b=N/mV/wD9N5iuglseXCkFfoewwiA4hBHZeV7BnMqN7huUh+2qgL+ILd05RSLnOyqg7y TADVjzVVHwJHDSjD7v+XDHFVSdXY+p6dc8Zn/F4oe8+tzpNndHKzvAhVTye1dQNN5F+5 SqywtwVv9raq3caniWVN/6OgqcRecpJ9kx87D7WgrZjrdoWE71XMVNAw0bAMep4+61Rc F+EEJzSQcn1QumRq6oYa6dEE4PtXcF68ic49eyezi1On0ZRr6N1yG+J20ez5/dBqO3hw 3IuOtgytXmCndGKp96JTMY3rTowgl+90kULu4O1DsiODCtnYcwjV3ZeoiAJqhWb2xSvJ eFRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=LmrkTXGLxqB3M/lZRSixfuJmMep+oIFHcEcQHLhWbjo=; b=AtqV+RgO8yRWzY0UnPiUXw0AFQTI0Q3Bi3N304+MAeNaLSavrm3ZsXpft7ynmmsdrk PGVcLd5rfvhZ9InWmkDXF5ByY7l/qFTJ/SbfSpkYhHyClxEfyofdem0em9km4CdNIcP4 93vj4E+2Mz9KiJa445t+Ilt1LjzCVlShBrCuYIhGJq/RCqSZaPD5IoMpZYBy8imRG3mD RMp7Auv/MaQNplmQxgONJtMNZBhLws+Yv1l7DzYC8BrE+U9+IpvQHtnDMinfN9YbsBXR 9W1XAps7CuIgPxoE9+KrZoWzGgO2xWqGiskrlixFaKKUF/Bwajr2by7P/G7Y1B5bnTRm hItA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bD0zV2AE; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l12si8360981edb.8.2021.09.13.18.07.23; Mon, 13 Sep 2021 18:07:46 -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=@kernel.org header.s=k20201202 header.b=bD0zV2AE; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243550AbhIMU1A (ORCPT + 99 others); Mon, 13 Sep 2021 16:27:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:58390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230404AbhIMU07 (ORCPT ); Mon, 13 Sep 2021 16:26:59 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BF2BF60F6D; Mon, 13 Sep 2021 20:25:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631564743; bh=LmrkTXGLxqB3M/lZRSixfuJmMep+oIFHcEcQHLhWbjo=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=bD0zV2AERL5+aWB0mht7HUBamoM+bg9Z4FTvRtjXvTGx8zrRPu61rq7ijHH8QVAcv rhtSnNWadVBvrAQ//PXe+cP31aD9YmpmH+hLTF+pS3kMq93BWzdJ6YRLoagobDFbF7 nBtK0pZ9CmFnlrnjsFjM8ZjBZg4yXII6Nk2wq8M/gMRaRy0/Bn0yggPHhDxiOekg+S reiJycM5+TwKDL7tOc0JsBQBfqB9DbtLQ3tk9HWtwZuhSFHCJyBx/DvHtkzaKIYAra Eh0XzrixDikjqQFMy62i7vXG7b0QQ8HjWmd1MfrRQyeu6wln+mSMNkT15ziQVI3Xx7 6F35FAXinP0/w== Message-ID: <204a438b6db54060d03689389d6663b0d4ca815d.camel@kernel.org> Subject: Re: [PATCH] tpm: fix potential NULL pointer access in tpm_del_char_device() From: Jarkko Sakkinen To: Lino Sanfilippo , peterhuewe@gmx.de, jgg@ziepe.ca Cc: p.rosenberger@kunbus.com, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Date: Mon, 13 Sep 2021 23:25:40 +0300 In-Reply-To: <20210910180451.19314-1-LinoSanfilippo@gmx.de> References: <20210910180451.19314-1-LinoSanfilippo@gmx.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2021-09-10 at 20:04 +0200, Lino Sanfilippo wrote: > In tpm_del_char_device() make sure that chip->ops is still valid. > This check is needed since in case of a system shutdown > tpm_class_shutdown() has already been called and set chip->ops to NULL. > This leads to a NULL pointer access as soon as tpm_del_char_device() > tries to access chip->ops in case of TPM 2. >=20 > Fixes: dcbeab1946454 ("tpm: fix crash in tpm_tis deinitialization") > Cc: stable@vger.kernel.org > Signed-off-by: Lino Sanfilippo > --- Have you been able to reproduce this in some environment? /Jarkko