Hello Furquan Shaikh, Patrick Georgi, Angel Pons, Arthur Heymans,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/48482
to look at the new patch set (#2).
Change subject: cbfs: Allow mcache to be found after the first lookup ......................................................................
cbfs: Allow mcache to be found after the first lookup
This patch addresses the same problem as CB:48429, but hopefully this time correctly. Since the mcache is not guaranteed to be available on the first CBFS lookup for some special cases, we can no longer treat it as a one-time fire-and-forget initialization. Instead, we test cbd->mcache_size to check if the mcache has been initialized yet, and keep trying on every lookup if we don't find it the first time.
Since the mcache is a hard requirement for TOCTOU safety, also make it more clear in Kconfig that configurations known to do CBFS accesses before CBMEM init are incompatbile with that, and make sure we die() rather than do something unsafe if there's a case that Kconfig didn't catch.
Signed-off-by: Julius Werner jwerner@chromium.org Change-Id: I4e01e9a9905f7dcba14eaf05168495201ed5de60 --- M src/lib/Kconfig.cbfs_verification M src/lib/cbfs.c 2 files changed, 12 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/82/48482/2