From: Andreas Reichel <[email protected]> Code was wrong in trying to boot if additional config partitions are added to the system. This can result in unwanted behavior. If less are detected, try to boot, but if more are detected, stop.
Signed-off-by: Andreas Reichel <[email protected]> --- env/fatvars.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/env/fatvars.c b/env/fatvars.c index 4b87f55..bbff777 100644 --- a/env/fatvars.c +++ b/env/fatvars.c @@ -105,13 +105,18 @@ BG_STATUS load_config(BG_LOADER_PARAMS *bglp) return BG_CONFIG_ERROR; } - if (numHandles != ENV_NUM_CONFIG_PARTS) { - Print(L"Warning, unexpected number of config partitions: found " + if (numHandles > ENV_NUM_CONFIG_PARTS) { + Print(L"Error, too many config partitions found. Aborting.\n"); + mfree(roots); + return BG_CONFIG_ERROR; + } + + if (numHandles < ENV_NUM_CONFIG_PARTS) { + Print(L"Warning, too few config partitions: found: " L"%d, but expected %d.\n", numHandles, ENV_NUM_CONFIG_PARTS); /* Don't treat this as error because we may still be able to - * find a - * valid config */ + * find a valid config */ result = BG_CONFIG_PARTIALLY_CORRUPTED; } -- 2.17.0 -- You received this message because you are subscribed to the Google Groups "EFI Boot Guard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/efibootguard-dev/20180525120108.31055-8-andreas.reichel.ext%40siemens.com. For more options, visit https://groups.google.com/d/optout.
