Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8794544rwb; Tue, 13 Dec 2022 10:28:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf5ACcYoAwdb9j87rIqRwYHjW3vT38TftqTXfJSkRazKlTA31oLAuh3+H86WBxw2Jt5zLzgU X-Received: by 2002:a05:6a20:d705:b0:a4:491d:d589 with SMTP id iz5-20020a056a20d70500b000a4491dd589mr28522918pzb.4.1670956125001; Tue, 13 Dec 2022 10:28:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670956124; cv=none; d=google.com; s=arc-20160816; b=Przsv3NjpXFxSuZMUOsq6+0XfOT4Xh3gtsj0oLr+swiiQ/EJOOBZ4uteJOrnNMXyy0 StOpbXEFPrdvmeFmVy6j8snhmuwF6RekSaJ7NMnx1YHDgknE4SKXtvwJtJ909KRe23QH d/2hug1ltJg6IA1b3If7LK0wcV6TXILNe+iu0iwR9cc7YJNZUUc7mfCFE5bdc99plvRy RaSHa0pOyIsh0nKx77KxH71rDX/zjqtDukTO7J1UoqSAAkEDM18bdCbzDE/DOk5Quad/ 2EKacPSVyamfCOu7rxqAr/+iwYhvTqO2EByBHxbmhGE3lVYUY1GjGyQLofM/LYE3szkO hGNA== 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=BSZsQt2b+00I9NkxFr1DqCxFQqOr+fjPaGhCqsEly6E=; b=drMuCqyHCEwC8dEhmYEEG3LSWN27Uoa2daQC9L0U4b6AfbGvnMnzByWpf0BtAInxQm 5sZr1Ct83uWJX+x+uWNcJCUzkJYqfYRZlDj8pV8TEIF2atTZIhhvTVlM72on3OePWv7e kpKn0XE9L/NK1gq8/71AmoKN9VbNJEJV0riVSxkoyEnkbTOwvBSwZZtn0WNi/pnWSWeZ aDEiYZeCD77UrqXdHcEqqNswWiJnqtO9a/IIEWez1J/W0Okt/ysqSHj++DlJoTaQyU42 MptC7ai08ga7ROnA5VyyiOUhw3prPxN0oAzlzdLywBomMwgIAFWSbSxua5m9bwtp5YX3 c4vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WBSuGi4S; 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 n186-20020a6340c3000000b004769f0faab8si12961488pga.740.2022.12.13.10.28.35; Tue, 13 Dec 2022 10:28:44 -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=WBSuGi4S; 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 S236571AbiLMSPN (ORCPT + 73 others); Tue, 13 Dec 2022 13:15:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236514AbiLMSOn (ORCPT ); Tue, 13 Dec 2022 13:14:43 -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 24F3822BD2 for ; Tue, 13 Dec 2022 10:13:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670955225; 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=BSZsQt2b+00I9NkxFr1DqCxFQqOr+fjPaGhCqsEly6E=; b=WBSuGi4SRGUqTUjBC/SWwuACcSwSb16vNKiHDSAQvi5Ow9EdVqgxrYOEhfcHNk2DtBwXg5 2WSakgLfP54yGGXePoiQVCH1GGj8WYzt/xkWmzZURp461S4c2tkz+QArReAPlz3UqOvXAs AoINog7hiAG7Ls2i8/CaaimJBvur3+Y= 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-639-C6I4TzwDNDuSersUHDqtIg-1; Tue, 13 Dec 2022 13:13:41 -0500 X-MC-Unique: C6I4TzwDNDuSersUHDqtIg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E9410101A588; Tue, 13 Dec 2022 18:13:40 +0000 (UTC) Received: from redhat.com (unknown [10.2.17.61]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5AB9051FF; Tue, 13 Dec 2022 18:13:40 +0000 (UTC) Date: Tue, 13 Dec 2022 13:13:37 -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: <20221213181336.fjyxagxkjtq3jchl@redhat.com> References: <20221213180317.qoy2l3mcpjparocq@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20221213180317.qoy2l3mcpjparocq@redhat.com> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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=ham 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, Dec 13, 2022 at 01:03:17PM -0500, Peter Jones wrote: > 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 just realized I've overstated here - I haven't actually hit the first problem on x86, only on ARM, where we don't currently use this code. I discovered it in grub, and checked your patch set to see if you had the same issue I did. That said, "in both cases the system winds up working" is probably still true - in that the edk2 code supports EFI_MEMORY_RP on x86 but not ARM, so x86 won't hit the issue when using DXE unless someone cooks up another implementation. Nevertheless I believe the patch to fix it is correct and should be applied. Thanks! -- Peter