Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp7453imn; Tue, 2 Aug 2022 16:07:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vfnlb8J5Xbu1T09pMZ/VuFMQPiE3iColCdf3/CeoZumeNi9NKcYw139FY/mkRQ3jjDUKNZ X-Received: by 2002:a17:907:2cc8:b0:72b:7c72:e6a4 with SMTP id hg8-20020a1709072cc800b0072b7c72e6a4mr18134198ejc.160.1659481676290; Tue, 02 Aug 2022 16:07:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659481676; cv=none; d=google.com; s=arc-20160816; b=RXWUWeLhTf4AL0msdktOXpPbAsacpGgqVZJ4C8NhWLq7fdJPE8F/P/9CbCXDkBiT3J EmOE3CM/AUar5PP3N6SQ+pW3Qwxv0TtSSPfcZ99NDrHlH+CiH3RukMfXxGpy2g4ui+QL /TrLNIY3wCY1+/OBy53jfiB8fKlHgLgFSaJZAxp8Z3Kts1YISDZ+NPT0Umu5BYAAOoIb TrHJJwUb7UH7wnEmbCVbHVBWODBOoXQM8guN/D9JqPaIjzDTQZUR18bkUPJ+JUKdUBug docRJXvnlevGq2Pa2bX0ljgqarwN8RHz2LHAOECqZPlYS2dApRNRlbxeTLXvNoJCDdQ2 lvzQ== 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=fQ/KM57GehhDrbZBfGgtNcVv0Q0RoWyLv0NGSXmUQYA=; b=UUUiOaWyOaBdekol8LqeKr33U61xj/Z1te8tDyLqzLOJq8VzYPbn3wCG07kCXwTf4j ZcyNllD3olY/ipP2RrDcEGx4ET1R5eB8tQL/sNC9SvDSfJEXgJxDmyOWeE1KUF9owq09 9tn1e/0bdFNAmgbpDA/uQjKhswD7+jK8kMAaBho2PpBfWYIqnp26MQNbCZdoeck9hAmT FKptaf098qgxkBJ1JdjW7TDfkBvTQTUtJLIihKhU1RmclyCeCtu6TxQpRcNXpeYkCoBP 0GjlW4Jghaa2xULBYXr1Gsas7uHQJL3gIqtd+Lds8jJDx/VhWfZCd7c+40srZemiQw3+ tCDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uDRV1sfN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t25-20020a50d719000000b0043beaa7f1b3si14593900edi.247.2022.08.02.16.07.29; Tue, 02 Aug 2022 16:07:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uDRV1sfN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230126AbiHBWvK (ORCPT + 99 others); Tue, 2 Aug 2022 18:51:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229637AbiHBWvH (ORCPT ); Tue, 2 Aug 2022 18:51:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3E55175A8; Tue, 2 Aug 2022 15:51:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9D360B8213D; Tue, 2 Aug 2022 22:51:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4866C433C1; Tue, 2 Aug 2022 22:51:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659480663; bh=EVHKFXDWJx2v89uX2HtMGYWfOO5yohu71hamhjaXdWs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uDRV1sfNn0/OSf9pd0RZlPlAJjgOj7N7MywwlgUMqTf8eni6vTtrYoqpZrEYfYhBA aOtQFFWdGU95r35vAdvxcU5xc0+fa6dTZYpAMBECcGhtQ5t9i9e6sCU3WRJVORb95c JVKauXIA0SGkvcnen2WkJk79P5g0U/vtqpfsLWAp4h4zrr/ydUkEi7E61xWPa1fjjG bmJqKUpQor5sq5bVdvrdwpg0t16WbAxnD2bMVgCCW8VGubE/++I+uXrtW3pTrB/JU8 KtW4CEwHKcq8QHVstls+uWAA8TqrLY8RrET/SjAiFJjYE8GYI488m/0tKwQXYzxaDm SbolsWHq+t8rQ== Date: Tue, 2 Aug 2022 15:51:01 -0700 From: Eric Biggers To: Evan Green Cc: linux-kernel@vger.kernel.org, Matthew Garrett , dlunev@google.com, zohar@linux.ibm.com, jejb@linux.ibm.com, linux-integrity@vger.kernel.org, corbet@lwn.net, rjw@rjwysocki.net, gwendal@chromium.org, jarkko@kernel.org, linux-pm@vger.kernel.org, Len Brown , Pavel Machek , "Rafael J. Wysocki" Subject: Re: [PATCH 09/10] PM: hibernate: Verify the digest encryption key Message-ID: References: <20220504232102.469959-1-evgreen@chromium.org> <20220504161439.9.I504d456c7a94ef1aaa7a2c63775ce9690c3ad7ab@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220504161439.9.I504d456c7a94ef1aaa7a2c63775ce9690c3ad7ab@changeid> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 04, 2022 at 04:21:01PM -0700, Evan Green wrote: > + /* TPML_PCR_SELECTION.count */ > + if (be32_to_cpu(*(int *)payload->creation) != 1) { > + ret = -EINVAL; > + goto out; > + } Make sure to run sparse by passing C=1 to make. It will find bugs like this where the wrong type is being used (int instead of __be32 here). - Eric