From nobody Sun Sep 18 06:27:18 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 4MVdBv1lF3z4c3K8; Sun, 18 Sep 2022 06:27:19 +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 4MVdBv0j1lz3Z6t; Sun, 18 Sep 2022 06:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663482439; 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=/f4JxsyVhgtewynf7kmyQ4PbLVGN98XY7OWspWplZhs=; b=dswwR+DoWgHe0QBy8FFJLRRKltwOgtPvNMyAi822//eKK1349KpbCb2fE40tMReV4UaqpP qSVpUdOWdG86Sjrtg5w0O7vnpuywonPG/Leu6XVEVVdfRU+4/P3JoGpzdGgNgbMAtEx3n8 +5BFgdcauUiCa6KFUBI4LDJ546S3XuFo/MsO7usaMPqHDhY+vRZvjNpwM6+jm7x2z1fWqM tL6Vn3ggay/PR4c0ffgezOktUqSN5EhU95cdG9PRnKln9AX4HFY67ip/1cA//E2eYyFwhe m5HTVIRX+q6iKyfjDUZ0UFjppVaBeflE2CnUmWWCfKQft/JxvYpQtDRxnKRTTg== 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 4MVdBt6p8tzxTG; Sun, 18 Sep 2022 06:27:18 +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 28I6RIsM068299; Sun, 18 Sep 2022 06:27:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28I6RIk3068298; Sun, 18 Sep 2022 06:27:18 GMT (envelope-from git) Date: Sun, 18 Sep 2022 06:27:18 GMT Message-Id: <202209180627.28I6RIk3068298@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: 8a832ed2f8c1 - stable/12 - 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/12 X-Git-Reftype: branch X-Git-Commit: 8a832ed2f8c1f87f6461d7a6932cec357b04e538 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663482439; 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=/f4JxsyVhgtewynf7kmyQ4PbLVGN98XY7OWspWplZhs=; b=ZwkxZBqH2aTdKCH8PDImRDPdW3zm0s6xtMS0/S/hA2m8ECibK5PHh/5zVNSCxatlc4vZEe yymH6hHir34lr7Wt7/czyiIZ57gLYIwY3VCeSHfIpKMMknqyA9lrgRHw9yY1+xhUnAPwiP giLLEffFQUHCtVNVvacor2rVlQKik4sdb9ko8Q1zSX9wVbot/3Bd7tWOl80cL0JNjE/NoC o6BZdLDKiLIydmiZwMrn3V4yRL0YBagrxWfjHh/m28iFEb3uT/X++BIpuWzLZzudajNsO6 uUIjq3oL9ITi3W4VsifxpsHUgF2Iet72U7Ditenj5PTXojejuE3IGZ4ccIll9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1663482439; a=rsa-sha256; cv=none; b=s/rUbrD3IjIKmOOnn2Q9GACNYIaTYcvXe3zu3Th8vn8Nd42ARpg0fZsEYd3tWuk1Wsc89M 0IMr6IW+FDGUMP3Q9Jvc/X9iueaxhvDyP03A7TieRkAIGD8wf1T0cH8xWm9XfCqm4O4O4Z SuKsM3lzBOAJceuo/eP4Eq93s0XD424YY/pYuLBL4bB8XsZaacg/2/B/zq/aAd2Z5wt7t2 j2Ch8621XxtGhFNccM4CAyjQUk7IsrvfVzTeGVGIAcpvPNSW0HJQJTLweFUwYuIU8ymojb 05eeHlt/LGrCs8qXWgjkgaLXF8B6L/xfaJd5q5470euKVxszsVysao1kLeZWPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=8a832ed2f8c1f87f6461d7a6932cec357b04e538 commit 8a832ed2f8c1f87f6461d7a6932cec357b04e538 Author: Kyle Evans AuthorDate: 2022-09-08 00:35:06 +0000 Commit: Kyle Evans CommitDate: 2022-09-17 19:32:52 +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 00d2de5de418..15e71348bb87 100644 --- a/stand/i386/libi386/biosdisk.c +++ b/stand/i386/libi386/biosdisk.c @@ -1025,7 +1025,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)