Re: [PATCH] loopback: Do not automaticaly replace existing loopback dev, error instead

2020-12-04 Thread Glenn Washburn
On Wed, 2 Dec 2020 15:36:06 +0100 Daniel Kiper wrote: > On Fri, Nov 27, 2020 at 02:36:24AM -0600, Glenn Washburn wrote: > > If there is a loopback device with the same name as the one to be > > created, instead of closing the old one and replacing it with the > > new one, return an error instead.

Re: [PATCH 0/9] Add UEFI Secure Boot detection and report the status to Linux

2020-12-04 Thread Daniel Kiper
On Thu, Dec 03, 2020 at 04:01:41PM +0100, Javier Martinez Canillas wrote: > > This patch series adds support for the GRUB to detect the UEFI Secure Boot > status using the SecureBoot and SetupMode EFI variables. It also reports > this to Linux by setting the .secure_boot field of struct boot_params

Re: [PATCH] arm-coreboot: Declare global struct ps2_state as static so symbols don't cause link failure

2020-12-04 Thread Daniel Kiper
On Thu, Dec 03, 2020 at 12:10:26AM -0600, Glenn Washburn wrote: > This appears to be a new issue surfaced by switching from gcc 9.3.0 to > 10.1.0 cross compiling toolchain. When linking these two object files > together, there is an error generated: "multiple definition of `ps2_state'". > This only

Re: [PATCH v2] loopback: Do not automaticaly replace existing loopback dev, error instead

2020-12-04 Thread Daniel Kiper
On Thu, Dec 03, 2020 at 07:57:11PM -0600, Glenn Washburn wrote: > If there is a loopback device with the same name as the one to be created, > instead of closing the old one and replacing it with the new one, return an > error instead. If the loopback device was created, its probably being used > b

RE: [SPECIFICATION RFC] The firmware and bootloader log specification

2020-12-04 Thread Wim Vervoorn
Hello Julius, I agree with you. Using an existing standard is better than inventing a new one in this case. I think using the coreboot logging is a good idea as there is indeed a lot of support already available and it is lightweight and simple. Best Regards, Wim Vervoorn Eltan B.V. Ambachtstr

Re: [PATCH v6 10/12] mips: Enable __clzdi2()

2020-12-04 Thread Daniel Kiper
On Thu, Dec 03, 2020 at 09:58:40AM -0600, Glenn Washburn wrote: > On Thu, 3 Dec 2020 15:00:14 +0100 > Daniel Kiper wrote: > > > On Fri, Nov 27, 2020 at 03:03:42AM -0600, Glenn Washburn wrote: > > > This patch is similiar to commit 9dab2f51e (sparc: Enable > > > __clzsi2() and __clzdi2()) but for M

Re: [PATCH v6 07/12] luks2: Better error handling when setting up the cryptodisk

2020-12-04 Thread Daniel Kiper
On Thu, Dec 03, 2020 at 10:24:46AM -0600, Glenn Washburn wrote: > On Thu, 3 Dec 2020 14:31:49 +0100 > Daniel Kiper wrote: > > > On Fri, Nov 27, 2020 at 03:03:39AM -0600, Glenn Washburn wrote: > > > First, check to make sure that source disk has a known size. If > > > not, print debug message and r

Re: [SPECIFICATION RFC] The firmware and bootloader log specification

2020-12-04 Thread Paul Menzel
Dear Wim, dear Daniel, First, thank you for including all parties in the discussion. Am 04.12.20 um 13:52 schrieb Wim Vervoorn: I agree with you. Using an existing standard is better than inventing a new one in this case. I think using the coreboot logging is a good idea as there is indeed a l

Re: [PATCH v6 01/12] luks2: Add slot_key member to struct grub_luks2_keyslot/segment/digest

2020-12-04 Thread Daniel Kiper
On Thu, Dec 03, 2020 at 10:46:12AM -0600, Glenn Washburn wrote: > On Thu, 3 Dec 2020 13:35:28 +0100 > Daniel Kiper wrote: > > > On Thu, Dec 03, 2020 at 01:23:17AM -0600, Glenn Washburn wrote: > > > On Wed, 2 Dec 2020 18:01:47 +0100 > > > Daniel Kiper wrote: > > > > > > > On Fri, Nov 27, 2020 at 0

Re: [PATCH v5 1/2] Warn if MBR gap is small and user uses advanced modules

