From nobody Fri May 27 12:04:42 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 8DA0B1B39B69 for ; Fri, 27 May 2022 12:04:43 +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 4L8k4q1lt8z4nFF for ; Fri, 27 May 2022 12:04:43 +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 0F45921F28 for ; Fri, 27 May 2022 12:04:43 +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 24RC4hsN068566 for ; Fri, 27 May 2022 12:04:43 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 24RC4hmf068565 for bugs@FreeBSD.org; Fri, 27 May 2022 12:04:43 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 264282] BIOS boot from GELI encrypted broken / 'currdev' set to wrong string Date: Fri, 27 May 2022 12:04:42 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: yamagi@yamagi.org 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=1653653083; 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=ZPoxnt2xqUNPAmV/2PZcjNvx3jU7W+Hf8tvalurBNV0=; b=iUGJyt0qrDMZBR51KKz11NduMygYldwiOHqyCwsKQ0SoOsaDSgvVfsAHOm0E8ld91dmpxz DRHySzFudcvyxrkpp/frqUC41YzBz5uJVO4VCspoF32Rp2buYONjR9qJTiq6BPEDq4hzys +rywGCO1EuHv5frOtMq2x1c/kgXSTmkH6qaWDPClzkedrWx1xozuPrK7I0RnGH/5p4cVci BYNx9mhCTxsfYaYpt50Y/vEGwV+7Ck6dnFCu51KcPIlbQx9EENNxsBc2bDX110uXcNZzwW K75EQeQyeAbnLGGjsoV3Y1vnKqq5KkMjbP4TjbuMOZGh1BvQWsG2Km/WJuq3fg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653653083; a=rsa-sha256; cv=none; b=O8/rljUg8RK8Kx6tGwZTqMMazNQdIV6s+JEBRW+p4BiHnhWxJgms2PKS6uaYexlzil+cDb QB6Is28reEmWvHCnoD2PN/5oan5+H/YA7vsvbdCDDGfQ75Oxau5Espp0lXIzfN7iJh0NpO ErQ7NAvkOeifg2zXj4Rim98pFNxj4ibc3BH73fLRYfEUiH/C4OjSuPC0yt12AA2c8l6TbC 26/tBLVp6KTm4+xjHLlhOJkQ0V6dn3997Rm9/ohbEfRdsRD7O4NOz2YiZ3baFfYwZt9sga xfR2db+lnoDDSs/3EZ0fucjE+LuliCggkFJ1LSYxV2ourr1TT/nWdVbpEzYPWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D264282 Bug ID: 264282 Summary: BIOS boot from GELI encrypted broken / 'currdev' set to wrong string Product: Base System Version: 13.1-RELEASE Hardware: amd64 OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: yamagi@yamagi.org Hello, in 13.1-RELEASE and -CURRENT as of 18054d0220cf it's impossible to boot fro= m an GELI encrypted root volume, because the 'currdev' loader variable is set to= a wrong string. Thus the loader is unable to load the boot data from the disk. I've bisect this in 13.1-RELEASE. It was broken in commit bc9154a208248, wh= ich was cherry picked from b4cb3fe0e39a. Setup ----- I've tested BIOS boot from GPT with / on GELI. / is decrypted by gptboot. T= he bootchain is BIOS -> pmbr (read from the MBR) -> gptboot (read from a freebsd-boot partition) -> /boot/loader. geli show: =3D> 40 41942960 vtbd0 GPT (20G) 40 256 1 freebsd-boot (128K) 296 4194304 2 freebsd-swap (2.0G) 4194600 37748400 3 freebsd-ufs (18G) It doesn't matter if it's real hardware or - like in this example - an VM. = It happens regardless how many devices are attached. Problem ------- Try to boot the system. /boot/loader errors out with "ERROR: cannot open /boot/lua/loader.lua: no such file or directory." This is caused by the cur= rdev variable get set to the wrong string: # show currdev gelidisk0p3: The 'geli' at the beginning of the string is wrong. lsdev lists the device = with its correct name, disk0p3. loaders build before bc9154a208248 are working f= ine, currdev is set to disk0p3. Impact ------ This makes it impossible to boot from an encrypted /. At least not without manual interactions, like typing the correct path into the loader prompt. = I've testes only BIOS with GPT and UFS. I don't know if other combinations are a= lso impacted. --=20 You are receiving this mail because: You are the assignee for the bug.=