From nobody Fri May 20 09:54:58 2022 X-Original-To: fs@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 3CD431B47755 for ; Fri, 20 May 2022 09:54:59 +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 4L4MXM0YMBz4byh for ; Fri, 20 May 2022 09:54:59 +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 E75737E3F for ; Fri, 20 May 2022 09:54:58 +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 24K9sw5t058431 for ; Fri, 20 May 2022 09:54:58 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 24K9sw9l058430 for fs@FreeBSD.org; Fri, 20 May 2022 09:54:58 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: fs@FreeBSD.org Subject: [Bug 264090] gpart bootcode safety checks Date: Fri, 20 May 2022 09:54:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: needs-patch, needs-qa X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: piotr.florczyk@gemius.com X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: imp@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? mfc-stable13? mfc-stable12? X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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: Filesystems List-Archive: https://lists.freebsd.org/archives/freebsd-fs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-fs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653040499; 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: in-reply-to:in-reply-to:references:references; bh=M29o586DFT6CgX01VnG1Jh8rzUUYhiVMMnIQUSDzfpU=; b=runBJHd8v6TQlmieiid9Z6EYSAaqNnY11dU1dwjlHmLmkrlut7Sf0mrRDunJEtLRcxpOuW VfHnFWrT9zxHBQxGlrhK0qdWTZ/0cvgv2ukWuQ0F/zYBkwWlXBoUEKmBJbe+AZ1E+1bvPU tZQ4yGI2dSKBTbrwKq8gzpJhY+oRNNcbr2t4YmMRnkfMc0FTG+L/+lOX24RTIMoFhdG6U1 VWlifbN0yi77PbDRLYKODf/eVwrZ5ruOU9R1e2bIAddw7R2m2PIKCVWcOdMixeMWtfQxtz 4AFGS+ekH2Bt4OW4PKUn1QhtuImfbnZAMSfYtnNfmONEpcserVZ0cLIUdcqhNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653040499; a=rsa-sha256; cv=none; b=w8s/69s3jmslZFr4YRAvCVOLsA0hEJJU8pokvf1eMsfjnJ8XI+enxx/9POAXbGU+z8Y7zB wN8vU5x8it8W4rgg+cbPjbWbFgI9LQSLTPGKztPSIMkdk8gWu/e3A4OD+eNM6KmzEbKTVX xjXFTxuSjHjzFhlBD2pryYkcEtgtB8L8NMRKYZ95YBYhKL6NKmX9D/wTLdd/J0iXcIYlw7 662AXzwNaMWRnxwiWVpFtK/wmYfwr7ZOBNYOSPhTb5qoyP7s2yIO+99GBtEk4wzFpEvXYA uwJGNArjF0niEPlKBfBklsFOVzqhs1HA0WRch23cZEAFD8oi0uHyh3AUbA3nRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D264090 --- Comment #4 from Piotr Florczyk --- (In reply to Warner Losh from comment #1) I know I don't have to but as I already mentioned... If you boot in UEFI installer always defaults to BIOS+UEFI scheme and places freebsd-boot as se= cond partition. This changes holy index of that partition from 1 to 2. I operate more than 100 of FreeBSD servers and this is first time I did a t= ypo. One could say that this is combination of: - defaults in the installer (partition order, I understand why it defaults = to BIOS+UEFI) - bad luck (efi partition not mounted on older installs) - human error but the point is it could be prevented if gpart did some checks. If I understand correctly gpart bootcode overwrites first sector with code which seeks for partition type freebsd-boot. I see no reason in allowing writing boot code in other partition types. I already had my lesson. This will prevent others from losing data. Current= ly only mounted partitions are protected. Case mentioned by Kurt is also valid. --=20 You are receiving this mail because: You are on the CC list for the bug.=