Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp943484imp; Thu, 21 Feb 2019 14:43:54 -0800 (PST) X-Google-Smtp-Source: AHgI3IY1i0680AdO457sUb/xO3Y+7IAo3sR/ZcECBVqFvxRo09Qrwl5DU26r5kwidrm9sdj3EFJ8 X-Received: by 2002:aa7:8b0b:: with SMTP id f11mr879923pfd.123.1550789034338; Thu, 21 Feb 2019 14:43:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550789034; cv=none; d=google.com; s=arc-20160816; b=jFaDST7mgLktk5PDjRSAXrxpPtLeFz8Ea3ngyWQsOhAtKh7sWFfi5NUcemGos0/Ern R5ZQWOm/VEHaKRTFsnNnxlaZY9iVS5LSIV9jOyGHsfn9y6/HHtcul1n5g8AzeWGgr4qo 8OyPMLO3f/Pjvyif7G0Qu5gjJwrlB36j6PQ/Lic0c0vAR9Nj2xFezXFu6KlI42/z8vTq SBynmOWgMCiYpwvOqGPVtpDt9GGEJyFUqjLJKk+wnvlfnX0AkU1ITF8s4ugRytm+/ENX icJ245/KYrD0++5/B/k0jpgyWlLA8IDWMMN/9qgtUAwhiOdzSMOjy00Tokaez5wJCFf3 vrdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=yeeHN5A8TYuXfyBLqkC461JBDCYqSC4jUmx5jzSnVf8=; b=IpFW/1Nlrt805IYnT5VkQlFA0RCKN+0Isp8ttjwhfolOySTdI9JBnAxQmh7ch2NR2D DbJ6ObbCsXNIZI1IqU4XQlZ3ywkLojdtOTa5a30PpLbUHDPbC35JjiphjBqJVhjll062 kLQA52fpiYaCw4YzVdQj0PjbfEUTO8zOtRckmLXBmJsQVhq/vDQQuSG0/beFsbtRcu87 fN6kVKaJ8WLNivO7z2dVWCJLCLa2VEkbnMsKAuHn7LXZPLULV6MIW8R0ZF5LRWAu9R2U 6r1+d1kmUCkWupNIeURT+61Xk4lL2H8QvbRFadgHMtKyDkNOpb3ztTN9uBHSm8oTMtMn a+6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HtJsTwMZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g79si72052pfg.15.2019.02.21.14.43.38; Thu, 21 Feb 2019 14:43:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HtJsTwMZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726356AbfBUWnE (ORCPT + 99 others); Thu, 21 Feb 2019 17:43:04 -0500 Received: from mail-vk1-f195.google.com ([209.85.221.195]:39503 "EHLO mail-vk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725961AbfBUWnE (ORCPT ); Thu, 21 Feb 2019 17:43:04 -0500 Received: by mail-vk1-f195.google.com with SMTP id i68so66409vke.6 for ; Thu, 21 Feb 2019 14:43:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yeeHN5A8TYuXfyBLqkC461JBDCYqSC4jUmx5jzSnVf8=; b=HtJsTwMZ/y6bodUGz8ah6aWBE3c5suzmjH4E3AscE/Q0tKHjQ0EQyLo22c9SGNSZID feywrxucg+iY26CdlDvcsjAEzrTIy5kXaAVoUzrKJUmenp3tjnpB62AMFm+D8MJJ7GYJ GOqZIAqTnGopfeQD2vySUflTZPZUYpRUV3zEU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yeeHN5A8TYuXfyBLqkC461JBDCYqSC4jUmx5jzSnVf8=; b=kGf7f9vMjb2oHMkmlQdgbBi0EW9mnH6tTQ9J2VOafWqLpb/UldDlgMH3jmu+m4wI8y TsbtHkIomtq0nlKwKndd8DFbULYnPprN0FDmET8LgdKlfN/LLmQuWhJGCKfDipmbiwPV +uTFog746UjWH1ZLQy159AMtWfRPUQlYr7fmA0h63+fjyKGKqMfB41odBiVegWS6w1qm sEyhtSfbAIQG5gedvFN4lYvO9junFZcB5vOLS7pSftJT6AGszlXwDa0BiqaB4wN6qWOZ JGJ2vmVDDeZ/BHYOpDz5GIHuUKq8eJWEK345jQCoZaTqNvw5epKquLX/EOnspWTpWk6b PCNA== X-Gm-Message-State: AHQUAuZ0dUqe2/hRH8vjkaX8RHPpQBGIB3+oWDq2pQOD1q35yq/VpTl5 OFizzgrZr73wV3veFvi02QLla+NNtt8= X-Received: by 2002:a1f:55c7:: with SMTP id j190mr602823vkb.42.1550788982052; Thu, 21 Feb 2019 14:43:02 -0800 (PST) Received: from mail-vk1-f170.google.com (mail-vk1-f170.google.com. [209.85.221.170]) by smtp.gmail.com with ESMTPSA id l193sm98769vka.19.2019.02.21.14.43.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Feb 2019 14:43:00 -0800 (PST) Received: by mail-vk1-f170.google.com with SMTP id v131so69924vkd.3 for ; Thu, 21 Feb 2019 14:43:00 -0800 (PST) X-Received: by 2002:a1f:a5d3:: with SMTP id o202mr621947vke.40.1550788979940; Thu, 21 Feb 2019 14:42:59 -0800 (PST) MIME-Version: 1.0 References: <20190221203334.24504-1-helen.koike@collabora.com> In-Reply-To: <20190221203334.24504-1-helen.koike@collabora.com> From: Kees Cook Date: Thu, 21 Feb 2019 14:42:47 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v12] dm: add support to directly boot to a mapped device To: Helen Koike Cc: device-mapper development , Will Drewry , Mike Snitzer , "open list:DOCUMENTATION" , richard -rw- weinberger , LKML , linux-lvm@redhat.com, Enric Balletbo i Serra , kernel@collabora.com, Alasdair G Kergon Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 21, 2019 at 12:33 PM Helen Koike wrote: > > Add a "create" module parameter, which allows device-mapper targets to be > configured at boot time. This enables early use of dm targets in the boot > process (as the root device or otherwise) without the need of an initramfs. > > The syntax used in the boot param is based on the concise format from the > dmsetup tool to follow the rule of least surprise: > > sudo dmsetup table --concise /dev/mapper/lroot > > Which is: > dm-mod.create=,,,,[,
+][;,,,,
[,
+]+] > > Where, > ::= The device name. > ::= xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | "" > ::= The device minor number | "" > ::= "ro" | "rw" >
::= > ::= "verity" | "linear" | ... > > For example, the following could be added in the boot parameters: > dm-mod.create="lroot,,,rw, 0 4096 linear 98:16 0, 4096 4096 linear 98:32 0" root=/dev/dm-0 > > Only the targets that were tested are allowed and the ones that doesn't > change any block device when the dm is create as read-only. For example, > mirror and cache targets are not allowed. The rationale behind this is > that if the user makes a mistake, choosing the wrong device to be the > mirror or the cache can corrupt data. > > The only targets allowed are: > * crypt > * delay > * linear > * snapshot-origin > * striped > * verity > > Co-developed-by: Will Drewry > Co-developed-by: Kees Cook > Co-developed-by: Enric Balletbo i Serra > Signed-off-by: Helen Koike Thanks! This appears to have everything Chrome OS needs. I've asked a few other folks to look at it too. Reviewed-by: Kees Cook -- Kees Cook