Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3180371pxk; Mon, 28 Sep 2020 10:14:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxq5PgHcByFB2pmBB/teM9XOGJ9+NoP/D0wm9CC4hI3QKPiyKc3w1KP63cRKzQrDOk0RBRd X-Received: by 2002:aa7:d34b:: with SMTP id m11mr3001393edr.178.1601313292136; Mon, 28 Sep 2020 10:14:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601313292; cv=none; d=google.com; s=arc-20160816; b=PPmNo+KYYNMS9wQAIX0iI4lKBPKziLlIBgXXMAxZaydN7vr56tYSeKzvO0aBXBgz6t LX7CTP9A9P471IHyKzuRMANzawJzFSXcVcJfWCbmpDh+C1Br1DlM7S3DL1AaTzf18JKB BlS5w1JD3CA4LY5ywO4eN1cLqokvz8tLfuwZ+8/+p3VAB14mKp/Avr2bcwlu1elPAlxm NMGmw7geYCI1E7gHAMGaFHbV/jlmcZCD1FN1PqKEa7Cq4PAKcSxve6hDI8D+pmuiQICP 2/kM/z2VDdk0Scm42EE8RzSd1I2LX7rAGd3l73p495mqJFDvI/a93WziVW6IIK41SNIi yODQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=DVZdqXVw9e3GCqbVnJd2QF9+wTrHny9PQz9X14vDgeI=; b=pVisHcUR1xJEmWkyRABmrDyBvK1/Yv30MDOUzypwfSjXgcmkJQ41D7shvOrB+HJ5HU h8C0mrsbDn56Q2b8nf7W7xYoiaKSRND38GWCXoRDk3qheXkjqfAtz7yuKfUY483OhI1b xAZ5zXFGe+CZDuSwyIaZLEk+ym17drt/7Gv8E8iHdIJeREB2f3jNAjW5o55UVR8fAJMw XhvROKupB6qj/q1BD4mOCdNr4fUYoOEteyUIVUEh11ZFiL/R2eTPXHnbqlFrXWgH/oni kd/dsCiVkltPQhXHitkTyqaYnQncNkXlUbqUzbylzDTGCCIPR5rxyGmd0SbhoqKA5SX3 BvdA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u23si1011414edq.185.2020.09.28.10.14.29; Mon, 28 Sep 2020 10:14:52 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726645AbgI1RMp (ORCPT + 99 others); Mon, 28 Sep 2020 13:12:45 -0400 Received: from mga12.intel.com ([192.55.52.136]:55534 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726348AbgI1RMo (ORCPT ); Mon, 28 Sep 2020 13:12:44 -0400 IronPort-SDR: JUnFEodwvNCy7ZFra21yOVKRiitIY4P1oQTinpPOtM2Nhad+V7N6noysL79bBs4Ub5SU2avYGt /u5/HJLdt5fA== X-IronPort-AV: E=McAfee;i="6000,8403,9758"; a="141437254" X-IronPort-AV: E=Sophos;i="5.77,313,1596524400"; d="scan'208";a="141437254" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2020 10:12:43 -0700 IronPort-SDR: Uv+n6jt9GG5EmsFF1YJGbGEn9CtZ6b4LPpBZJTgN2GGWI16laY2+QfTpfxZXK4hQjjhYOyL1m1 sAG+uge1/LJw== X-IronPort-AV: E=Sophos;i="5.77,313,1596524400"; d="scan'208";a="488667581" Received: from evinhugx-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.44.118]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2020 10:12:40 -0700 Date: Mon, 28 Sep 2020 20:12:39 +0300 From: Jarkko Sakkinen To: Ard Biesheuvel Cc: Kai-Heng Feng , "Kenneth R. Crudup" , Tyler Hicks , linux-integrity , open list , Matthew Garrett , tweek@google.com Subject: Re: [Regression] "tpm: Require that all digests are present in TCG_PCR_EVENT2 structures" causes null pointer dereference Message-ID: <20200928171238.GB119268@linux.intel.com> References: <20200928140623.GA69515@linux.intel.com> <20200928155215.GA92669@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 28, 2020 at 06:15:00PM +0200, Ard Biesheuvel wrote: > > > > It is possible but initially feels a bit weird: > > > > > > > > - sizeof(TCG_SPECID_SIG)) || count > efispecid->num_algs) { > > > > + sizeof(TCG_SPECID_SIG)) || > > > > + !efispecid->num_algs || count != efispecid->num_algs) { ^^^ > In tpm2_bios_measurements_start(), we dereference tpm_bios_log to > access bios_event_log and bios_event_log_end without checking tpm_bios > for NULL. This is where the crash seems to occur. That's a good guess. Just a bit confused how that particular patch can have the effect: it has two deferences to efispecid instead of one in the same statement. Would be interesting to hear if the bug is triggered in Kenneth's environment by the exact same commit. /Jarkko