From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23857C433ED for ; Thu, 8 Apr 2021 16:05:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F1C4460FF1 for ; Thu, 8 Apr 2021 16:05:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232117AbhDHQF4 (ORCPT ); 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-Google-Smtp-Source: ABdhPJzEV++CuhlA2YB8TcryrXXxfR5W+L9v5/DP3P/8iIkl8mXys5IFjX8yHkHEpgm9HpOWMh5BKf7s03p90uLLd18= 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.