Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/48265 )
Change subject: commonlib/bsd/cbfs_mcache: Fix the mcache size in cbmem ......................................................................
commonlib/bsd/cbfs_mcache: Fix the mcache size in cbmem
When copying over the mcache to cbmem the last MCACHE_MAGIC_END entry is not copied over.
When stages using mcache from cbmem look for a non existing file, it would print "CBFS mcache overflow!", which is now fixed.
Change-Id: Iec57e6a294a0cb1883c4aca94f76421efb70297d Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/commonlib/bsd/cbfs_mcache.c 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/65/48265/1
diff --git a/src/commonlib/bsd/cbfs_mcache.c b/src/commonlib/bsd/cbfs_mcache.c index d2f969d..66c702e 100644 --- a/src/commonlib/bsd/cbfs_mcache.c +++ b/src/commonlib/bsd/cbfs_mcache.c @@ -131,7 +131,7 @@ const union mcache_entry *entry = current;
if (entry->magic == MCACHE_MAGIC_FULL || entry->magic == MCACHE_MAGIC_END) { - current += sizeof(entry->magic); + current += sizeof(*entry); break; }
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48265 )
Change subject: commonlib/bsd/cbfs_mcache: Fix the mcache size in cbmem ......................................................................
Patch Set 1: Code-Review+2
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48265 )
Change subject: commonlib/bsd/cbfs_mcache: Fix the mcache size in cbmem ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/48265/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/48265/1//COMMIT_MSG@10 PS1, Line 10: is not copied over. Sorry! I guess I did all my overflow testing before the CBMEM jump and never hit this case. This patch isn't the right fix, though: the last tag is actually copied over (you can see this by dumping the cache with cbmem -r 574d5346 | od -t x1 after you booted -- if you can boot, at least).
The bug is that I checked for (end - current > sizeof(tag)) when testing if I overran the buffer, instead of (end - current >= sizeof(tag)). This is the right fix: CB:48277
Arthur Heymans has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/48265 )
Change subject: commonlib/bsd/cbfs_mcache: Fix the mcache size in cbmem ......................................................................
Abandoned