2020-12-04 Thread Daniel Kiper
On Fri, Nov 13, 2020 at 09:28:45PM +0100, Vladimir 'phcoder' Serbinenko wrote: > Signed-off-by: Vladimir Serbinenko > > On Fri, Nov 13, 2020 at 9:27 PM Vladimir 'phcoder' Serbinenko > wrote: > > > > From 515ee70c0a289624f71f43cbd09be2a1b929f574 Mon Sep 17 00:00:00 2001 > > From: Vladimir Serbinen

Re: [PATCH] at_keyboard: Fix keyboards that report IBM PC AT scan codes

2020-12-04 Thread Renaud Métrich
Hi, Testing the proposed patch on my old Asus N53SN in Legacy failed: as soon as at_keyboard is selected, the keys are corrupted and it's impossible to do anything. Digging into this, it appears that query_mode() returns 2 (so set2 needs to be used), but in fact internally the keycode are th

Re: [PATCH v5 2/2] Document new limitations on MBR gap support

2020-12-04 Thread Daniel Kiper
On Fri, Nov 13, 2020 at 09:28:16PM +0100, Vladimir 'phcoder' Serbinenko wrote: > From 4bd2f59773bec11ad7be1ced5b49edbf44d711f2 Mon Sep 17 00:00:00 2001 > From: Vladimir Serbinenko > Date: Tue, 10 Nov 2020 20:23:56 +0100 > Subject: [PATCH 2/2] Document new limitations on MBR gap support > > Signed-

Re: [PATCH v6 07/12] luks2: Better error handling when setting up the cryptodisk

2020-12-04 Thread Glenn Washburn
On Fri, 4 Dec 2020 14:19:29 +0100 Daniel Kiper wrote: > On Thu, Dec 03, 2020 at 10:24:46AM -0600, Glenn Washburn wrote: > > On Thu, 3 Dec 2020 14:31:49 +0100 > > Daniel Kiper wrote: > > > > > On Fri, Nov 27, 2020 at 03:03:39AM -0600, Glenn Washburn wrote: > > > > First, check to make sure that s

[PATCH v7 15/17] mips: Enable __clzdi2()

2020-12-04 Thread Glenn Washburn
This patch is similiar to commit 9dab2f51e (sparc: Enable __clzsi2() and __clzdi2()) but for MIPS target and __clzdi2 only, __clzsi2 was already enabled. Suggested-by: Daniel Kiper Signed-off-by: Glenn Washburn --- grub-core/kern/compiler-rt.c | 2 +- include/grub/compiler-rt.h | 2 +- 2 file

[PATCH v7 12/17] luks2: Better error handling when setting up the cryptodisk

2020-12-04 Thread Glenn Washburn
First, check to make sure that source disk has a known size. If not, print debug message and return error. There are 4 cases where GRUB_DISK_SIZE_UNKNOWN is set (biosdisk, obdisk, ofdisk, and uboot), and in all those cases processing continues. So this is probably a bit conservative. However, 3 of

[PATCH v7 04/17] luks2: Make sure all fields of output argument in luks2_parse_digest() are written to

2020-12-04 Thread Glenn Washburn
We should assume that the output argument "out" is uninitialized and could have random data. So, make sure to initialize the segments and keyslots bit fields because potentially not all bits of those fields are written to. Otherwise, the digest could say it belongs to keyslots and segments that it

[PATCH v7 07/17] luks2: Add string "index" to user strings using a json index.

2020-12-04 Thread Glenn Washburn
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 Washburn --- grub-core/disk/luks2.c | 4 ++-- 1 file changed, 2 insertions(+),

[PATCH v7 00/17] Cryptodisk fixes for v2.06 redux

2020-12-04 Thread Glenn Washburn
This patch series is an update to reflect changes suggested in v6. Of note, there are a few new patches: 01, 02, and 04. 01: Daniel suggested to renae grub_disk_get_size to grub_disk_native_sectors 02: Make ALIGN_UP and ALIGN_DOWN safer 04: Make luks2_parse_digest() safer Glenn Glenn Washb

[PATCH v7 11/17] cryptodisk: Properly handle non-512 byte sized sectors

2020-12-04 Thread Glenn Washburn
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, the amount the IV is incremented is the number of 512 byte blocks in a

[PATCH v7 09/17] cryptodisk: Add macros GRUB_TYPE_U_MAX/MIN(type) to replace literals

2020-12-04 Thread Glenn Washburn
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 --- grub-core/disk/cryptodisk.c | 8 include/grub/types.h| 7 +++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/grub-core/

