Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp556536pxf; Thu, 8 Apr 2021 08:27:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKmS6YKcOONrQiIwBjZVj2xbG2bITmeVCxW6IRp7UoF24gSFlQbIl2wwijC6LlM1TtWMs3 X-Received: by 2002:a17:90a:5d93:: with SMTP id t19mr9043729pji.211.1617895636347; Thu, 08 Apr 2021 08:27:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617895636; cv=none; d=google.com; s=arc-20160816; b=QXPPZ41PyPD/uquAisrX/PhlhC1UBn6hAuzjmNV8joeHiXkN+pG1HrGi7SE5IMMWdT TTg7YqKMEi3IpodAjc9kZsjYbQCohEuNwVu/nm1bCRLRUukzt3FLH+FTW18mxi0D4161 AGQvqx9rp+vE+JTFqgOhwGSQPUlf2HXjKIrHPm5TDIqyHVMGuiiVuldc6d2PA0yUk7Yi CEdTuZs+bZRO3Gve3MSw2BpNucSg0dhI5KustcDc2/sXFtQGxx7hXzHhcLY3ZJR/nc4n K03lo46qOsRS2DuyqZH9NumUxdnSCIMygb+teeH9zT9+hwvSAvC7KhQg3DDMGnfKk2va cglw== 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=ROXJcZzMQnMo95voCwY9mA7eVDYr3dP9KftEJvdzPgk=; b=zJNOd8vw+9/+ZYdUOtsMRQ7wy0EG0ebbJd7gGXIjdRMUAJCRzKmWxl7KSCzGpISyS/ pqopXHJgMOKhaXxXDqwunkr80k6aXA0zgV6m16GaA5ozkz3N/TgzFFTp7sa/SEW7YpUB rOkrFW5VB0kLm7fvcbWkcx/tpIJ1JJg8P5uOb+uEoa7hmn34JkIkhd00fnrTdzVE3uDx HOd/l+ADcgQ3CDxAPwpFuL349WNuodF4CbEXnk1RLEhNwLSsF+r1HCrAVqa9tOtxGCyS YlqHyfEV00+V5rlBO0arylkzxue8Jgvk8Uf84TNerM+eOQzR3iCTbk/jdQE3ucFfUMgk V71A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Knd2XdQI; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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 bd8si29586519plb.157.2021.04.08.08.27.00; Thu, 08 Apr 2021 08:27:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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=Knd2XdQI; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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 S231987AbhDHP0q (ORCPT + 99 others); Thu, 8 Apr 2021 11:26:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:47292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231791AbhDHP0q (ORCPT ); Thu, 8 Apr 2021 11:26:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BB23D61103; Thu, 8 Apr 2021 15:26:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617895594; bh=RI1xiofESuBoPYR+YavH1V/ABEGPCfLun0uC+7Y/teY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Knd2XdQIwF8kiwz56AKLmRPFQQfmE9dRyVJC4JRFu2DwXaQ0nSF4OWH+Wk401QJUY iIRF4/zDHxqyGviyzH+mMvNGhjHfmMgXfunU44BYhauKeH6qh+u09K0/81+gV8GtJk QS3rhUMaVi0CP/DxEXe1M+MutzTX+FbmnXzTfkr1RMengMMMDNPv+aDIn63I8V6TLG juvfQ7KDxHeNKcZbwkYJiqbr3glqLlWSJHLqceQCRs2tVKqeeh2bEX/twxA+JdoXJo h2tNZ8XNIJnnn5m4sfMDnKYDbk9M/oiw79xny77dm2GuG+DsdJKHAb2IB3WpYwMNfk HQctSdPRnjTuA== Date: Thu, 8 Apr 2021 08:26:33 -0700 From: Eric Biggers To: "Rafael J. Wysocki" Cc: Chris von Recklinghausen , Ard Biesheuvel , Simo Sorce , Dexuan Cui , Linux PM , Linux Crypto Mailing List , Linux Kernel Mailing List Subject: Re: [PATCH v5 1/1] use crc32 instead of md5 for hibernation e820 integrity check Message-ID: References: <20210408131506.17941-1-crecklin@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, Apr 08, 2021 at 03:32:38PM +0200, Rafael J. Wysocki wrote: > On Thu, Apr 8, 2021 at 3:15 PM Chris von Recklinghausen > wrote: > > > > Suspend fails on a system in fips mode because md5 is used for the e820 > > integrity check and is not available. Use crc32 instead. > > > > This patch changes the integrity check algorithm from md5 to > > crc32. This integrity check is used only to verify accidental > > corruption of the hybernation data > > It isn't used for that. > > In fact, it is used to detect differences between the memory map used > before hibernation and the one made available by the BIOS during the > subsequent resume. And the check is there, because it is generally > unsafe to load the hibernation image into memory if the current memory > map doesn't match the one used when the image was created. So what types of "differences" are you trying to detect? If you need to detect differences caused by someone who maliciously made changes ("malicious" implies they may try to avoid detection), then you need to use a cryptographic hash function (or a cryptographic MAC if the hash value isn't stored separately). If you only need to detect non-malicious changes (normally these would be called "accidental" changes, but sure, it could be changes that are "intentionally" made provided that the other side can be trusted to not try to avoid detection...), then a non-cryptographic checksum would be sufficient. - Eric