Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp812835lqo; Wed, 8 May 2024 16:24:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVlef9u2fr/u2tj2br/RMQ9bUH4E9wZGp9ScJXXlWoeZemnD8hgkvyqwKQbKPS0KmYhiRdRIXcLZ6gZDxnMHuacHfq0VOAGk9wCdXxfYQ== X-Google-Smtp-Source: AGHT+IGmgzxt3urYdMFxO4LGx+//y2kNnOdnVHAf3SDfw3ry777CNuW3cywAiqur9Vy8FLFshUyy X-Received: by 2002:a05:6a20:a10f:b0:1a7:7505:ac97 with SMTP id adf61e73a8af0-1afc8d05d9fmr5309495637.11.1715210651895; Wed, 08 May 2024 16:24:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715210651; cv=pass; d=google.com; s=arc-20160816; b=pdKCgNyI1ocN+NCMtM91E9GpQNo882ZJ+no57Fu2dFVHIa85TNhFy1inzZoPsj+2W4 bhnieArs6MWm/V8DzIQqgQYccg8qjmh1H+nINbK6js1vocxDqvApFsLu4EJGmHPz6FuK 6LqkPtQ5iNm5ApiT9xnWvVrMyLZwnNWq4xbRiVAn10Qz2YN3pr9IXQX4Q30XewSuKIsH +H1hltv528XOCFI9MMZsq7mivg25dhMsYIOdVG/I0frXSkIIXtE59hvxG4/LfDgX9dBb gSJIPGOWBbNn9ECv18bxUiJn/MBllD5d45IUrmrr5SX0DfCpVE9QOwJ6DTOyj/xjLTXw b57w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=zFCoZuGz11CxDIRGICZr+U4KGaLYzQ/+gxe2mCyy8y0=; fh=0rn5HGW5UT4d4g69cKtsZQoUVhbfe95eaxNQuDoncG0=; b=KAgtnrtSG+xzlj937D+yO/vb/l5KdzGnBCDH/9gwm9JSydCGzWMi4AexLsl6igWIN9 qkOfcpeuxTqv5E7rA+TTKX9wmqKbb99ueGVhMwsziWG61zS3kVRonYzOb22qihr+w15t kuwwb+egamigQC7CU1L2qJbirpEy25bglggLHZ9+JE2Kcn69GskmwFS4a3JOVfio9U+V BoBt3LjKOjlEp7xBP0G56sBloIwV5Oq/LQbKbKe5AwWNFqNiscuLU3+NyYX/9+NzqOEE NSYhFFkucDMtMF8v69sN01KlkLke2vUowqyprFW7UqVHlGX1fSEDO9m+e7PMQ5Bl/VUo PXbg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-173928-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173928-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-63411902e88si132522a12.598.2024.05.08.16.24.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 16:24:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-173928-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-173928-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173928-linux.lists.archive=gmail.com@vger.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 525EEB21691 for ; Wed, 8 May 2024 23:24:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B10BF130A4B; Wed, 8 May 2024 23:24:01 +0000 (UTC) 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 2CD10B672; Wed, 8 May 2024 23:24:00 +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=1715210641; cv=none; b=gwtRVvPzB8DnxjyMj2c0Hhrp+vAKnrtKFqSdyA2vIz7k1zwT+SfFMSkPW8jU8IB0RQP/lelX1QPU7LJcrHmToQCbPIE1qCFB0HRxpH0z7dz3LaCgKW+r1450P/CqbYW4icdHBn8H2IkizpbnTgVFM6S4z0SEfqF2rqo8CW2xB3k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715210641; c=relaxed/simple; bh=vUTkfLdc7CqIpwGVwaRF5qhEnigzM/XCF5VTlfRUQJY=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lk8dP6TDSLfePVtj+YfQzueAI/ROZ1YjrskqI5J/W8WbH/lofbuydTzftrNLgqAi6msZP5QeSmUEtwHJXSniMfCQtSaBiXIFcHB6lbe8GhQHtZKzU6UIGX8GetzN4c4rVEyDhvDMPJT+yELmH2sj0cBneFTlTob0voJtqv/PW0Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96026C113CC; Wed, 8 May 2024 23:23:59 +0000 (UTC) Date: Wed, 8 May 2024 19:23:57 -0400 From: Steven Rostedt To: Ard Biesheuvel Cc: Mike Rapoport , Kees Cook , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , "Liam R. Howlett" , Vlastimil Babka , Lorenzo Stoakes , linux-mm@kvack.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Peter Zijlstra , Tony Luck , "Guilherme G. Piccoli" , linux-hardening@vger.kernel.org, Guenter Roeck , Ross Zwisler , wklin@google.com, Vineeth Remanan Pillai , Joel Fernandes , Suleiman Souhlal , Linus Torvalds , Catalin Marinas , Will Deacon Subject: Re: [POC][RFC][PATCH 1/2] mm/x86: Add wildcard * option as memmap=nn*align:name Message-ID: <20240508192357.72bfcb81@rorschach.local.home> In-Reply-To: References: <20240409210254.660888920@goodmis.org> <20240409211351.075320273@goodmis.org> <202404091521.B63E85D@keescook> <20240409191156.5f92a15c@gandalf.local.home> <202404091638.2F98764A41@keescook> <20240412181940.3e1d99f7@gandalf.local.home> <202404151017.FC002AA5@keescook> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 6 May 2024 12:38:32 +0200 Ard Biesheuvel wrote: > The logic in arch/x86/boot/compressed/kaslr.c is now only used by non-EFI boot. > > In general, I am highly skeptical that hopes and prayers are enough to > prevent the firmware from stepping on such a region, unless this is > only a best effort thing, and failures are acceptable. For instance, I would be very happy with just a "best effort" approach. I think kexec/kdump has the same issue and it hasn't been a problem in practice. > booting an EFI system with/without an external display attached, or > with a USB device inserted (without even using it during boot) will > impact the memory map, to the extent that the E820 table derived from > it may look different. (EFI tries to keep the runtime regions in the > same place but the boot-time regions are allocated/freed on demand) Part of my requirement was that the system is exactly the same (no changes to hardware or even the kernel). > > So I would strongly urge to address this properly, and work with > firmware folks to define some kind of protocol for this. We could possibly add that later, but honesty, that is something that I doubt would ever happen. You would have to get buy-in from all firmware stakeholders. I'm not sure if this is a big enough use case for them to even take a look at it. The main use case for this work is for pstore to have crash information of what happened up to the crash. In 99.99% of the time, the firmware or kaslr will not use the memory that was needed, and you can get very useful information from the crash info. If the pstore is moved, it should be able to see that the memory is garbage and just reset it. Note that we can not use kexec/kdump in the field for various reasons, and I need a way to reserve memory for several different devices (both x86 and arm). -- Steve