From nobody Sat May 21 11:06:21 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2311D1AEB94B; Sat, 21 May 2022 11:06:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4L514G0SVdz4vVH; Sat, 21 May 2022 11:06:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653131182; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XvsIOUyRLVNQ2iZCgUgR/a93sz2spT8eMSijU2UDM/c=; b=u9wrq+HF39mxKAHU39GL8oqoqID/QIKBVhzqGXR5jl5IhGywcfedBTZdi7VfxhuNo3gxWp BCZ1AXL/AOPJTV4QjTODqFlGYZzb5jNsRiI1WXemK9/Xvi1934yS/8gCEvvnITLvgtc6uI ZJO6aEhB7BobbfKfkUIjcbJTBn7CIUaBogE4Yn92Q9EC7K9nGdgEyIVKEChGFojzzVMv1f Zca0Z7n5skK4DxvOpWFqxb4J2H9N7pLdhuQF1d8VrcTMH4KMO0a6t6Z0I6xI2EFm2L6eXR 8fhhKuJqRvCAUJpP5ovPlE7XBC/rHCMIp/OP8Ls/0Udxz7Ae7IaLBDn8hum3dA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3F4E2581D; Sat, 21 May 2022 11:06:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 24LB6LbO089127; Sat, 21 May 2022 11:06:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24LB6Lxc089126; Sat, 21 May 2022 11:06:21 GMT (envelope-from git) Date: Sat, 21 May 2022 11:06:21 GMT Message-Id: <202205211106.24LB6Lxc089126@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 0d6600b579be - main - Set mm before passing it to the UEFI firmware List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0d6600b579be769b85f049ef421023316f21b5c3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653131182; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XvsIOUyRLVNQ2iZCgUgR/a93sz2spT8eMSijU2UDM/c=; b=UVK6ZtMuDAVtnbz0+mjVeK01Zd2Z9KMkY2UDRhxlSsLzxzWDoZx1L/45eIsGv8sUiE+5Se zzVrqKIr2UsUngLB93CCu1kMtk4oWa3PRu9V9YcdMgVN1xuuI8L1jyevKnhoUgNR00o6Qn Mzak+rMCL3zX/TeFOwimpJs+ICdWZerisY3zYzMlKxcwzRVgepOCJhx5fnIoS/woGTYM6M lg/OQPhdgDcLcJjT4NqmaGkv0e60s5+ggWKpT1fUpkUr2rPjA0rWQEj0EoDf05rC3/9KHJ hDn+MuceQNoY9MHvFs9o6r8UBrlO9eCxaMnM/L6oZnfY95lIS5nTIMiItNjBSw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653131182; a=rsa-sha256; cv=none; b=yGJcHZa9jMzJZgh7ExZJuSWuYYthdCdKYMYcnUaqjiCzZcDaQTQDMoyiJ47C/KTCDIcGWt 5/IAd7kadjZ/P7i6o6/4I9fuwZWnFgK3wnCKQmVf/W6m2y/0MSsUdo5AThgQ1u1UZO/UHn ZT4+TW7kR5/qyKDwt4aPVJmaZgdqY2d+TVtdLscBgnk7JHs9aAbeXUNcZ7/4ELF6WCsVRY Hw3f21eUCVkNvITgOnEv7eeUGxuILrseG5IqehRDwIyH1X1J84aXQ6v9owrhMuAosEiFBO WQxpz0FeEYqtePIT0DllvGZf3qiz4DcPphc8G+qmjEVCaHr4SgaYM5CPWAnGEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=0d6600b579be769b85f049ef421023316f21b5c3 commit 0d6600b579be769b85f049ef421023316f21b5c3 Author: Andrew Turner AuthorDate: 2022-05-21 10:45:41 +0000 Commit: Andrew Turner CommitDate: 2022-05-21 10:45:41 +0000 Set mm before passing it to the UEFI firmware When reading the UEFI memory map we pass in a pointer to the memory to hold the map. Unfortunately it wasn't initialised before the first use so clang decided it was undefined behaviour so the entire loop was removed. This leads to everything in bi_load after this to also be removed as dead code. The next function after bi_load in the binary is efi_copy_init. The above caused us to enter efi_copy_init with a return address of the start of the function. Because of this it would enter an infinite loop of calling the function, allocating memory, then returning to the start of the function. PR: 264021 --- stand/efi/loader/bootinfo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c index ca7a2c8ce4b8..c7b682819a98 100644 --- a/stand/efi/loader/bootinfo.c +++ b/stand/efi/loader/bootinfo.c @@ -347,6 +347,7 @@ bi_load_efi_data(struct preloaded_file *kfp, bool exit_bs) */ sz = 0; + mm = NULL; /* * Matthew Garrett has observed at least one system changing the