[PATCH v7 01/17] disk: Rename grub_disk_get_size to grub_disk_native_sectors

2020-12-04 Thread Glenn Washburn
The function grub_disk_get_size is confusingly named because it actually returns a sector count where the sectors are sized in the grub native sector size. Rename to something more appropriate. Suggested-by: Daniel Kiper Signed-off-by: Glenn Washburn --- grub-core/disk/diskfilter.c| 12

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

2020-12-04 Thread Glenn Washburn
Reviewed-by: Daniel Kiper Signed-off-by: Glenn Washburn --- include/grub/misc.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/grub/misc.h b/include/grub/misc.h index 780a34e90..73a514eb1 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -482,4 +482,7 @@ void EXPORT_F

[PATCH v7 10/17] luks2: grub_cryptodisk_t->total_sectors is the max number of device native sectors

2020-12-04 Thread Glenn Washburn
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. Reviewed-by: Daniel Kiper Signed-off-by: Glenn Washburn --- grub-core/disk/l

[PATCH v7 03/17] luks2: Remove unused argument in grub_error

2020-12-04 Thread Glenn Washburn
Reviewed-by: Daniel Kiper Signed-off-by: Glenn Washburn --- grub-core/disk/luks2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grub-core/disk/luks2.c b/grub-core/disk/luks2.c index d96764a02..bdb90e4b6 100644 --- a/grub-core/disk/luks2.c +++ b/grub-core/disk/luks2.c

[PATCH v7 02/17] misc: Add parentheses around ALIGN_UP and ALIGN_DOWN arguments

2020-12-04 Thread Glenn Washburn
This ensures that expected order of operations is preserved when arguments are expressions. Signed-off-by: Glenn Washburn --- include/grub/misc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/grub/misc.h b/include/grub/misc.h index b7ca6dd58..780a34e90 100644 --

[PATCH v7 05/17] luks2: Add json_slot_key member to struct grub_luks2_keyslot/segment/digest

2020-12-04 Thread Glenn Washburn
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 variable in luks2_get_keyslot() which was overloaded to be used for both keyslot and segment slot keys.

[PATCH v7 13/17] luks2: Error check segment.sector_size

2020-12-04 Thread Glenn Washburn
Reviewed-by: Daniel Kiper Signed-off-by: Glenn Washburn --- 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 1bb3a333d..499c9330b 100644 --- a/grub-core/disk/luks2.c +++ b/grub-core/disk/luks2.c @@ -629,

[PATCH v7 08/17] cryptodisk: Add macro GRUB_TYPE_BITS() to replace some literals

2020-12-04 Thread Glenn Washburn
The new macro GRUB_TYPE_BITS(type) returns the number of bits allocated for type. Signed-off-by: Glenn Washburn --- grub-core/disk/cryptodisk.c | 7 --- include/grub/types.h| 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/grub-core/disk/cryptodisk.c b/grub-core/

[PATCH v7 06/17] luks2: Use more intuitive slot key instead of index in user messages

2020-12-04 Thread Glenn Washburn
Use the slot key 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 and slot 4. When using the password for slot 4 to unlock the device, th

[PATCH v7 17/17] luks2: Use grub_log2ull to calculate log_sector_size and improve readability

2020-12-04 Thread Glenn Washburn
Reviewed-by: Daniel Kiper Signed-off-by: Glenn Washburn --- grub-core/disk/luks2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/grub-core/disk/luks2.c b/grub-core/disk/luks2.c index 2335ded77..4fa5a0dbc 100644 --- a/grub-core/disk/luks2.c +++ b/grub-core/disk/luks2.c @@

[PATCH v7 14/17] whitespace: convert 8 spaces to tabs

2020-12-04 Thread Glenn Washburn
Reviewed-by: Daniel Kiper Signed-off-by: Glenn Washburn --- grub-core/disk/luks2.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/grub-core/disk/luks2.c b/grub-core/disk/luks2.c index 499c9330b..2335ded77 100644 --- a/grub-core/disk/luks2.c +++ b/grub-core/disk/luks2

[PATCH 1/1] GRUB_SESAME support. (Take 3)

2020-12-04 Thread Stephen R. van den Berg
If set, it will keep the menu from appearing until the sesame-phrase has been typed. The intended usage is so that you can have two devices both running grub/Linux, each device with a single serial port. Connect both serial ports against each other, and the two devices will not accidentally trigge