Re: [PATCH v8 00/18] Cryptodisk fixes for v2.06 redux

2020-12-12 Thread Patrick Steinhardt
On Sat, Dec 12, 2020 at 03:40:30PM +0100, Daniel Kiper wrote: > On Sat, Dec 12, 2020 at 09:20:24AM +0100, Patrick Steinhardt wrote: > > On Thu, Dec 10, 2020 at 05:20:59PM +0100, Daniel Kiper wrote: > > > On Tue, Dec 08, 2020 at 04:45:31PM -0600, Glenn Washburn wrote: > > > > This patch series, fixe

Re: [PATCH v8 00/18] Cryptodisk fixes for v2.06 redux

2020-12-12 Thread Daniel Kiper
On Sat, Dec 12, 2020 at 09:20:24AM +0100, Patrick Steinhardt wrote: > On Thu, Dec 10, 2020 at 05:20:59PM +0100, Daniel Kiper wrote: > > On Tue, Dec 08, 2020 at 04:45:31PM -0600, Glenn Washburn wrote: > > > This patch series, fixes issues with v7 series. Some of those patches had > > > changes appli

Re: [PATCH v8 14/18] luks2: Better error handling when setting up the cryptodisk

2020-12-12 Thread Daniel Kiper
On Fri, Dec 11, 2020 at 07:10:18PM -0600, Glenn Washburn wrote: > On Thu, 10 Dec 2020 17:07:07 +0100 > Daniel Kiper wrote: > > > On Tue, Dec 08, 2020 at 04:45:45PM -0600, Glenn Washburn wrote: > > > First, check to make sure that source disk has a known size. If > > > not, print debug message and

Re: [PATCH v8 00/18] Cryptodisk fixes for v2.06 redux

2020-12-12 Thread Patrick Steinhardt
On Thu, Dec 10, 2020 at 05:20:59PM +0100, Daniel Kiper wrote: > On Tue, Dec 08, 2020 at 04:45:31PM -0600, Glenn Washburn wrote: > > This patch series, fixes issues with v7 series. Some of those patches had > > changes applied to the wrong patch. The added structure member was renamed > > again, thi

Re: [PATCH v8 18/18] luks2: Use grub_log2ull to calculate log_sector_size and improve readability

2020-12-12 Thread Patrick Steinhardt
On Tue, Dec 08, 2020 at 04:45:49PM -0600, Glenn Washburn wrote: > Signed-off-by: Glenn Washburn > Reviewed-by: Daniel Kiper Reviewed-by: Patrick Steinhardt > --- > grub-core/disk/luks2.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/grub-core/disk/luks2.c b/grub-

Re: [PATCH v8 17/18] misc: Add grub_log2ull macro for calculating log base 2 of 64-bit integers

2020-12-12 Thread Patrick Steinhardt
On Tue, Dec 08, 2020 at 04:45:48PM -0600, Glenn Washburn wrote: > Signed-off-by: Glenn Washburn > Reviewed-by: Daniel Kiper Reviewed-by: Patrick Steinhardt > --- > include/grub/misc.h | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/include/grub/misc.h b/include/grub/misc.h > inde

Re: [PATCH v8 16/18] mips: Enable __clzdi2()

2020-12-12 Thread Patrick Steinhardt
On Tue, Dec 08, 2020 at 04:45:47PM -0600, Glenn Washburn wrote: > This patch is similiar to commit 9dab2f51e (sparc: Enable __clzsi2() and > __clzdi2()) but for MIPS target and __clzdi2 only, __clzsi2 was already > enabled. > > Signed-off-by: Glenn Washburn > Suggested-by: Daniel Kiper Reviewed

Re: [PATCH v8 15/18] luks2: Error check segment.sector_size

2020-12-12 Thread Patrick Steinhardt
On Tue, Dec 08, 2020 at 04:45:46PM -0600, Glenn Washburn wrote: > Signed-off-by: Glenn Washburn Reviewed-by: Patrick Steinhardt > --- > grub-core/disk/luks2.c | 11 +++ > 1 file changed, 11 insertions(+) > > diff --git a/grub-core/disk/luks2.c b/grub-core/disk/luks2.c > index 8cb11e89

