From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1mvPpp-0005qu-LV for mharc-grub-devel@gnu.org; Thu, 09 Dec 2021 15:16:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvPpn-0005oz-HB for grub-devel@gnu.org; Thu, 09 Dec 2021 15:16:07 -0500 Received: from [2607:f8b0:4864:20::f29] (port=33496 helo=mail-qv1-xf29.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mvPpj-0001jF-10 for grub-devel@gnu.org; Thu, 09 Dec 2021 15:16:07 -0500 Received: by mail-qv1-xf29.google.com with SMTP id bu11so6205960qvb.0 for ; Thu, 09 Dec 2021 12:16:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=rYy7DGMD6q82k4crm6S4AwQ97WXZKi0QXYpYLYhpBsY=; b=gFTpILTp6H9U2LmQqiP1Q3tILrSF2ym966jnwtll4NkE1QQIBb+SDFaAtmAlQC4YPz PJwFXn4wPuiKNeT4S2tCDJMNrSXSaWTBvd7S8Us92CDbqflFNZFJSoRgjFQBFqM5aRg/ QDZYRo6kGZIXJRIUrMxijwJ6HKulF/am5pH2z0/9+fEJSLghDGkQagz2VPWGGYIOlXEA qB5+mZxfym4QibTmbscTDAhQ1ilZRLoT3A7hmydraWR247oazAzQv7ebE5vF/MgcHV50 aucDAfh8U9hW1egzH1fzMBgB8hgBMyzWeBFYLDCKJDRPbCr4QdY6KwjgTHOAt6tQzFj3 7ktA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=rYy7DGMD6q82k4crm6S4AwQ97WXZKi0QXYpYLYhpBsY=; b=XffWopViguNWp5msCL9mwRPkJ35Vg3wFD43tZDfFLopTXiJ4i66Vtfw6tcadgHCYHs Cod/tX1YFEeg/Cm+Kmh6Fji7D3VlqQulFr0X5cLLZ3QHu6w9bbPuwB/y9H0bfd/tcJct aXWlob3ej9Cf8/XGTZ9NojTYym1c0Qn1eDKYuxdnRw6XXw5az8EQip+vlWqYmofMOS5R C56q/dfT4+gKVkZG6yJmcMox2L/3+EchgJmsW5qYoHjnZPwgN0j+uqGIzUxJ8YGdgGyc skpLMr18W1r7MfWHynMjiPqBgzdQFz/HD+XFZN7CxV4s0he5LSqAV3SJ6Tr0oySbygBD SR7A== X-Gm-Message-State: AOAM532J7RQQaNWENI3+2ebeINmyG3Wzc3hQzqcRaflMwL3xl1tCMZlr KgVW0bRZgA2EiUeDqPS3BWSmfWnrfPyu6w== X-Google-Smtp-Source: ABdhPJxEik/BOMMcRrA0vwJ24NId/KncTUJ1n+Z3Xhw/FF51gMHhJw0E8oiL6VFYdiaF6myIPCBCCQ== X-Received: by 2002:a0c:ec12:: with SMTP id y18mr19378827qvo.24.1639080961573; Thu, 09 Dec 2021 12:16:01 -0800 (PST) Received: from crass-HP-ZBook-15-G2 ([37.218.244.251]) by smtp.gmail.com with ESMTPSA id x13sm393566qkp.102.2021.12.09.12.16.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Dec 2021 12:16:01 -0800 (PST) Date: Thu, 9 Dec 2021 14:15:50 -0600 From: Glenn Washburn To: Josselin Poiret via Grub-devel Cc: Josselin Poiret Subject: Re: [PATCH 0/2] Have LUKS2 cryptomounts be useable with grub-probe Message-ID: <20211209141526.002e83a4@crass-HP-ZBook-15-G2> In-Reply-To: <20211209173853.30489-1-dev@jpoiret.xyz> References: <20211209173853.30489-1-dev@jpoiret.xyz> Reply-To: development@efficientek.com X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::f29 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::f29; envelope-from=development@efficientek.com; helo=mail-qv1-xf29.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2021 20:16:07 -0000 On Thu, 9 Dec 2021 18:38:51 +0100 Josselin Poiret via Grub-devel wrote: > Hello, > > These two draft patches make devmapper set up LUKS2 cryptomount > properties when pulling, as well as report LUKS2 cryptomounts as > having GRUB_DEV_ABSTRACTION_LUKS. This makes grub-probe and > grub-install behave properly wrt. LUKS2 drives: `grub-probe -t > abstraction /` reports all the needed modules for the GRUB image, and > grub-install leads to a working GRUB without manually adding modules. > > One small part that I am unsure about, although I have tested it and > it does seem to work properly: if I understand correctly, all dm > devices have a 512 sector size, however LUKS2 lets one choose up to > 4096 for the encryption sector size. Which of these two should be > used as cryptodisk->sector_size? I put 512 here since we're reading > through a cheated mount, but I'm not so sure. Its not clear to me, did you test a LUKS2 device with sector size 4096 with this change? I believe DM does use 512-byte sectors internally, but it can create block devices that report and use other sector sizes. You can verfiy this by creating a 4096 sector size LUKS2 devices, open it with cryptsetup, and then run "blockdev --getbsz /dev/mapper/". When having a 4096 byte sector size LUKS2 device opened via cyptsetup, here's what dmsetup table --show returns "sector_size:4096" as part of the output for the device. I'm not familiar with this code, but I'm thinking tht might show up in the "params" variable for you to use when setting log_sector_size. I have a feeling that this is not going to work as is with non-512-byte sector size LUKS2 devices. Glenn