From mboxrd@z Thu Jan 1 00:00:00 1970 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 B0DEB3E0C75 for ; Wed, 6 May 2026 09:02:19 +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=1778058139; cv=none; b=Ux73+/gsis0Wdl4Ua6D9yfvTzr/dxjrCOvNssijCv4hycoR59Io3/PqikGpP+A6oJEtYHeAHgbi6rIRAMbFZcnWA+BV1PT9/Wmgse3faq/PB+a4CqogzwgfAuJXjB9KaiEIsSJrKYQEbZ6N3+DY7CDHovCbHG1dZ5QlXpk7sMgw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778058139; c=relaxed/simple; bh=Dw1Rx65D0dR6RpuF0bMJRvsHapDYA7j30OtceP9WKRw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=Sgnz1vYK4INj3yMiBdj9p4XkwtG/iA/RCpTNf6f1gQM2oZWtlpg238DUr0+Ts+A0MsKQiz9Tmghklgrb6R4q32u1Et5xB/92jRhqgkWhgpfFWsRh00o0exas01894LsevSOyKzYG0aJnELxEPi70739yjnhxbFECkZsLD0Zn2YE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ABhWe+Qw; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ABhWe+Qw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3CD0CC2BCB8; Wed, 6 May 2026 09:02:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778058138; bh=Dw1Rx65D0dR6RpuF0bMJRvsHapDYA7j30OtceP9WKRw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ABhWe+QwA67krx3H/v590dbcsj5PBVLTlwoY0yXUoyaqgls7sm04Nwgez/PjANGwP PYXTmAK7Zpq3mBwp8CyfojZpy3MaCzzj7Ns2FgAG20xvV3cmOgiaXkmEsAacN453RZ bAmpQBhMrbqDrHtwI+TCQM9q/t4FD+0frYzc5bZMs32mtLukkvpx/oMNHLklNdl9Bf MK9FaPpsgF2UkklRsBX3pCTko1oMciKUBTcm5Dy8TbbEv1jsWr/LqZhM4bPjprEp8L GqU17E36DJOGZnB0Vyt29zolICucxdoifruY2DLwXGlYF/yZtWbVn2Fd1mdm6dudrU 7wkkypPZOFt6w== From: Pratyush Yadav To: Pasha Tatashin Cc: Cris Jacob Maamor , Mike Rapoport , Pratyush Yadav , Alexander Graf , Andrew Morton , Greg Kroah-Hartman , kexec@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/5] liveupdate: validate restored LUO metadata In-Reply-To: (Pasha Tatashin's message of "Fri, 1 May 2026 19:34:25 +0000") References: <20260501094637.38650-1-crisjacobmaamor@gmail.com> <20260501173053.73116-1-crisjacobmaamor@gmail.com> Date: Wed, 06 May 2026 11:02:15 +0200 Message-ID: <2vxzse84zzag.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Hi Pasha, On Fri, May 01 2026, Pasha Tatashin wrote: > On 05-02 01:30, Cris Jacob Maamor wrote: >> LUO restores metadata from KHO/FDT during liveupdate. The restored >> metadata contains physical addresses and count fields used to access and >> walk preserved session, file set, and FLB arrays. >> >> This series adds a non-consuming KHO preserved-range check and uses it >> before phys_to_virt() on restored metadata addresses. It also rejects >> restored counts above LUO_SESSION_MAX, LUO_FILE_MAX, and LUO_FLB_MAX >> before traversal. >> >> As far as I can tell, this is root/admin-only; I do not have evidence >> that a normal unprivileged user can trigger it directly. >> >> Changes since v1: >> - Dropped RFC marking. >> - Added changelog text to each patch. >> - No code changes. >> >> Cris Jacob Maamor (5): >> kexec: handover: add helper to check preserved page ranges >> liveupdate: validate LUO FDT physical address before mapping >> liveupdate: validate restored LUO session metadata >> liveupdate: validate restored LUO file set metadata >> liveupdate: validate restored LUO FLB metadata > > I have replied separately in the security report to clarify that this is > not a bug. The behavior follows the ABI specification exactly: we use > the PA addresses and ranges provided by the KHO FDT tree. > > NAK I really do think we should do a restore-only variant for the kho_alloc_preserve() family of allocators and use it everywhere. It would prevent problems in the future. Not because the previous kernel is malicious, but because we might have bugs and the KHO page magic sanity check acts as a defense in depth. For example, I am currently looking at a LUO bug where LUO does not track if a session is outgoing or incoming. So you can do a retrieve() or finish() on an outgoing session. A lot of nastiness is saved because of the page magic check. Things like kho_restore_vmalloc() or kho_restore_folio() fail early and loudly. If we want to squeeze out more performance later down the line we can move it behind a debug config, but having this usage pattern of always restoring before using is going to be a lot more sane than just using physical addresses willy nilly. The approach this series takes with kho_is_preserved() is the wrong design. But a kho_restore() or something similar (maybe we can find a better name?) is really where we should be going. -- Regards, Pratyush Yadav