Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1724754pxy; Thu, 29 Apr 2021 13:06:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkqFsxw0UfP9z/hVVnT94Dt7ZDNPt7oxTVgR8yJzPW6BpfrDcYyFUJQnLNa5QgQKjm9r0H X-Received: by 2002:a65:6a50:: with SMTP id o16mr1413881pgu.6.1619726792014; Thu, 29 Apr 2021 13:06:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619726792; cv=none; d=google.com; s=arc-20160816; b=B/Tn+DuAGVt9p2EqkJNIeOx8xqLYQcnKXi7ItH/NIssT5UUiPoVxtGsGrWt6xuYuc1 wlhFT4f1aOJkg68Fccp/xV75pmU4Ne5PGwrO9bTm0UiBm4yo6/P+5CaEsCqzCPFUCIuB MFqw6IiRv41BwsYQp5TA5a3ACrPmZAuwzVqOeWxiBiXKkKOdl6fHh2JTWAeMMCfeVu0i oy6QhVxAmHCZ5ql1kwjUJe/LyhbDLMCkl9eISHgwMTxBbuPJGe4ArtMaBlah+rp3hUE6 R/PGJLAjpda6miV3lNzV/Pk8pvgTCQ9EZVEC1Df/HV+bFdjjkdX33+B1RsvOUUcHn6xG Jn0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=lo0CealpsAMkHdhQSaVoKlG2hVVQMHH36HTa4+GXyq8=; b=lirvY+wYS13o0BKePwWSsZaTBeuwDcNPcnpUEG3BQWoBJkGeOy0Dq6baAk+6Ud9O8m 2fWo3sEuP4MOxjCMKzeeTUvbTq2ZXdJwv390+BSKpqGDp7y5Hnn3z8FOdP3oesBHTp8M x7V/DRdXOYSjVbM7Qsa1rfxu20WYxqSqP5gHDxNWvI+kMoij1vFlcZzzuLTxSyZ+gMfW KyV1q0vIavNqZh5iSMduMxTNTqUs7OdKafmuyxA/pOoa1nlNRJrP8kbyqvR4MFUAkpLn QmWcy1p1DG5tp2XvBAZwwe46v28O5/JsBva+UhigZjGupXnhJHxFy0mmj/ZKSssai+u4 8mmg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v7si804774plg.52.2021.04.29.13.05.56; Thu, 29 Apr 2021 13:06:31 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236979AbhD2UB4 convert rfc822-to-8bit (ORCPT + 99 others); Thu, 29 Apr 2021 16:01:56 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:51808 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237580AbhD2UAd (ORCPT ); Thu, 29 Apr 2021 16:00:33 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 339D01C0BA4; Thu, 29 Apr 2021 21:59:45 +0200 (CEST) Date: Thu, 29 Apr 2021 21:59:44 +0200 From: Pavel Machek To: "Rafael J. Wysocki" Cc: Eric Biggers , 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: <20210429195944.GB1067@bug> References: <20210408131506.17941-1-crecklin@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Hi! > > > > 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. md5 is fine for this purpose. crc32 may be too weak. I don't see why this needs changing. Maybe fips should understand that md5 has other uses than crypto? Best regards, Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html