Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp593906pxf; Thu, 8 Apr 2021 09:07:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxootQlQlbpJ+z27/POhnMOzGUz3//bZ8SSEdFx47KqB3E0OLMN9kCYYsKPKJbZHYadEB8L X-Received: by 2002:a2e:5049:: with SMTP id v9mr668781ljd.259.1617898029568; Thu, 08 Apr 2021 09:07:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617898029; cv=none; d=google.com; s=arc-20160816; b=MMCBLOOdAYVU9dmYNTN1b5zp8Nge9P6p1ibTzFjNkuThSBSS/YmlYcbtqr7nD5eRgW LRESxxqqwTcvnREiF2IhgULtInc0rSbr21FM3fhTLNR/xcQgAvVxBcguk07GLqdgE+E+ auFN9yi9Gk0RwTGDPDFVQbj1/ERQ/1QvPqwLwVkeCacVCDN/HH9PFrzcA5OyM3IpuVI9 3PaFW+4VxnH7XjKhV+6nkxPiQDfJ3yJHirbu9DyxymO8xIcgjKCfknpzJuEfBheKShsw KHEbedb+/SfKXJMP3Gy1eVKI8VWNVQtf7GfezguJ+UAE4GpdhmsVhTMJLkG1Q8rVmw+k 128A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=89GBzc2bbepFcIw25Q1AatCj5mIj6s7KJYpVy/c3qPA=; b=oVRIyjnWxow9MfCMKOFz7sHl+Ln2qcZqb5olxvOzcF8xZCbYS9ewlCOtAJmBPe7wX2 Obe3VfguP7XgFItFYzBp/+87Op8GSz9vu8coU31BQVP4TJzounPc1FIabyqx/2cg5V6o Mdb+W1HKf1NmB8BC2xYLlRcWrznBPFz9PZxOgbtUWlARe30Nv/2hGtaPHRT/hO0fGEs7 Qgb9dQw1A14sp0YihEg1Ogky2vbMWqupwJmpsmTd6PsseKbI+rEJXsn7OYL6m5172cry A62YUfVyYwAGbZ2kkA6A0UE4OG1Gq+DHygS1nEYvHVU3AYD24unYsvzt0Lt936j61cuC TybA== ARC-Authentication-Results: i=1; mx.google.com; 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 v5si22604265edc.166.2021.04.08.09.06.39; Thu, 08 Apr 2021 09:07:09 -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; 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 S232117AbhDHQF4 (ORCPT + 99 others); Thu, 8 Apr 2021 12:05:56 -0400 Received: from mail-oo1-f53.google.com ([209.85.161.53]:44000 "EHLO mail-oo1-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232053AbhDHQFz (ORCPT ); Thu, 8 Apr 2021 12:05:55 -0400 Received: by mail-oo1-f53.google.com with SMTP id x187-20020a4a41c40000b02901b664cf3220so621861ooa.10; Thu, 08 Apr 2021 09:05:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=89GBzc2bbepFcIw25Q1AatCj5mIj6s7KJYpVy/c3qPA=; b=P0t8He/1VAEjZ7GKaTsvjk/ibBrjeSyB1+JRlXczLxC3pLPfeSdH90fsqsugwyFk09 lKr2Dj6WyOim0F7CVlSLfraAwKjUi9+u6+RAu+7TTBA0NGAOU0B4Nk8WjwKoNyYbA4+M 1nm44J6lSFfkYILeSKdUK5YM+wGPmfFA04/76QBY8MQZaY9DnlsagVKxJxlzlOYut0o1 d4fKjHqRrdFh44zQiR8iMjiIEVf87ExPcllkqm5qd8xFMHbXU+VmVcMCZik+SifkDLMi q0njsoEc2j1Tb79nW0UQlmqbk/bBq/W3M4NEeSRi3lQuK6xg2KPieIZJ6IXihy5rMF55 9YeA== X-Gm-Message-State: AOAM531I8Zqa8n8k3dLoVW/klZv6g72QU36fxwrTkT0HY4glPrxaSxaQ /XDC/0xMwJGVjy1Z7on4cxLbychzpO46HnqpDzY= X-Received: by 2002:a4a:d781:: with SMTP id c1mr8131686oou.44.1617897944147; Thu, 08 Apr 2021 09:05:44 -0700 (PDT) MIME-Version: 1.0 References: <20210408131506.17941-1-crecklin@redhat.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Thu, 8 Apr 2021 18:05:33 +0200 Message-ID: Subject: Re: [PATCH v5 1/1] use crc32 instead of md5 for hibernation e820 integrity check To: Eric Biggers Cc: "Rafael J. Wysocki" , Chris von Recklinghausen , Ard Biesheuvel , Simo Sorce , Dexuan Cui , Linux PM , Linux Crypto Mailing List , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, Apr 8, 2021 at 5:26 PM 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...) That's the case here. > then a non-cryptographic checksum would be sufficient.