From nobody Sun Sep 18 06:27:10 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 4MVdBk5qcMz4c3D4; Sun, 18 Sep 2022 06:27:10 +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 4MVdBk5Dq6z3YZ1; Sun, 18 Sep 2022 06:27:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663482430; 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=eP///42jXXCjuWesT18GXiQeZef+CRBqJbl6RSAGNtQ=; b=b1HcFt8JaMM7AmGJ3FkCNplt43JcWHVSHdkhoCZ3oxz+WYHOpC/loGWcBTmnWEwOka5tG3 Een7XYehXBkkvTtg20CnMYbb+H6B8i6jvtGS7SOG4nzlfR8z8iGpB5qtoSbuxiRl2QKElX i8b677xQycdRrj47UTqjm5V5xGt8ytz5bt2PS2g3eVGGv6MjO1YnnoS+kj+SQyUbKjxjOo jyS84xbvK3ZYjSh+gl6JFsghpU1Flj4+SEo8ygHEVWtRrFTq20QZVhnXfunJP4IM//sKXR zqr8Y9DdTRkNBMP8MykRyZRNdOa9qviHrb2ocNeQL/Wymestriuf45PTU3Wdfw== 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 4MVdBk4G8lzxdd; Sun, 18 Sep 2022 06:27:10 +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 28I6RAeR067941; Sun, 18 Sep 2022 06:27:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28I6RARZ067940; Sun, 18 Sep 2022 06:27:10 GMT (envelope-from git) Date: Sun, 18 Sep 2022 06:27:10 GMT Message-Id: <202209180627.28I6RARZ067940@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 7e04dc0797f3 - stable/13 - stand: i386: take into account disk sector size for blk calculation 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: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7e04dc0797f3265a10975cac2670f0407487a925 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663482430; 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=eP///42jXXCjuWesT18GXiQeZef+CRBqJbl6RSAGNtQ=; b=Qe5gGSy/9zZRJ3pf+c5XKLxjHvJjcbbtSl6+mzU0PZLI4C+Sv77me0Dz1CPxzSA2Owc38n 0rBpYOgGDbUjrrpFP7VeTOwP8zIlWJWD7P0VKaNFcfDNGY58e/1G/IggwSJuHs3sRDEL9i QWiH3eqh1YknDVu4aENnC49XeFzTvmNIhrZdQ+PNyZIjL6xL4BL9CBVPrXRRTm/6dWO2Ed gOjSAXNAfBGuIqmJGbOrJ6LPldR6Fdt2QUZ36qijvQK5L6qsBAIGDIiDlt/9h8cWja6wgD ayoYq1001C8epv+6cFBoAK1XJiEUcCTANFpRmYqrjTp330n0B3x9s4lWZB03jw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1663482430; a=rsa-sha256; cv=none; b=g9lPvmhFcWPb6m4n95gsRwemVBuoYYPmxhd7OzGaQW+VhnVxm6LE1OChhlKKnkJQ/Vk0AW 9e23U9nLGVxKDu5s3A1YHFKNQenodnjx3vFvNq3zQAgIblxVDaqLJEo8ngXMxQHCifb+3A eaTNVAsIyizbiT/oVvGg3d3ceUW9ypO39rZ92CAoxOmbsnY0v+U1XL3WeHUkqSNR7AwyGo UtqN5x/XqEOcQZK0XakzPT3eFYukaIpxqqOLSmm9EFQ9VAAPKsNGZFy71xuhF/ZwYyWQLN aRwxAHh2263tJ33N50GpF5Yv84KOEnoJO9KKT1yE0017VnTNjhnllpwfoBYGRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=7e04dc0797f3265a10975cac2670f0407487a925 commit 7e04dc0797f3265a10975cac2670f0407487a925 Author: Kyle Evans AuthorDate: 2022-09-08 00:35:06 +0000 Commit: Kyle Evans CommitDate: 2022-09-18 06:26:40 +0000 stand: i386: take into account disk sector size for blk calculation disk_blocks assumes BIOSDISK_SECSIZE, but the media may not be using it. In particular, bioscd on Parallels presents a 2K sector size, so we end up with a short disk_blocks and subsequent validation fails when trying to read /boot/lua. PR: 233098 Reviewed by: imp, tsoome (cherry picked from commit 72291cee075d9ef1a608b2a67762b44e024cc0d4) --- stand/i386/libi386/biosdisk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stand/i386/libi386/biosdisk.c b/stand/i386/libi386/biosdisk.c index 2c52617f255d..f8c712b324c6 100644 --- a/stand/i386/libi386/biosdisk.c +++ b/stand/i386/libi386/biosdisk.c @@ -1031,7 +1031,8 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size, d_offset = dev->d_offset; } if (disk_blocks == 0) - disk_blocks = bd->bd_sectors - d_offset; + disk_blocks = bd->bd_sectors * (bd->bd_sectorsize / + BIOSDISK_SECSIZE) - d_offset; /* Validate source block address. */ if (dblk < d_offset || dblk >= d_offset + disk_blocks)