Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8778571rwb; Tue, 13 Dec 2022 10:16:11 -0800 (PST) X-Google-Smtp-Source: AA0mqf78FQjkglizZqtxDOIHG21rVSz82+3QwvYBBLRQrrJrpmdpQeZ8bQD182hR+P5D6D0DPDa+ X-Received: by 2002:a17:906:a115:b0:7ad:d1fb:9424 with SMTP id t21-20020a170906a11500b007add1fb9424mr18201669ejy.10.1670955370899; Tue, 13 Dec 2022 10:16:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670955370; cv=none; d=google.com; s=arc-20160816; b=NsFJxylaP3cRsdHUDisjVrvcrFPVGLYtbgfKEq/tFmvunHVOkAe7FYl6QQtE1RTsQ2 D/ZbmKCw2CfeJIrip1UG3XQhqeAyXcjuILMpxPc2sNB1qWEcNbd4jjjiHHCF6TrJpLB7 4ja7vvgipOW2NFnaCSP/HF+IwFEFPh0PIqikwT1YPYmqsX6xohZpYb/dqy1ytxDAS+P3 ywWtKyNMgNn3EBAiA5L6rk0stCNRcyyDTBKRQl5GQVn6ih4oUvLE2rt2Yu0lZNZ6arDV BSXGddizQyP5tci62RCgSngaY2Rghzi7p/A0AwqkNLmCSVvA+LWBizwkBchr65LHt8Dv RPRQ== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=GLCnXgmwF35Wm3KyYmhhuEDsp+D4TIjtVKBm7qLcnYg=; b=w4+lQJesJsNHqfvnf+VWRQbMG6ovD7sSC13YE3zgxOCE+W27iyQzfF4keFoUL+iNoT ddNQ7hvxEO8gLMjl1EZML3fBTXfO6rjH5jrpjAclSd0rbXFPrq45vECVVo6RypDcBpb2 XZ4xENY9M4KsYkkDiOK+lpOucuMTq1zGpRT4ZybVMnNEhnBZ+sD7tvEV3ace2XnArCfM KaKjFNsou9AJUqZO+9Pbfww13Py6fnCbt1RzxxyDjY1fwwNN7L1caU/wm7MhqIdZEUVR /1n+MMYL5Kpx+dhH3XDiTZWZ0oS/UyvO+upSt03QLmc8SKJCWvrqBaPfJyiuo6ALo1G5 C57g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="WxZk/ppk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id um28-20020a170906cf9c00b0078a19032c70si7421086ejb.334.2022.12.13.10.15.53; Tue, 13 Dec 2022 10:16:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="WxZk/ppk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236337AbiLMSEZ (ORCPT + 72 others); Tue, 13 Dec 2022 13:04:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236117AbiLMSEU (ORCPT ); Tue, 13 Dec 2022 13:04:20 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE0751DF3C for ; Tue, 13 Dec 2022 10:03:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670954614; 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=GLCnXgmwF35Wm3KyYmhhuEDsp+D4TIjtVKBm7qLcnYg=; b=WxZk/ppkDwYIT5BosKEuYvD/u6349XLjKZc4AwAnIb/A7qsYzJ6gquIA89BJ4g8xd/fj1E 5R139V65gqRaFLlo2pvbx+byrX1SLrpo+JxB//tJs12qS9m+iZ4T3CPUMNq/pIBtvdCRW0 fiiymUOsrbN22x79Lio7Rijxg7xoRZU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-625-ABHRZTFQOi69NheWEjnaYQ-1; Tue, 13 Dec 2022 13:03:30 -0500 X-MC-Unique: ABHRZTFQOi69NheWEjnaYQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 855EB101AA52; Tue, 13 Dec 2022 18:03:21 +0000 (UTC) Received: from redhat.com (unknown [10.2.17.61]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A1290492B00; Tue, 13 Dec 2022 18:03:20 +0000 (UTC) Date: Tue, 13 Dec 2022 13:03:17 -0500 From: Peter Jones To: Evgeniy Baskov Cc: Ard Biesheuvel , Borislav Petkov , Andy Lutomirski , Dave Hansen , Ingo Molnar , Peter Zijlstra , Thomas Gleixner , Alexey Khoroshilov , "Limonciello, Mario" , joeyli , lvc-project@linuxtesting.org, x86@kernel.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v3 00/24] x86_64: Improvements at compressed kernel stage Message-ID: <20221213180317.qoy2l3mcpjparocq@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 22, 2022 at 02:12:09PM +0300, Evgeniy Baskov wrote: > This patchset is aimed > * to improve UEFI compatibility of compressed kernel code for x86_64 > * to setup proper memory access attributes for code and rodata sections > * to implement W^X protection policy throughout the whole execution > of compressed kernel for EFISTUB code path. Hi Evgeniy, I've tested this patch set on hardware and QEMU+MU firmware, and it works for me with a couple of minor issues: - on one machine that has the DXE protocol but not the EFI one, we get an error because the firmware doesn't support EFI_MEMORY_RP - on QEMU I'm seeing the size of "(unsigned long)_head - image_base" wind up as 0, which leads to an EFI_INVALID_PARAMETER on the clear_memory_attributes() call. In both cases the system winds up working, but with unnecessary console output. I'll send you patches as a follow-up to this mail. In the mean time: Tested-by: Peter Jones -- Peter