Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp581055pxf; Thu, 8 Apr 2021 08:54:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBsSj5Cpnnza/5KsRn6Fq7KwRrXZ/5qeYrcDHxs4chymi+p7yZIV9xGeojVTl2lD5Bj2Sh X-Received: by 2002:a05:6a00:248c:b029:23e:f672:e40b with SMTP id c12-20020a056a00248cb029023ef672e40bmr8029214pfv.0.1617897270399; Thu, 08 Apr 2021 08:54:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617897270; cv=none; d=google.com; s=arc-20160816; b=QBMw1AA66kBVlkZKU3k1ttxbnXPc3gS3E7DDXspVE/BGo+FOejkMdQcR0s1HDGCQEh vmRWYmczUl25C5Ce6NFMnsnZr3lQPQevbKAgE4jlCLyWHO5/HuCeT/UxBKyILnrKwMqB XrbTyaBY/Dbh/9Ae4rDjGDuUPBQL3uvB2jGlqk5A8wUqj3IFRkKFDF03nrrFbZKFIFvR YoxXxlsqCy5Nz4ueSoPH2LmmEa3stw1XOE2UMsnPWFBzKpHPVyrq1wo7VI0NqoWYtMP1 YjHZV2Q88Mlexbhz//SIGsWc9pCvDbSoTiDAl4meLjun3deWcCbYqcOv5bawR39ifzUl Kovg== 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 :organization:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=9B/sUEO2VShQhd7eWwiUIrKIfr8RV9G7LyCRIKLZBbE=; b=NBhS/Nk3Em8IimYlWpda/+3XO7mgOX0BbMkgOT2dh6FC4LcL+tHjQqSANqKNABy8eC 7fwh4VanHbUEWugqSCtYCsNrSkLRw7sLFG+Aub3UofpvTo5h2TBdE/7E2b0eCU1b7syh DuBfb2zeMn25THdGeEuLlnqQrATYxlH7JO8ENsdBEv7MCb6ZCaWDDnseVgB9ad1y/xTD 3huXqDCKjUB6JulQUWKrMXPZxpk2dZdpiB6S2kHTxfXT3U+ESyHpGiW2aT1D34PyfuUR m9RXaUkqb7XyshHWLwP+m9/F9hOgmU+ueIazB3I9V0eKgKLyMG1co7De7ulIEjZXOrmO LZjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NjagCKKS; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 90si27484893plc.183.2021.04.08.08.54.10; Thu, 08 Apr 2021 08:54:30 -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=@redhat.com header.s=mimecast20190719 header.b=NjagCKKS; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232078AbhDHPwv (ORCPT + 99 others); Thu, 8 Apr 2021 11:52:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:45437 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232080AbhDHPwu (ORCPT ); Thu, 8 Apr 2021 11:52:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617897158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9B/sUEO2VShQhd7eWwiUIrKIfr8RV9G7LyCRIKLZBbE=; b=NjagCKKS61xqHRHkxYUx1SjD5yX3s9wbujoZFCN8m34GH9NRstPLAkS7mcsmRBbWsEL0Yp 4uoverPawKybF/FFd2WJIP0HqiuBz3Ja0rIlswYOl3Zbo5rUXr7KeJoG4nGICN96SgU+iD D/2nyTsjWC/3Cv86GthZlfCyas+SJSQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-33-X4izMfM0PQeWXMyFdM51gw-1; Thu, 08 Apr 2021 11:52:35 -0400 X-MC-Unique: X4izMfM0PQeWXMyFdM51gw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 34065189C440; Thu, 8 Apr 2021 15:52:33 +0000 (UTC) Received: from ovpn-113-96.phx2.redhat.com (ovpn-113-96.phx2.redhat.com [10.3.113.96]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6748C60864; Thu, 8 Apr 2021 15:52:32 +0000 (UTC) Message-ID: <2a4303680e20e8eac115880c1ac86f39076f0fd7.camel@redhat.com> Subject: Re: [PATCH v5 1/1] use crc32 instead of md5 for hibernation e820 integrity check From: Simo Sorce To: Eric Biggers , "Rafael J. Wysocki" Cc: Chris von Recklinghausen , Ard Biesheuvel , Dexuan Cui , Linux PM , Linux Crypto Mailing List , Linux Kernel Mailing List Date: Thu, 08 Apr 2021 11:52:31 -0400 In-Reply-To: References: <20210408131506.17941-1-crecklin@redhat.com> Organization: Red Hat, Inc. Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, 2021-04-08 at 08:26 -0700, Eric Biggers wrote: > 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. Wouldn't you also need a signature with a TPM key in that case? An attacker that can change memory maps can also change the hash on disk ? Unless the hash is in an encrypted partition I guess... Simo. -- Simo Sorce RHEL Crypto Team Red Hat, Inc