From fa8a80a1152504c54c6cec698f933a29f5c24638 Mon Sep 17 00:00:00 2001 From: "liang.he" Date: Tue, 18 Jun 2024 15:31:39 +0800 Subject: [PATCH] aot loader: Prevent loading multiple native symbol sections (#3538) Don't allow to load multiple native symbol sections in aot loader since the aot compiler will create only one native symbol section. Fix issue reported by Oss-fuzz test (#69633). --- core/iwasm/aot/aot_loader.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/iwasm/aot/aot_loader.c b/core/iwasm/aot/aot_loader.c index 1fe0925d..e61c7909 100644 --- a/core/iwasm/aot/aot_loader.c +++ b/core/iwasm/aot/aot_loader.c @@ -651,6 +651,12 @@ load_native_symbol_section(const uint8 *buf, const uint8 *buf_end, int32 i; const char *symbol; + if (module->native_symbol_list) { + set_error_buf(error_buf, error_buf_size, + "duplicated native symbol section"); + return false; + } + read_uint32(p, p_end, cnt); if (cnt > 0) {