From cfffb62ad2cbe217dd7ec122a3b7a16aac236997 Mon Sep 17 00:00:00 2001 From: "liang.he" Date: Mon, 24 Jun 2024 10:34:03 +0800 Subject: [PATCH] aot loader: Verify global value type (#3560) Fix issue reported by Oss-fuzz test (#69798). https://oss-fuzz.com/testcase-detail/5963842371256320 --- core/iwasm/aot/aot_loader.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/iwasm/aot/aot_loader.c b/core/iwasm/aot/aot_loader.c index 010019326..14b7a0464 100644 --- a/core/iwasm/aot/aot_loader.c +++ b/core/iwasm/aot/aot_loader.c @@ -2170,6 +2170,9 @@ load_globals(const uint8 **p_buf, const uint8 *buf_end, AOTModule *module, read_uint8(buf, buf_end, globals[i].type.val_type); read_uint8(buf, buf_end, globals[i].type.is_mutable); + if (!is_valid_value_type(globals[i].type.val_type)) + return false; + buf = align_ptr(buf, 4); if (!load_init_expr(&buf, buf_end, module, &globals[i].init_expr,