Package: libefibootguard Version: 0.15-1
Dear maintainers, When opening and closing a context within libefibootguard, the bootloader config gets corrupted, inhibiting further boots of the system. Context: We are using efibootguard in context of isar-cip-core with A/B partitioning scheme: Partition 1 - efibootguard Partition 2 - efibootguard config A Partition 3 - efibootguard config B After software update, we need to know if the bootloader is in testing mode so that we can trigger a rollback. For this, we need to call ebg_env_getglobalstate which is taking a pointer provided by ebg_env_open_current. Code: ebgenv_t e; ebg_env_open_current(&e); // seems that closing is not really needed, no leaks found. uint16_t ustate = ebg_env_getglobalstate(NULL); //ebg_env_close(&e); not closing it beacuse it writes & breaks printf("obtained ustate is %u\n", ustate); if (ustate == 2 /*testing mode */) { return 0; } else { return -1; } Expected Behaviour: efibootguad configs (on partition 2 and 3) should not get corrupted. Possible Solution/Workaround: We are now calling ebg_env_getglobalstate with NULL as a parameter as, looking at the code, it is not used anyway. So we don't need to do open/close. Steps to reproduce: 1. Do ebg_env_open_current and ebg_env_close in a loop and interrupt it with CTRL-C 2. check config with bg_printenv 3. one config is set to all (most) zeros. Works mostly on first attempt, retry loop if needed. We can work for now, but this should be fixed in the future. Thanks, Bjoern -- 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 efibootguard-dev+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/efibootguard-dev/AS4PR10MB5149D8CE5D89B46A73A99902FAC52%40AS4PR10MB5149.EURPRD10.PROD.OUTLOOK.COM.