From nobody Thu May 19 23:44:34 2022 X-Original-To: bugs@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 76A121B39849 for ; Thu, 19 May 2022 23:44:35 +0000 (UTC) (envelope-from bugzilla-noreply@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 4L460262k7z3QMJ for ; Thu, 19 May 2022 23:44:34 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 AB758272F2 for ; Thu, 19 May 2022 23:44:34 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 24JNiYrH015907 for ; Thu, 19 May 2022 23:44:34 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 24JNiY46015906 for bugs@FreeBSD.org; Thu, 19 May 2022 23:44:34 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 264090] gpart bootcode safety checks Date: Thu, 19 May 2022 23:44:34 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: piotr.florczyk@gemius.com 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 List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653003874; 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=H4MIbIHAdok16Cp/FB5c+ludVc4K8KNqon5hQenGtW0=; b=xcI4dnBevK4Q5yb5b5ekg1Oz0i4GQ2D7glin4HZOJuJoIcql7NA15TDhziwMtdkGWp+Vau wDle/I8d3LzMg6HZI1MNzt6PJ/BhcxyMbPatmlbPj87rV1mwijdXfnt+hMfQdy5XJNkUbx dQ/vwEE//nvj/uXSrwBu3KtTJYDe3NTeGq4FPhirDSjq5TpDR2PfxnXEjBXm1A0UQcIjnF WcWOEsGMbvuOxpEz7cbIkLCERO5MBKdOH5o6g+8nlefm6XjClrafjOjh/8nrInkske8My+ UWltWxnkeaW+h9NMyRCm8BWyzjU32gKgH9XcZhOKSBbfTmdTHg6j5N3phBm73w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653003874; a=rsa-sha256; cv=none; b=w398cH5bODGDMMo+aA8OXOv4wnSZup/ULcMLO9bTXp7eff+Es7DUR3fEXjk1wTMtpWuvkx tB40lTVES9kKVJAmhgbCDBe2yk4gXuvITRZUvz3Atlt9SZLanosYxzA5VF4tb9RoTrNLVQ dZR6IkrkGVXQiYwqdJWwQV8g3jH00sEtU7OHEoKMLt+UC1lpZnUWW3QMvLP9y2RqIR3eZx xsSJwkDAqYa6QGM1CSU/8e65LBaV+5EDs1+saK39sZbRxPtg6EF46EPCoHyCtElmS8yBsZ UIT9LbI3EZUEFHqVik2Zlh5ynkvmJPX83oULaxExceSARl3/P7fM7+uI9h5tpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D264090 Bug ID: 264090 Summary: gpart bootcode safety checks Product: Base System Version: Unspecified Hardware: amd64 OS: Any Status: New Severity: Affects Many People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: piotr.florczyk@gemius.com gpart bootcode should at least check partition code before writing anything= to disk and abort operation if it's not freebsd-boot. This is unfortunately based on true story... I had to upgrade couple of ser= vers which belong to our client. Those servers were installed using dual partiti= on scheme which puts freebsd-boot as a second partition after efi. gpart bootcode -p /boot/gptzfsboot -b /boot/pmbr -i1 da0 happily wiped efi partition (which on FreeBSD < 13.0 is not mounted) making servers unbootabl= e. I don't have access to console, so admin on another side has to deal with eff= ects of my muscle memory/incompetence. Considering that zpool upgrade, all blog/forum posts (related to bootcode) mention '-i1' overwriting wrong partition by accident is more than possible. This issue (to some extent) might be related to bug #211503 --=20 You are receiving this mail because: You are the assignee for the bug.=