Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1598286pxb; Thu, 4 Feb 2021 18:06:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJwOwoy6IIe/3iomtjHVQQSqBeVqj2Aj/4Bf+mCXFAs/1ruK4Ne073O4GKVVO0lGUOkfrRRe X-Received: by 2002:a50:e008:: with SMTP id e8mr1330386edl.339.1612490788959; Thu, 04 Feb 2021 18:06:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612490788; cv=none; d=google.com; s=arc-20160816; b=gar+AoVRGxW5enn8ItXw8i/HBuQfOYwQUo4fJMAgRbRFOtmGzlS0HeszX0gSXY0hQj kUu/5hBMQKAXVwb8Mkye1Lcf8fXg2UutOFPr6J0sG2HAYOEDz1H9X3JkL5Jp8Hj+Mc8w SLeaZ4Rv4eoAcBkAvq+ny9+1RvHOnXiXHqNdu84Mlyeg8XeowGCEDQlb+OVNvAliMCLN aL9Gp4epQi8ikDW5oNEKj8CTjUZnl8TeEnl5h3PmvgF+wucXX/9E1MglcCAWfZTNWVnG 6DSVKt+Zlp0m5pYNQfZ//dwoHzItHJ/1sgBr6ou2iwKC8prS77tl305b4UC9rtSUJ35z mxrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature:dkim-signature; bh=t9oG+tpqTdtdeav5lRtLKS6YTkhnrpxQf7p2TfS7yfk=; b=QBwuuQNYR/W0HsNTwngq93ICilDjjjaJUuv0zyk3/OU1yg/N7bC+0apphPrLmyEUeh /ewebYM2XDYZzaDX1gtfINJH9REePvC0ZlEGT2FUz1nDhADtt6FF56S68qdOXU/N/7No 98sOaNPo51I/0HX46Fo2ThzVnJJNwKxL3mF0GlKwO0bOPB/q18y/tdKU0afWQbCEs7/d cMw4H2B9seHGZt3n1rh9jBkOR6GlW54xa+D15cU6TA0k6GQb17hWd2DFfRABWiBH9a3X Uqa0cqh82/FhRX0e8x5hJhzxX3qad473lD8ip1O7HJdpvUXEoenzXb3f8p5Otv3KmmCe bK2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=mJPaUj42; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=mJPaUj42; 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=hansenpartnership.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lc13si2807549ejb.412.2021.02.04.18.06.04; Thu, 04 Feb 2021 18:06:28 -0800 (PST) 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=@hansenpartnership.com header.s=20151216 header.b=mJPaUj42; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=mJPaUj42; 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=hansenpartnership.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229841AbhBECCR (ORCPT + 99 others); Thu, 4 Feb 2021 21:02:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbhBECCO (ORCPT ); Thu, 4 Feb 2021 21:02:14 -0500 Received: from bedivere.hansenpartnership.com (bedivere.hansenpartnership.com [IPv6:2607:fcd0:100:8a00::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B320CC0613D6; Thu, 4 Feb 2021 18:01:34 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 56F1612806F8; Thu, 4 Feb 2021 18:01:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1612490492; bh=D07B0G2Q3u5JuWGOyZqEqTnrtgfD1PaA3n45mlDA+l8=; h=Message-ID:Subject:From:To:Date:In-Reply-To:References:From; b=mJPaUj42P4gcs1KP+2iN22vzTXRG/SiTFJmlrK7FwgbqjEd/ftmZ1fSfjo9TH+IYB zKzYgwNAKpICjmdEb80exJZFGx2v9J7ux4/j8rg4KOmqdwHaGSlSyBSNqxWAe3fCMP QWhMFD0U2Nu2W8/RcbWfDyKNqa/1VOsvJwFoW9T0= Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AEzeM8bIVfkt; Thu, 4 Feb 2021 18:01:32 -0800 (PST) Received: from jarvis.int.hansenpartnership.com (unknown [IPv6:2601:600:8280:66d1::c447]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id A3D2112806A9; Thu, 4 Feb 2021 18:01:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1612490492; bh=D07B0G2Q3u5JuWGOyZqEqTnrtgfD1PaA3n45mlDA+l8=; h=Message-ID:Subject:From:To:Date:In-Reply-To:References:From; b=mJPaUj42P4gcs1KP+2iN22vzTXRG/SiTFJmlrK7FwgbqjEd/ftmZ1fSfjo9TH+IYB zKzYgwNAKpICjmdEb80exJZFGx2v9J7ux4/j8rg4KOmqdwHaGSlSyBSNqxWAe3fCMP QWhMFD0U2Nu2W8/RcbWfDyKNqa/1VOsvJwFoW9T0= Message-ID: <78f6bc5799c744dc3fdb2f508549cedf76ac1c1d.camel@HansenPartnership.com> Subject: Re: [PATCH v3 1/2] tpm: fix reference counting for struct tpm_chip From: James Bottomley To: Stefan Berger , Lino Sanfilippo , peterhuewe@gmx.de, jarkko@kernel.org Cc: jgg@ziepe.ca, stefanb@linux.vnet.ibm.com, stable@vger.kernel.org, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, Lino Sanfilippo Date: Thu, 04 Feb 2021 18:01:30 -0800 In-Reply-To: References: <1612482643-11796-1-git-send-email-LinoSanfilippo@gmx.de> <1612482643-11796-2-git-send-email-LinoSanfilippo@gmx.de> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2021-02-04 at 20:44 -0500, Stefan Berger wrote: > To clarify: When I tested this I had *both* patches applied. Without > the patches I got the null pointer exception in tpm2_del_space(). The > 2nd patch alone solves that issue when using the steps above. Yes, I can't confirm the bug either. I only have lpc tis devices, so it could be something to do with spi, but when I do python3 in one shell >>> fd = open("/dev/tpmrm0", "wb") do rmmod tpm_tis in another shell >>> buf = bytearray(20) >>> fd.write(buf) 20 so I don't see the oops you see on write. However >>> fd.close() And it oopses here in tpm2_del_space James