From nobody Sat May 4 04:53:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1603210955; cv=none; d=zohomail.com; s=zohoarc; b=SCjoIw+doIanPvVi1pphkQUCDtPzXnGnUa4V7h/76KsubPsDClJsdYtxpUixNkoB1P2ZPrvrePRnAqCHgAKTfMDghDkKquJVHPMmLsYAMuaKOcCvRqe8YKXWWxdAjA1bPvXrtCoU7d+u5xreI0w6wu2t8AvOqpKdnM0BEH1BMQQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603210955; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=JcM4j/FPegasVk/W/u7CO0eXiTsAR3utx4rXmn1cH1Q=; b=OiTFUUEm47TPyGefDM37SLtb0m29+cFF2Ihae1Iyh4H6C8TyQnVVT0bfRXybsjJUDs5Nauy85Itz4C1Pncgwag5FDYJ+FkpVlut+SZrUgjeHGtapRP3YCw0MYzjPDObwIu0x1yA0AX4HPrOnTEo/dL2b3f/sw9xiEvg3M818hf8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 160321095560795.02764360510548; Tue, 20 Oct 2020 09:22:35 -0700 (PDT) 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-414-tgu4wkx0OA-TSwfvMcbwxA-1; Tue, 20 Oct 2020 12:22:32 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B984A802B75; Tue, 20 Oct 2020 16:22:26 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 90E6355771; Tue, 20 Oct 2020 16:22:26 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 477418C7C3; Tue, 20 Oct 2020 16:22:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 09KGMHu5005477 for ; Tue, 20 Oct 2020 12:22:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id B6CC36EF57; Tue, 20 Oct 2020 16:22:17 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-114-206.ams2.redhat.com [10.36.114.206]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B2D96EF59; Tue, 20 Oct 2020 16:22:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603210954; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=JcM4j/FPegasVk/W/u7CO0eXiTsAR3utx4rXmn1cH1Q=; b=bx4FqwQMWwyv4urGpdtkdQKXdsvnn/emzCu7jSpHrFx20dAgm4m/vDQIrZhkAWhLM4g63h 2ZhQx1iyZfUCCFtk3B/9ScDAu5drK5u7doTLeN4rGF3zo6DLK1msoF2iHGK7Br5uHunBxa 13W4MDMVOPVAXjJwegbF+3WbpCI3usI= X-MC-Unique: tgu4wkx0OA-TSwfvMcbwxA-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH] os: deprecate the -enable-fips option and QEMU's FIPS enforcement Date: Tue, 20 Oct 2020 17:22:11 +0100 Message-Id: <20201020162211.401204-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, Paolo Bonzini , John Snow X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) The -enable-fips option was added a long time ago to prevent the use of single DES when VNC when FIPS mode is enabled. It should never have been added, because apps are supposed to unconditionally honour FIPS mode based on the '/proc/sys/crypto/fips_enabled' file contents. In addition there is more to achieving FIPS compliance than merely blocking use of certain algorithms. Those algorithms which are used need to perform self-tests at runtime. QEMU's built-in cryptography provider has no support for self-tests, and neither does the nettle library. If QEMU is required to be used in a FIPS enabled host, then it must be built with the libgcrypt library enabled, which will unconditionally enforce FIPS compliance in any algorithm usage. Thus there is no need to keep either the -enable-fips option in QEMU, or QEMU's internal FIPS checking methods. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: John Snow Reviewed-by: Thomas Huth --- docs/system/deprecated.rst | 11 +++++++++++ os-posix.c | 3 +++ 2 files changed, 14 insertions(+) diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst index 905628f3a0..faa2bc49b1 100644 --- a/docs/system/deprecated.rst +++ b/docs/system/deprecated.rst @@ -158,6 +158,17 @@ devices. It is possible to use drives the board doesn= 't pick up with -device. This usage is now deprecated. Use ``if=3Dnone`` instead. =20 =20 +``--enable-fips`` (since 5.2) + +This option restricts usage of certain cryptographic algorithms when +the host is operating in FIPS mode. + +If FIPS compliance is required, QEMU should be built with the ``libgcrypt`` +library enabled as a cryptography provider. + +Neither the ``nettle`` library, or the built-in cryptography provider are +supported on FIPS enabled hosts. + QEMU Machine Protocol (QMP) commands ------------------------------------ =20 diff --git a/os-posix.c b/os-posix.c index 1de2839554..a6846f51c1 100644 --- a/os-posix.c +++ b/os-posix.c @@ -153,6 +153,9 @@ int os_parse_cmd_args(int index, const char *optarg) break; #if defined(CONFIG_LINUX) case QEMU_OPTION_enablefips: + warn_report("-enable-fips is deprecated, please build QEMU with " + "the `libgcrypt` library as the cryptography provider " + "to enable FIPS compliance"); fips_set_state(true); break; #endif --=20 2.26.2