From 932eb5d9e5be01e812d8783d60ce6984f39014be Mon Sep 17 00:00:00 2001 From: TianlongLiang <111852609+TianlongLiang@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:26:34 +0800 Subject: [PATCH] Only access Zephyr thread stats info when it's available (#3962) --- core/shared/platform/zephyr/zephyr_time.c | 6 ++++++ product-mini/platforms/zephyr/simple/build_and_run.sh | 2 +- tests/fuzz/wasm-mutator-fuzz/portal/osv-scanner.toml | 7 +++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/core/shared/platform/zephyr/zephyr_time.c b/core/shared/platform/zephyr/zephyr_time.c index 59b720e41..5b8405737 100644 --- a/core/shared/platform/zephyr/zephyr_time.c +++ b/core/shared/platform/zephyr/zephyr_time.c @@ -14,6 +14,9 @@ os_time_get_boot_us() uint64 os_time_thread_cputime_us(void) { + /* On certain boards, enabling userspace could impact the collection of + * thread runtime statistics */ +#ifdef CONFIG_THREAD_RUNTIME_STATS k_tid_t tid; struct k_thread_runtime_stats stats; uint32 clock_freq; @@ -27,4 +30,7 @@ os_time_thread_cputime_us(void) } return time_in_us; +#else + return os_time_get_boot_us(); +#endif } diff --git a/product-mini/platforms/zephyr/simple/build_and_run.sh b/product-mini/platforms/zephyr/simple/build_and_run.sh index 6b8fb4f87..bd89906d4 100755 --- a/product-mini/platforms/zephyr/simple/build_and_run.sh +++ b/product-mini/platforms/zephyr/simple/build_and_run.sh @@ -38,7 +38,7 @@ TARGET=$1 case $TARGET in $X86_TARGET) - west build -b qemu_x86_nommu \ + west build -b qemu_x86_tiny \ . -p always -- \ -DWAMR_BUILD_TARGET=X86_32 west build -t run diff --git a/tests/fuzz/wasm-mutator-fuzz/portal/osv-scanner.toml b/tests/fuzz/wasm-mutator-fuzz/portal/osv-scanner.toml index 1eb55cd8d..b1b7145de 100644 --- a/tests/fuzz/wasm-mutator-fuzz/portal/osv-scanner.toml +++ b/tests/fuzz/wasm-mutator-fuzz/portal/osv-scanner.toml @@ -50,3 +50,10 @@ name = "vite" ecosystem = "npm" ignore = true reason = "Development server not exposed to untrusted networks" + +# GHSA-mwcw-c2x4-8c55 +[[PackageOverrides]] +name = "nanoid" +ecosystem = "npm" +ignore = true +reason = "Accepted known vulnerabilities for testing purposes"