Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1637585lqm; Fri, 3 May 2024 01:32:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW0OiDDTF9t2jBIJGOEgHdRNXURFSIhEnIJyFk36QeL/DiZudHQxmlXRkV3/bw88EFVxSpOok/h4pOiEBjuzH70nNLkcxoGzDmazpGExg== X-Google-Smtp-Source: AGHT+IFjs15o9LM4SjPvYZ6wONIMOeuRiKBe+kNQJygU8V2yh/QM35oGf0Ag91PiUfVd+iDRCFlI X-Received: by 2002:a05:620a:8007:b0:790:99d8:e6a with SMTP id ee7-20020a05620a800700b0079099d80e6amr2301148qkb.58.1714725151760; Fri, 03 May 2024 01:32:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714725151; cv=pass; d=google.com; s=arc-20160816; b=Z8JVIsJwz7+SgyRbJUUTnStJqoZh3nCXDp4TeEEfQYBGRc0GhFHGt4+Wo3BRjKyxVv M2LaPNUZ7xua3X287lda3J4AOkizx+Ch0oOr+oiFwf1+NuskHjDZRBneLNRh+YAPTyGC VyN3xjtOnhQYM1+nKhYMH5Mi0ApFlShzSisAul6EuTpfzpyE20JbucBDbE1FXxez5TVY oLsrtgYUYfG4PvSDDfSBluKlUM1AgxySqgdgiFvNSvsMT+i/UtLWulXOiHruPxtc+RNb VF1glwiQM/8plTj7PmgnU3uK1mJPxQViSKZ9zOCLCHfbA6Q9Z8ZxjMOtQCR/cDykVdgk sHRQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=vgSYT6fxfReVODTChlrLY1yTZjM/kZAB6PbQPgue2kA=; fh=kQkKfIpJvAxpReO1eXOwj0do/ECMh7EU4cFZNz78MKs=; b=iUL8yQYYcHNWgNCJWXUxZJb6cwS5i59szG0jhUr4rcisbOjKI8ioZKbmsHJNvZo2tU mSUB970LTwC6LCV4Lz5VUcXG5mRxybMLsQloKvoQaQC+tLx+c/CwqsLvVQY67nHD2Rde eHq9NpEygfJt/foDdizWC88l/u267evsq9QW6jGfPCNW00N/qGUq0kbPY9Ok9+jHje9/ kLdY1dV3I/mU04w/sDxAEgAoBNfVN5ogtDQl9G3S5kTarwch7UqVwQiC6LI/ZYlkwiU7 YXOb+nQW0rjnFoUaCz1N3FbRZK2awhEEOOgwFM1ZQw+d1VJnj+xtudOrSdQAQaeDnm5z +F1w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=EZ6v2x2H; arc=pass (i=1 spf=pass spfdomain=amazon.de dkim=pass dkdomain=amazon.com dmarc=pass fromdomain=amazon.com); spf=pass (google.com: domain of linux-kernel+bounces-167388-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167388-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a22-20020a05620a02f600b0079282fe66afsi74328qko.0.2024.05.03.01.32.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 01:32:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167388-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=EZ6v2x2H; arc=pass (i=1 spf=pass spfdomain=amazon.de dkim=pass dkdomain=amazon.com dmarc=pass fromdomain=amazon.com); spf=pass (google.com: domain of linux-kernel+bounces-167388-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167388-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6DDB61C22267 for ; Fri, 3 May 2024 08:32:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6FC09149E1E; Fri, 3 May 2024 08:32:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="EZ6v2x2H" Received: from smtp-fw-2101.amazon.com (smtp-fw-2101.amazon.com [72.21.196.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0734714F62 for ; Fri, 3 May 2024 08:32:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=72.21.196.25 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714725147; cv=none; b=e1iW3tr3uCIVOxAcrN+SgA8m/VmIPv9GJipdq1bQh8YuUPDipqkfG/EuNa/6ZdyRSqan7DRqOls3RwXKUK1ZzGZol2nW/VLsKDcQNQMemERXH/PsCRsmEtNTJXOKOiJSwVul7YxW8vzszU6JvpoaN1KK+km7vhI+7cLh3TNGA2g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714725147; c=relaxed/simple; bh=oetKWZhXbUP/ZBwxmBeFuev6aODxLGweeHR7GrdJFAA=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=cwTnxE2Tol/A5O51QXSoyNmLNuepC8Ck13pS4Elxu/HrVcP7AjeHkdXl8tMsSvdHWSUpUAHj1glicTNqptss2RHQTKV5NVgMltTn+2pjKdJ0fQVjN/a61MgTbGFcqeGj0K7F5quB/mV95bEqJNHiD1CLhl8Qrbb482iswiOoiCE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.de; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b=EZ6v2x2H; arc=none smtp.client-ip=72.21.196.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1714725146; x=1746261146; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=vgSYT6fxfReVODTChlrLY1yTZjM/kZAB6PbQPgue2kA=; b=EZ6v2x2HJETu/MEzsOQY2VQ/bM6ZzYFz/i9g47i57LUNQzMWnbhC1ugP MR4y6FPv2iBa3Ra+dSKZvhOWWqWyDAaFfMfTjqI7eWjnPQjY6Ed5hvXlg 7c17/N+E1NZDjTh/ftTeEtMcqeIfYn17SRKUJadN2DvYbhv3B1Ntn+Doq g=; X-IronPort-AV: E=Sophos;i="6.07,247,1708387200"; d="scan'208";a="398851930" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO smtpout.prod.us-west-2.prod.farcaster.email.amazon.dev) ([10.43.8.6]) by smtp-border-fw-2101.iad2.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 May 2024 08:32:22 +0000 Received: from EX19MTAUWC001.ant.amazon.com [10.0.7.35:9532] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.8.38:2525] with esmtp (Farcaster) id 26a7d38d-e059-4d36-a735-3275faea70a5; Fri, 3 May 2024 08:32:21 +0000 (UTC) X-Farcaster-Flow-ID: 26a7d38d-e059-4d36-a735-3275faea70a5 Received: from EX19D020UWC004.ant.amazon.com (10.13.138.149) by EX19MTAUWC001.ant.amazon.com (10.250.64.174) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Fri, 3 May 2024 08:32:21 +0000 Received: from [0.0.0.0] (10.253.83.51) by EX19D020UWC004.ant.amazon.com (10.13.138.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Fri, 3 May 2024 08:32:15 +0000 Message-ID: Date: Fri, 3 May 2024 10:32:13 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 0/4] x86/snp: Add kexec support To: Vitaly Kuznetsov , Ashish Kalra , , , , , CC: , , , , , , , , , , , , , , , , , , , References: <20240409113010.465412-1-kirill.shutemov@linux.intel.com> <26b3b3b5-548d-4ebd-9d21-19580a41e799@amazon.com> <87msp8mmpq.fsf@redhat.com> Content-Language: en-US From: Alexander Graf In-Reply-To: <87msp8mmpq.fsf@redhat.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: EX19D036UWB002.ant.amazon.com (10.13.139.139) To EX19D020UWC004.ant.amazon.com (10.13.138.149) On 02.05.24 14:18, Vitaly Kuznetsov wrote: > Alexander Graf writes: > >> Hey Ashish, >> >> On 09.04.24 22:42, Ashish Kalra wrote: >>> From: Ashish Kalra >>> >>> The patchset adds bits and pieces to get kexec (and crashkernel) work on >>> SNP guest. >> >> With this patch set (and similar for the TDX one), you enable the >> typical kdump case, which is great! >> >> However, if a user is running with direct kernel boot - which is very >> typical in SEV-SNP setup, especially for Kata Containers and similar - >> the initial launch measurement is a natural indicator of the target >> environment. Kexec basically allows them to completely bypass that: You >> would be able to run a completely different environment than the one you >> measure through the launch digest. I'm not sure it's a good idea to even >> allow that by default in CoCo environments - at least not if the kernel >> is locked down. > Isn't it the same when we just allow loading kernel modules? I'm sure > you can also achieve a 'completely different environment' with that :-) > With SecureBoot / lockdown we normally require modules to pass signature > check, I guess we can employ the same mechanism for kexec. I.e. in > lockdown, we require signature check on the kexec-ed kernel. Also, it > may make sense to check initramfs too (with direct kernel boot it's also > part of launch measurements, right?) and there's UKI for that already). Correct. With IMA, you even do exactly that: Enforce a signature check of the next binary with kexec. The problem is that you typically want to update the system because something is broken; most likely your original environment had a security issue somewhere. From a pure SEV-SNP attestation point of view, you can not distinguish between the patched and unpatched environment: Both look the same. So while kexec isn't the problem, it's the fact that you can't tell anyone that you're now running a fixed version of the code :). > Personally, I believe that if we simply forbid kexec for CoCo in > lockdown mode, the feature will become mostly useless in 'full stack' > (which boot through firmware) production envrironments. I'm happy for CoCo to stay smoke and mirrors :). But I believe that if you want to genuinely draw a trust chain back to an AMD/Intel certificate, we need to come up with a good way of making updates work with a working trust chain so that whoever checks whether you're running sanctioned code is able to validate the claim. Alex