Re: [PATCH v8 13/18] cryptodisk: Properly handle non-512 byte sized sectors

2020-12-12 Thread Patrick Steinhardt
On Tue, Dec 08, 2020 at 04:45:44PM -0600, Glenn Washburn wrote: > By default, dm-crypt internally uses an IV that corresponds to 512-byte > sectors, even when a larger sector size is specified. What this means is > that when using a larger sector size, the IV is incremented every sector. > However,

Re: [PATCH v8 12/18] luks2: grub_cryptodisk_t->total_sectors is the max number of device native sectors

2020-12-12 Thread Patrick Steinhardt
On Tue, Dec 08, 2020 at 04:45:43PM -0600, Glenn Washburn wrote: > We need to convert the sectors from the size of the underlying device to the > cryptodisk sector size; segment.size is in bytes which need to be converted > to cryptodisk sectors as well. > > Also, removed an empty statement. > > S

Re: [PATCH v8 11/18] cryptodisk: Add macros GRUB_TYPE_U_MAX/MIN(type) to replace literals

2020-12-12 Thread Patrick Steinhardt
On Tue, Dec 08, 2020 at 04:45:42PM -0600, Glenn Washburn wrote: > Add GRUB_TYPE_U_MAX/MIN(type) macros to get the max/min values for an > unsigned number with size of type. > > Signed-off-by: Glenn Washburn Reviewed-by: Patrick Steinhardt > --- > grub-core/disk/cryptodisk.c | 8 > in

Re: [PATCH v8 10/18] cryptodisk: Add macro GRUB_TYPE_BITS() to replace some literals

2020-12-12 Thread Patrick Steinhardt
On Tue, Dec 08, 2020 at 04:45:41PM -0600, Glenn Washburn wrote: > The new macro GRUB_TYPE_BITS(type) returns the number of bits allocated for > type. > > Signed-off-by: Glenn Washburn Reviewed-by: Patrick Steinhardt > --- > grub-core/disk/cryptodisk.c | 7 --- > include/grub/types.h

Re: [PATCH v8 09/18] luks2: Add string "index" to user strings using a json index.

2020-12-12 Thread Patrick Steinhardt
On Tue, Dec 08, 2020 at 04:45:40PM -0600, Glenn Washburn wrote: > This allows error messages to be more easily distinguishable between indexes > and slot keys. The former include the string "index" in the error/debug > string, and the later are surrounded in quotes. > > Signed-off-by: Glenn Washbu

Re: [PATCH v8 08/18] luks2: Rename json index variables to names that they are obviously json indexes

2020-12-12 Thread Patrick Steinhardt
On Tue, Dec 08, 2020 at 04:45:39PM -0600, Glenn Washburn wrote: > Signed-off-by: Glenn Washburn Reviewed-by: Patrick Steinhardt > --- > grub-core/disk/luks2.c | 30 +++--- > 1 file changed, 15 insertions(+), 15 deletions(-) > > diff --git a/grub-core/disk/luks2.c b/gru

Re: [PATCH v8 07/18] luks2: Use more intuitive object name instead of json index in user messages

2020-12-12 Thread Patrick Steinhardt
On Tue, Dec 08, 2020 at 04:45:38PM -0600, Glenn Washburn wrote: > Use the object name in the json array rather than the 0 based index in the > json array for keyslots, segments, and digests. This is less confusing for > the end user. For example, say you have a LUKS2 device with a key in slot 1 > a

Re: [PATCH v8 06/18] luks2: Add idx member to struct grub_luks2_keyslot/segment/digest

2020-12-12 Thread Patrick Steinhardt
On Tue, Dec 08, 2020 at 04:45:37PM -0600, Glenn Washburn wrote: > This allows code using these structs to know the named key associated with > these json data structures. In the future we can use these to provide better > error messages to the user. > > Get rid of idx local variable in luks2_get_k