Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp485128lqo; Thu, 16 May 2024 11:47:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVaZeWysvh71R7jzSUPFi9Fgf7Rh8jdMhTS7RAFOCxQ549BDl7L6vU1urL7Cqvt50yKkEAD9bJS7A4h29qrylhEoX7DA8r8PgIbz2DJBw== X-Google-Smtp-Source: AGHT+IGZ7iBvm0e4C4LrfCbRjLD5IsbGvpFxYDr80juEWN77P7sybzaae/jMEovkMqmwEvKEtpRD X-Received: by 2002:a05:6a20:971a:b0:1a7:5780:1f4b with SMTP id adf61e73a8af0-1afde0bc489mr22820861637.24.1715885278495; Thu, 16 May 2024 11:47:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715885278; cv=pass; d=google.com; s=arc-20160816; b=mxiKbK0e7Z7HORzWLSEyhgEvly8W95fOw4AteS6bx7+mS0P9tU0GY7fkvfa6VFOycB z0f8Gi3M79zn+XfPizRBMJUqhSvQO9vqDBH2UxtnA60mGm7UptixSQcddMg+X8+xzW2x bRx1w7dapK/QdAW7+SCTExtgBznttUPeOkeeeEV44qe+5u5gmilpzoULNriIK0HqiWXm ZL75T+zEkjzFSAXpwHBNpAJnfpSQuL3gKc3L3hZZ5rernNhydjoTcocELJeUt+r07Owv oIUgrstrwlYd2SAv3Ah5Bvrf95it86UWIuMIaIi7fozCDYJRPwYJ0qUs/uTvsqXp2kDv TDaQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=jm+jW7lXzqC7OUQoWU9fKu4kPcG7Y8Ley+euTkWLiUs=; fh=JAQvG/j9aKE88alugSKdnS0KB7fEFVNeY3yZlmC34T8=; b=wsgzI5s0hydz1H81KP2wISLQbw5ssDmS9zqE9l4eIH93F/nxZN0qtjYAtAD94uOyDH uzCPO1flA/UKkmlXcdWvHklvE/YhNxh8pEWg98TbQDzS587QY83G7c3r+JhEuZV0emNN l4SJhJXacr/EqgeeNQv0AKQLjt/YcHHbkCUdseuumnbnR4Awytlo/xJ9ut8WniyNOpR2 Aqqc2tfeyH+vMnSfUYrkPiMupXa+tm5xydyAUS9xSVSypHZm3A3SQBg5yWg31cnPRQFy 8r8gAtC+Lgv1i0um2Ob+Wz4BJTech1Cdd+58o/p9qlto30nC5HKtVTQTrclM5pT4MQRw rp4A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gVXTlHEp; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-181483-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181483-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b628a5b91fsi18300324a91.40.2024.05.16.11.47.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 11:47:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181483-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gVXTlHEp; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-181483-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181483-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 25F50281994 for ; Thu, 16 May 2024 18:47:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F5FA156F55; Thu, 16 May 2024 18:47:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gVXTlHEp" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 65A7314533D; Thu, 16 May 2024 18:47:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715885261; cv=none; b=UOyvAbvdc/AcZt8cIARwutCYF6sBMLE9sP7gdtRnMZmkeOzer0X4TfC7Y3qh4KHeloz0xICMV5FmIEevyKOnCyVSVyvbKw7aDcmMuTV7C4Pfjhg+4LENZs3RAJ4M7cf63f6TtvTAmNDHNCn4G0hVDkjw8WLgIXxa2EEGJmVZP88= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715885261; c=relaxed/simple; bh=jm+jW7lXzqC7OUQoWU9fKu4kPcG7Y8Ley+euTkWLiUs=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=KUfyKCjocP2Gb9t2apkE/4JerPTEcZCjq5VzYdQFuQzvhUj1W39VrTtecjJq2Jg54GjtIFrd19UaOCEF0RD+cmGGejjX/pr7XKU6mx9cAnZ4WaWoYyjtw3UgtdLIFwlN9hfwQmCVN284+m/zlRw4bCesI2PuD+BPHvs3IqOJ1ls= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gVXTlHEp; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEFA0C32786; Thu, 16 May 2024 18:47:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715885261; bh=jm+jW7lXzqC7OUQoWU9fKu4kPcG7Y8Ley+euTkWLiUs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=gVXTlHEp+++5rSNwyJMr118cGmOOnB+Jxn4WluPQSdvjVzMNLTY5dWB7cnfkdm3kR XGw487Yb9CEsLvYBWHjqiWhW+QfNhyuVm2c7rEuPlKnFT2bNTRBtBjFpdAgXFlcvQN Lv//0Sj9cYWvrg+blKTxqgwEbwtDcLDImXiH0klDWvMHI6G2e5GmxQKiCFy8SNJubs 0g6z/0gX97SyIVvN+HLAhQFwLdRIPS/qQRz95lhgL4h2+PM4gPL9Lrgp4TcGCHOo0N ngGrF6tit5Ezm42NFIljZxmC4qDtTAhCgS8+kJ3GWcIYqvdeDLBT5mgsmYiRhY1g0k erUqLPyVFY3rA== Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-2e6ffe57c23so11131601fa.3; Thu, 16 May 2024 11:47:40 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCUipu1P4fWbLXNbvfjRg/aQlZQM52duKCfB6cyIfUZEU8pWfGN+A2rGCf0a5wKEQe3w4xOuk+o0SiX86J1o850T5jVNn1NB9jf3BmDbkWVqMxeGvA4o22j6ERlvMw/203zCFtOlGcFZUnAABJgp4qqf2XXBGlbTObjMM0wKbpKW X-Gm-Message-State: AOJu0YwvDwoVw/UEfk7LFl5xzwmIMJpPm+C6zYFlxBNBZDtD85mgbFWR 7zqCw5fEiDp1HoBtV9lh76kj822agdQm58gddSPQNqJkUsKiUgSwx2rGgt6jwC2MU/iC7Dmv8Cd v/tQONcR1mvHBnorjUWaxYmBIbZk= X-Received: by 2002:a2e:9650:0:b0:2e1:d747:8c0 with SMTP id 38308e7fff4ca-2e51fe54086mr156416451fa.21.1715885259339; Thu, 16 May 2024 11:47:39 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240516090541.4164270-2-ardb+git@google.com> <202405161142.A62A23A9@keescook> In-Reply-To: <202405161142.A62A23A9@keescook> From: Ard Biesheuvel Date: Thu, 16 May 2024 20:47:27 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] x86/efistub: Omit physical KASLR when memory reservations exist To: Kees Cook Cc: "Chaney, Ben" , Ard Biesheuvel , "linux-efi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "x86@kernel.org" , "stable@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" On Thu, 16 May 2024 at 20:45, Kees Cook wrote: > > On Thu, May 16, 2024 at 05:29:11PM +0000, Chaney, Ben wrote: > > > +static efi_status_t parse_options(const char *cmdline) > > > +{ > > > + static const char opts[][14] = { > > > + "mem=", "memmap=", "efi_fake_mem=", "hugepages=" > > > + }; > > > + > > > > I think we probably want to include both crashkernel and pstore as arguments that can disable this randomization. > > The carve-outs that pstore uses should already appear in the physical > memory mapping that EFI has. (i.e. those things get listed in e820 as > non-RAM, etc) > > I don't know anything about crashkernel, but if we really do have a lot > of these, we likely need to find a way to express them to EFI... > Perhaps. But the fact that the current KASLR code ignores it entirely suggests that this has not been a problem up to this point.