From 67254214930cd2cb52279b01690c1f820a7f83db Mon Sep 17 00:00:00 2001 From: Raymond Mao Date: Sat, 3 Feb 2024 08:36:21 -0800 Subject: bloblist: check bloblist with specified buffer size Instead of expecting the bloblist total size to be the same as the pre-allocated buffer size, practically we are more interested in whether the pre-allocated buffer size is bigger than the bloblist total size. Signed-off-by: Raymond Mao Reviewed-by: Ilias Apalodimas --- common/bloblist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common/bloblist.c') diff --git a/common/bloblist.c b/common/bloblist.c index 980b1ddbcb4..26b0ba33b11 100644 --- a/common/bloblist.c +++ b/common/bloblist.c @@ -384,7 +384,7 @@ int bloblist_check(ulong addr, uint size) return log_msg_ret("Bad magic", -ENOENT); if (hdr->version != BLOBLIST_VERSION) return log_msg_ret("Bad version", -EPROTONOSUPPORT); - if (!hdr->total_size || (size && hdr->total_size != size)) + if (!hdr->total_size || (size && hdr->total_size > size)) return log_msg_ret("Bad total size", -EFBIG); if (hdr->used_size > hdr->total_size) return log_msg_ret("Bad used size", -ENOENT); -- cgit v1.2.3