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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,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 47E1BC07E95 for ; Sun, 4 Jul 2021 06:30:48 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BDFC8613B7 for ; Sun, 4 Jul 2021 06:30:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BDFC8613B7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:57870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lzveQ-0004V4-MS for qemu-devel@archiver.kernel.org; Sun, 04 Jul 2021 02:30:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47942) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lzvdH-0003be-UB for qemu-devel@nongnu.org; Sun, 04 Jul 2021 02:29:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:33786) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lzvdE-0000Mt-5F for qemu-devel@nongnu.org; Sun, 04 Jul 2021 02:29:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625380170; 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: in-reply-to:in-reply-to:references:references; bh=7oCcjemD2Y1q41LsNnHS9lSWDim7ojG5makW3W+u+Dg=; b=M0sNzpiXfLHbm15nJImin1qlRx7ehBbj21IZfkiGIQCuSF8UR2khithTOAScFKQ/h1GnE7 1Y2nhR2Z8+hbYsiSGtXnpybSWQb6axm98P8zTTihVn1K5jYPgVMSBalresay99fgcy2QzW HD+x0deXFFPhApcFq/NG90da3lLuINQ= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-70-23H_we75O-KCHT9bDHonoQ-1; Sun, 04 Jul 2021 02:29:28 -0400 X-MC-Unique: 23H_we75O-KCHT9bDHonoQ-1 Received: by mail-wm1-f71.google.com with SMTP id t82-20020a1cc3550000b02901ee1ed24f94so8095819wmf.9 for ; Sat, 03 Jul 2021 23:29:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=7oCcjemD2Y1q41LsNnHS9lSWDim7ojG5makW3W+u+Dg=; b=k7XzjUhHknWzOHnqMmx+ArdDm1UgOzNiEoeQhbHDbt/nbYycQ/3D2YBtCw2r3cfn+r OEATY56WPBF1d9uiddY75ZrH67eRZ2fWG5crO1WXzsUDaSvb/VpbxFUJ+MoA8j6jlQtN jlGJRvImyRzNMQUhC9EXzqsa49GFqlY1FybLAz5MFLFMhorROHkCd/+G/5kjZItkVIfU mFRs/F6Cned9z4McrE+ySmC1h66KYgJPiv0bcTG91PSYc72sgTu+OTx7bd6qes6/GflZ JWx5hVBSH7mS6DNYlwEuoELeR63LH9ZmvwnlkvT8WLfsAn3WLgQbRvevoT3Vc0HD7+x0 4jmg== X-Gm-Message-State: AOAM530lOcn4oVjN91wI4KbaUOGptNu/LxYC4YRqZ+JhZMLp9Gf/02Yn fb+edcGoKutAuWuIhUVU67pv8nJ9p3hjzND3JzISpme6ANbKmBhVC2i/GCyj0OGzZq0k351objp 9wWoTVVYzqhkpXEs= X-Received: by 2002:a05:6000:1a87:: with SMTP id f7mr8527004wry.172.1625380167144; Sat, 03 Jul 2021 23:29:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxa/2cfUd+6w3N1JRPhoqNNRHfPli4BpuBQO2e3fHZ8uPJ2Jwus9qEH7vCAPjCbvm5rbcUXeA== X-Received: by 2002:a05:6000:1a87:: with SMTP id f7mr8526975wry.172.1625380166955; Sat, 03 Jul 2021 23:29:26 -0700 (PDT) Received: from redhat.com ([2.55.4.39]) by smtp.gmail.com with ESMTPSA id x17sm10723829wrn.62.2021.07.03.23.29.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Jul 2021 23:29:26 -0700 (PDT) Date: Sun, 4 Jul 2021 02:29:22 -0400 From: "Michael S. Tsirkin" To: Dov Murik Subject: Re: [PATCH] x86: add SEV hashing to fw_cfg for kernel/initrd/cmdline Message-ID: <20210704022842-mutt-send-email-mst@kernel.org> References: <20210525065931.1628554-1-dovmurik@linux.ibm.com> <20210703123406-mutt-send-email-mst@kernel.org> <0f36d5a0-c063-4ba7-ceca-f09d8f37fb3e@linux.ibm.com> MIME-Version: 1.0 In-Reply-To: <0f36d5a0-c063-4ba7-ceca-f09d8f37fb3e@linux.ibm.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.377, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tom Lendacky , Ashish Kalra , Brijesh Singh , Eduardo Habkost , Connor Kuehl , Tobin Feldman-Fitzthum , James Bottomley , Richard Henderson , qemu-devel@nongnu.org, "Dr. David Alan Gilbert" , Hubertus Franke , Tobin Feldman-Fitzthum , Jim Cadden , Paolo Bonzini , Laszlo Ersek Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Sun, Jul 04, 2021 at 09:16:59AM +0300, Dov Murik wrote: > Hi Michael, > > [+cc Connor, Dave] > > On 03/07/2021 19:42, Michael S. Tsirkin wrote: > > On Tue, May 25, 2021 at 06:59:31AM +0000, Dov Murik wrote: > >> From: James Bottomley > >> > >> If the VM is using memory encryption and also specifies a kernel/initrd > >> or appended command line, calculate the hashes and add them to the > >> encrypted data. For this to work, OVMF must support an encrypted area > >> to place the data which is advertised via a special GUID in the OVMF > >> reset table (if the GUID doesn't exist, the user isn't allowed to pass > >> in the kernel/initrd/cmdline via the fw_cfg interface). > > > > Sorry about asking basic questions so late in the game. > > No worries. Please noice there's a newer version: > > https://lore.kernel.org/qemu-devel/20210624102040.2015280-1-dovmurik@linux.ibm.com/ > > > > I'm a bit curious why this feature makes sense. If someone can play > > with a Linux kernel command line isn't it pretty much game over security > > wise? What protections does Linux have against malicious actors > > manipulating the command line? > > > > You're right -- if the host can modify the kernel command-line it's a game over. > > This is why this patch (together with the corresponding OVMF patches; still > under review) measures and verifies the content of the kernel blob and > the initrd blob *and* the command-line blob. > > Any modification/omission of any of them by the host will make the expected > SEV PSP measurement invalid, which should then indicate to the Guest Owner that > something is wrong with this guest. At that point the Guest Owner should > refuse to inject secrets into the guest (and also complain to the Cloud > Service Provider). > > -Dov Got it, thanks! -- MST