From nobody Fri Sep 09 07:47:37 2022 X-Original-To: dev-commits-src-all@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 4MP7Pk0Wvhz4c2Rr; Fri, 9 Sep 2022 07:47:38 +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 4MP7Pk04zTz3Gnf; Fri, 9 Sep 2022 07:47:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662709658; 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=mkdz5V9qE+Ar2oekdjxXDpXESkppuv3KrQX48Q3mbMU=; b=ZS6oBA0mv6k6//wfSdk8fHnoxr6qpceEBFoLJhQYMQF8oZL2zeHEMRiwda3M2ujdOC18uG xUP6mUj1kvMv+TpeudClGsnN6nXp+wnZ68ymdy76gYGrRVnEDhmKdv8B89wy/kTdZdpS2J wBroZayAc0eJPCJluOJqoIlKHVG3JIqGYmbhdcprEgflnxLGuGu3j49vRFEmq2+1W+LhQI 7G4NbKNmIYKujPsH7qaujWbXvkTWJwcJSBBkv1bC7wKKaUD0XBWiiJGxyH/xMR6zO54eK5 pzKsLPVL0WOe/dyfaQV9ntcNGmApK/Is/VcA8zCfPQKmSpJicMovBxJU34YfKw== 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 4MP7Pj67yCz17yk; Fri, 9 Sep 2022 07:47:37 +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 2897lbb9029268; Fri, 9 Sep 2022 07:47:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2897lbrO029267; Fri, 9 Sep 2022 07:47:37 GMT (envelope-from git) Date: Fri, 9 Sep 2022 07:47:37 GMT Message-Id: <202209090747.2897lbrO029267@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: 643e14d0941f - main - Use the correct size when checking an EFI address List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: 643e14d0941fad1e2105aaf8ed5c3ca1dcffdb56 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662709658; 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=mkdz5V9qE+Ar2oekdjxXDpXESkppuv3KrQX48Q3mbMU=; b=Es/Wuj0fdhfx/fY4pn+7Tf1Xt16MGKSeQN+M01fOKIR16k4vkWVih5z+iyX+lLkAo/fsZd aIU1JSzRV7gudZ0VIyG/BLEDgf13KVGtzQvBWOKRaV/qt1TMtJZ+prj4aIx/m9TVNEK2/5 vy0NlJS7wT5qIFtxA9h3jW+GXIdUDviXDwXIttm+GVjpZMsdbv7HU+2mUD43vKCei07FR9 BNeH1QrOL5U0tQfcUkF2ODrHxyB0sB2kB0y4cMkFl+9CQLzVsAwEtZhQitoeGVCe/7K0Im WYf11cHoDJvqisqG87QlUY7xd3F5afmny1opWveF3llUQ0N0KNpwTq/kh96L0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662709658; a=rsa-sha256; cv=none; b=WrxO9SRbNhNDf2GoJn7tnG56Gwj4gvqqxuJSK/tfGihrvgUA4KNOs/cJnlWtphneWA20I8 nB1hQZmP22x33INYhan6OSj6riQ/Zxg+QiM62zsbZXeHiFMmlSiiZoWKYxjJqepMNgL/65 xwnchZMai1KTqvyqgrKemEUVUEn3VCc6vY7LCcjrSp8HHEIpG8SBvdzpeLjCl/ERY+urSU koL480sebYnT8bGjMHb4ZkTGhxjkSQRtCir290+Ssxs71skJao3UNcbkEmwiIZXpLvK6RB sbpYzHAzOPjx5REpazET4UgBFeGAEwgf5g2bhK6DHYzGoYADuK4G15Q78MJR1w== 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=643e14d0941fad1e2105aaf8ed5c3ca1dcffdb56 commit 643e14d0941fad1e2105aaf8ed5c3ca1dcffdb56 Author: Andrew Turner AuthorDate: 2022-09-09 07:42:49 +0000 Commit: Andrew Turner CommitDate: 2022-09-09 07:47:15 +0000 Use the correct size when checking an EFI address Use the correct page size macro when checking if an address is with the EFI runtime map. This would previously work correctly when the page size is 4k. With a larger page size it may incorrectly detect memory as within the map when it's not. Reported by: imp Sponsored by: Innovate UK --- sys/dev/efidev/efirt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/efidev/efirt.c b/sys/dev/efidev/efirt.c index 387cde5be331..e4c47fa68741 100644 --- a/sys/dev/efidev/efirt.c +++ b/sys/dev/efidev/efirt.c @@ -137,7 +137,7 @@ efi_is_in_map(struct efi_md *map, int ndesc, int descsz, vm_offset_t addr) continue; if (addr >= p->md_virt && - addr < p->md_virt + p->md_pages * PAGE_SIZE) + addr < p->md_virt + p->md_pages * EFI_PAGE_SIZE) return (true); }