From owner-freebsd-stable@FreeBSD.ORG Thu Oct 2 12:53:03 2014 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3E4B187A for ; Thu, 2 Oct 2014 12:53:03 +0000 (UTC) Received: from fs.denninger.net (wsip-70-169-168-7.pn.at.cox.net [70.169.168.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "NewFS.denninger.net", Issuer "NewFS.denninger.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DAF31D76 for ; Thu, 2 Oct 2014 12:53:02 +0000 (UTC) Received: from [192.168.1.40] (localhost [127.0.0.1]) by fs.denninger.net (8.14.9/8.14.8) with ESMTP id s92CqpQq092796 for ; Thu, 2 Oct 2014 07:52:51 -0500 (CDT) (envelope-from karl@denninger.net) Received: from [192.168.1.40] (TLS/SSL) [192.168.1.40] by Spamblock-sys (LOCAL/AUTH); Thu Oct 2 07:52:51 2014 Message-ID: <542D4A7E.1050407@denninger.net> Date: Thu, 02 Oct 2014 07:52:14 -0500 From: Karl Denninger User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: freebsd-stable@freebsd.org Subject: Re: Encrypted (GELI) root on ZFS troubles References: <542C71C9.1050907@denninger.net> <542CD992.7050509@denninger.net> <542D108D.80603@FreeBSD.org> In-Reply-To: <542D108D.80603@FreeBSD.org> Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms040202080402060309010207" X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2014 12:53:03 -0000 This is a cryptographically signed message in MIME format. --------------ms040202080402060309010207 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 10/2/2014 3:45 AM, Andriy Gapon wrote: > On 02/10/2014 07:50, Karl Denninger wrote: >> 1. Having the kernel able to cross pools and examine the bootfs proper= ty >> would be fairly useful. > I don't understand your suggestion. Every pool has bootfs property (if= it's not > explicitly set then that means that it just has its default value). So= which of > the bootfs properties must be honored and why? At present we honor boo= tfs of > the "current" pool, which is the only distinguished pool. Except default is "from whence one came" and yes, I understand the problem if there's a conflict. I would argue that if the parameter is set on the pool the kernel booted from it should be honored, but if it is NOT set (that is, if it is defaulted) then if it is validly set on a different pool that one should be honored. We already do this in that if /boot/loader.conf is set that's honored, and this sounds inviolate but it in fact is not for the below reason. I do understand the problem in the general sense with "well what happens if there are two or more bootfs parameters set on other pools but none on the pool the kernel loaded from" but here's the thing -- that risk is already there, in that there's already all sorts of "fun" possible with adapters that don't enumerate reliably in order, especially if the intended boot device goes offline. My LSI adapters, in particular (which are a great example because lots of people use these with SAS expanders and lots of plugged in drives, myself included, as they work well and are pretty fast), will happily look for another bootable device that happens to be plugged in if your primary(s) are offline and, if you have one in the machine, it will attempt to boot it. Sucks to be you if that turns out to be a bootable environment. So what I think makes sense is the following: 1. If /boot/loader.conf has vfs.root.mountfrom set, honor it (yes, there is a risk to this too; you might have booted from an unintended disk!) 2. If we booted from zfs and bootfs is set non-default on the pool you booted from then honor it, otherwise honor the first non-default bootfs setting you find on any pool that is mounted during kernel init (which for a geli-encrypted pool means one that had the "-b" flag set on its members, otherwise it's not available until after init starts.) I understand this has risks but so does an adapter deciding to boot from the "wrong" disk; there's no reason for bootfs to be set non-default on a pool that isn't used for booting. 3. If neither (1) or (2) is true then mount root from the pool/device you loaded the kernel from. I can certainly understand that not being the default (you could get reamed pretty good if you booted a non-corresponding kernel .vs. the rest of the environment) but IMHO it violated the principle of least astonishment when I went to set this up and the implication that bootfs on *a* pool was sufficient as a hint to the kernel. --=20 Karl Denninger karl@denninger.net /The Market Ticker/ --------------ms040202080402060309010207 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIFTzCC BUswggQzoAMCAQICAQgwDQYJKoZIhvcNAQEFBQAwgZ0xCzAJBgNVBAYTAlVTMRAwDgYDVQQI EwdGbG9yaWRhMRIwEAYDVQQHEwlOaWNldmlsbGUxGTAXBgNVBAoTEEN1ZGEgU3lzdGVtcyBM TEMxHDAaBgNVBAMTE0N1ZGEgU3lzdGVtcyBMTEMgQ0ExLzAtBgkqhkiG9w0BCQEWIGN1c3Rv bWVyLXNlcnZpY2VAY3VkYXN5c3RlbXMubmV0MB4XDTEzMDgyNDE5MDM0NFoXDTE4MDgyMzE5 MDM0NFowWzELMAkGA1UEBhMCVVMxEDAOBgNVBAgTB0Zsb3JpZGExFzAVBgNVBAMTDkthcmwg RGVubmluZ2VyMSEwHwYJKoZIhvcNAQkBFhJrYXJsQGRlbm5pbmdlci5uZXQwggIiMA0GCSqG SIb3DQEBAQUAA4ICDwAwggIKAoICAQC5n2KBrBmG22nVntVdvgKCB9UcnapNThrW1L+dq6th d9l4mj+qYMUpJ+8I0rTbY1dn21IXQBoBQmy8t1doKwmTdQ59F0FwZEPt/fGbRgBKVt3Quf6W 6n7kRk9MG6gdD7V9vPpFV41e+5MWYtqGWY3ScDP8SyYLjL/Xgr+5KFKkDfuubK8DeNqdLniV jHo/vqmIgO+6NgzPGPgmbutzFQXlxUqjiNAAKzF2+Tkddi+WKABrcc/EqnBb0X8GdqcIamO5 SyVmuM+7Zdns7D9pcV16zMMQ8LfNFQCDvbCuuQKMDg2F22x5ekYXpwjqTyfjcHBkWC8vFNoY 5aFMdyiN/Kkz0/kduP2ek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