From owner-freebsd-bugs@freebsd.org Mon Nov 12 19:45:15 2018 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DBC7110FF24 for ; Mon, 12 Nov 2018 19:45:15 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id BCB2D7FFA9 for ; Mon, 12 Nov 2018 19:45:14 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 7FB70110FF23; Mon, 12 Nov 2018 19:45:14 +0000 (UTC) Delivered-To: bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D9C6110FF22 for ; Mon, 12 Nov 2018 19:45:14 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D526F7FFA8 for ; Mon, 12 Nov 2018 19:45:13 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 0CECA19FCE for ; Mon, 12 Nov 2018 19:45:13 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id wACJjChC027562 for ; Mon, 12 Nov 2018 19:45:12 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id wACJjCYd027561 for bugs@FreeBSD.org; Mon, 12 Nov 2018 19:45:12 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 233180] Several errors in pmbr: 64-bits arithmetics and some others Date: Mon, 12 Nov 2018 19:45:13 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: 11.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: kmachine@free.fr X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-Rspamd-Queue-Id: BCB2D7FFA9 X-Spamd-Result: default: False [-105.89 / 200.00]; FORGED_RECIPIENTS_FORWARDING(0.00)[]; ALLOW_DOMAIN_WHITELIST(-100.00)[freebsd.org]; FORWARDED(0.00)[bugs@mailman.ysv.freebsd.org]; SPF_FAIL_FORWARDING(0.00)[]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; XAW_SERVICE_ACCT(1.00)[]; RCVD_IN_DNSWL_MED(-0.20)[5.0.0.0.0.5.0.0.0.0.0.0.0.0.0.0.a.6.0.2.4.5.2.2.0.0.9.1.1.0.0.2.list.dnswl.org : 127.0.9.2]; MX_GOOD(-0.01)[cached: mx66.freebsd.org]; NEURAL_HAM_SHORT(-1.00)[-0.996,0]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; IP_SCORE(-3.69)[ip: (-9.84), ipnet: 2001:1900:2254::/48(-4.78), asn: 10310(-3.71), country: US(-0.09)]; ASN(0.00)[asn:10310, ipnet:2001:1900:2254::/48, country:US]; FORGED_RECIPIENTS(0.00)[bugs@FreeBSD.org,freebsd-bugs@freebsd.org]; TO_DOM_EQ_FROM_DOM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; FROM_NO_DN(0.00)[]; RCVD_COUNT_SEVEN(0.00)[7] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 19:45:15 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D233180 Bug ID: 233180 Summary: Several errors in pmbr: 64-bits arithmetics and some others Product: Base System Version: 11.2-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: misc Assignee: bugs@FreeBSD.org Reporter: kmachine@free.fr These issues have low impact because they require precise circumstances to trigger one of them. The disk must be > 2 TiB in size and either: - The primary GPT header is dammaged. - The freebsd-boot partiton is located farther than the first 2 TiB of the = disc and one of its sectors takes place at a lba value that makes the higher 32 = bits of this very value change. Errors and corrections folow: * Lines 117 - 118 main.3a: decl (%si) # 0x0(%si) =3D last sec (0-= 31) movw $2,%cx Should be: main.3a: subl $1, (%si) # 0x0(%si) =3D last sec (0-= 31) sbbl $0, 4(%si) movw $4,%cx -> Copies only two 16-bits words but it's a 64-bits value. Moreover, decrem= ents this 64-bit value without care for a possible carry. * Line 131 movb $0x10,%cl repe cmpsb Should be: movw $0x10,%cx repe cmpsb -> It's CX the counter for repe not CL. It works as is but it's dangerous to keep that. * Lines 153 - 154 next_boot: incl (%si) # Next LBA adcl $0,4(%si) Should be: next_boot: addl $1, (%si) # Next LBA adcl $0,4(%si) -> inc instruction doesn't affect the carry flag. * Lines 174 - 175 incl GPT_ADDR+GPT_PART_LBA # Next sector adcl $0,GPT_ADDR+GPT_PART_LBA+4 Should be: addl $1, GPT_ADDR+GPT_PART_LBA. adcl $0,GPT_ADDR+GPT_PART_LBA+4 -> Same as before. --=20 You are receiving this mail because: You are the assignee for the bug.=