[PATCH] cryptodisk: Fix Coverity use after free bug

2022-01-01 Thread Glenn Washburn
The Coverity output is: *** CID 366905: Memory - illegal accesses (USE_AFTER_FREE) /grub-core/disk/cryptodisk.c: 1064 in grub_cryptodisk_scan_device_real() 1058 cleanup: 1059 if (askpass) 1060 { 1061 cargs->key_len = 0; 1062 grub_free (cargs->

[PATCH v8 0/7] Cryptodisk detached headers and key files

2022-01-01 Thread Glenn Washburn
This patch series is an updated version of the v7 sent by Denis Carikli with modifications to reflect changes in argument passing to crypto backends. The previous patch #6 titled "Add support for LUKS1 key files" has been removed as its not needed anymore. Patches #6 and #7 are new, for updating th

[PATCH v8 1/7] cryptodisk: luks: unify grub_cryptodisk_dev function names

2022-01-01 Thread Glenn Washburn
From: Denis 'GNUtoo' Carikli Signed-off-by: Denis 'GNUtoo' Carikli Reviewed-by: Patrick Steinhardt Signed-off-by: Glenn Washburn --- grub-core/disk/luks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/disk/luks.c b/grub-core/disk/luks.c index f0feb3844..d57

[PATCH v8 3/7] cryptodisk: enable the backends to implement detached headers

2022-01-01 Thread Glenn Washburn
Signed-off-by: John Lane gnu...@cyberdimension.org: rebase, patch split, small fixes, commit message Signed-off-by: Denis 'GNUtoo' Carikli developm...@efficientek.com: rebase, rework for cryptomount parameter passing Signed-off-by: Glenn Washburn --- grub-core/disk/cryptodisk.c | 15 +++

[PATCH v8 6/7] cryptodisk: Improve cryptomount short help string

2022-01-01 Thread Glenn Washburn
Signed-off-by: Glenn Washburn --- grub-core/disk/cryptodisk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c index ea8ed20e2..319c84a6c 100644 --- a/grub-core/disk/cryptodisk.c +++ b/grub-core/disk/cryptodisk.c @@ -

[PATCH v8 2/7] cryptodisk: geli: unify grub_cryptodisk_dev function names

2022-01-01 Thread Glenn Washburn
From: Denis 'GNUtoo' Carikli Signed-off-by: Denis 'GNUtoo' Carikli Reviewed-by: Patrick Steinhardt Signed-off-by: Glenn Washburn --- grub-core/disk/geli.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/grub-core/disk/geli.c b/grub-core/disk/geli.c index 23789c43f.

[PATCH v8 5/7] cryptodisk: enable the backends to implement key files

2022-01-01 Thread Glenn Washburn
From: John Lane Signed-off-by: John Lane gnu...@cyberdimension.org: rebase, patch split, small fixes, commit message Signed-off-by: Denis 'GNUtoo' Carikli developm...@efficientek.com: rebase and rework to use cryptomount arg passing Signed-off-by: Glenn Washburn --- grub-core/disk/cryptodisk.

[PATCH v8 7/7] luks2: Add detached header support

2022-01-01 Thread Glenn Washburn
Signed-off-by: Glenn Washburn --- grub-core/disk/luks2.c | 67 ++ 1 file changed, 49 insertions(+), 18 deletions(-) diff --git a/grub-core/disk/luks2.c b/grub-core/disk/luks2.c index 567368f11..e92c28d45 100644 --- a/grub-core/disk/luks2.c +++ b/grub-core/

[PATCH v8 4/7] cryptodisk: add support for LUKS1 detached headers

2022-01-01 Thread Glenn Washburn
From: John Lane cryptsetup supports having a detached header through the --header command line argument for both LUKS1 and LUKS2. This adds support for LUKS1 detached headers. Signed-off-by: John Lane gnu...@cyberdimension.org: rebase, small fixes, commit message Signed-off-by: Denis 'GNUtoo'

[PATCH v2 01/12] grub-shell: Allow specifying non-default trim line contents

2022-01-01 Thread Glenn Washburn
This will be useful for tests that have unwanted output from setup. This is not documented because its only intended to be internal at the moment. Also, --no-trim is allowed to explicitly turn off trim. Signed-off-by: Glenn Washburn --- tests/util/grub-shell.in | 14 +- 1 file change

[PATCH v2 00/12] Grub-shell improvements

2022-01-01 Thread Glenn Washburn
Updates since v1: * Improve QEMU logging patch to make sure all data is written to the pipe before exiting (otherwise tests can fail because they don't get the last bit of QEMU output). * Improve QEMU firmware handling to prefer using the -bios option (for older setups) and prefer firmware fi

[PATCH v2 03/12] grub-shell: Only show grub-mkrescue output if it returns an error

2022-01-01 Thread Glenn Washburn
The previous behavior ignored an error and the output from grub-mkrescue. This made it a pain to discover that grub-mkrescue was the reason that tests which rely on grub-shell were failing. Even after discovering grub-mkrescue was the culprit, there was no output to indicate why it was failing. I

[PATCH v2 06/12] grub-shell: Add grub output logfile with grub-shell --debug

2022-01-01 Thread Glenn Washburn
This allows seeing full qemu output of grub-shell, which can be invaluable when debugging failing tests. Signed-off-by: Glenn Washburn --- tests/util/grub-shell.in | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in ind

[PATCH v2 02/12] grub-shell: Trim line should always be matched from the beginning of the line

2022-01-01 Thread Glenn Washburn
When turning on shell tracing the trim line will be output before we actually want to start the trim. However, in this case the trim line never starts from the beginning of the line. So start trimming from the correct line by matching from the beginning of the line. Signed-off-by: Glenn Washburn

[PATCH v2 04/12] grub-shell: Allow setting default timeout via GRUB_SHELL_DEFAULT_TIMEOUT envvar

2022-01-01 Thread Glenn Washburn
Signed-off-by: Glenn Washburn --- tests/util/grub-shell.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in index 9d8c417da..e80471126 100644 --- a/tests/util/grub-shell.in +++ b/tests/util/grub-shell.in @@ -211,7 +211,7 @@ ca

[PATCH v2 08/12] tests: Allow turning on shell tracing from environment variables

2022-01-01 Thread Glenn Washburn
This allows turning on shell tracing when its not practical or not possible to use commandline arguments. Turn on tracing when the envvar is an integer greater than 1, since these can log a lot of messages. Signed-off-by: Glenn Washburn --- tests/util/grub-fs-tester.in | 2 ++ tests/util/grub-sh

[PATCH v2 09/12] grub-shell: Add --verbose to mkrescue when $debug is greater than 2

2022-01-01 Thread Glenn Washburn
Signed-off-by: Glenn Washburn --- tests/util/grub-shell.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in index 78f27339f..eb8f43ff2 100644 --- a/tests/util/grub-shell.in +++ b/tests/util/grub-shell.in @@ -404,7 +404,9 @@

[PATCH v2 05/12] grub-shell: Put all generated files into working dir and use better file names

2022-01-01 Thread Glenn Washburn
When running tests there are many invocations of grub-shell, and because the output files are all random names in the same tmp directory, it becomes more work to figure out which files went with which grub-shell invocations. So all generated files from one invocation of grub-shell are put into a ra

[PATCH v2 12/12] grub-shell: Add flexibility in QEMU firmware handling

2022-01-01 Thread Glenn Washburn
The current qemu firmware paths for arm-efi and arm64-efi are not available on Ubuntu/Debian but are hardcoded. Switch to first looking for firmware files in the source directory and if not found, look for them in locations where Debian installs them. Prefer to use the firmware file usable with the

[PATCH v2 11/12] grub-shell: Use malta qemu-mips machine type instead off non-existant indy

2022-01-01 Thread Glenn Washburn
Signed-off-by: Glenn Washburn --- tests/util/grub-shell.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in index 180917c52..e56506444 100644 --- a/tests/util/grub-shell.in +++ b/tests/util/grub-shell.in @@ -119,7 +119,7 @@ ca

[PATCH v2 07/12] grub-shell: Set exit status to qemu exit status

2022-01-01 Thread Glenn Washburn
This allows us to test if unexpected output in test scripts is because of a bug in grub, because there was an error in qemu, or qemu was killed due to a timeout. Signed-off-by: Glenn Washburn --- tests/util/grub-shell.in | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-)

[PATCH v2 10/12] grub-shell: Only turn on qemu head when large debug value is specified

2022-01-01 Thread Glenn Washburn
There are several levels of debug and more may be added. But the qemu head should be one of the highest debug levels. Set debug to a high value of 10 to turn on the head. We do not want to accidentally turn it on when adding a new debug level to the testing system. Signed-off-by: Glenn Washburn -

[PATCH v4] misc: Allow selective disabling of debug facility names

2022-01-01 Thread Glenn Washburn
Sometimes you only know which debug logging facility names you want to turn off, not necessarily all the ones you want enabled. This patch allows the debug string to contain facility names in the $debug variable which are prefixed with a "-" to disable debug log messages for that conditional. Say y

[PATCH v8 0/7] Cryptodisk detached headers and key files

2022-01-01 Thread Maxim Fomin
‐‐‐ Original Message ‐‐‐ On Sunday, January 2nd, 2022 at 3:52 AM, Glenn Washburn wrote: > This patch series is an updated version of the v7 sent by Denis Carikli with > > modifications to reflect changes in argument passing to crypto backends. The > > previous patch #6 titled "Add suppo