Stream: git-wasmtime

Topic: wasmtime / issue #15356 Enabling `use_csdb` on aarch64 ma...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 18 2026 at 21:17):

andrewl6097 opened issue #15356:

Description

#12932 (44.0.0) stopped emitting csdb on aarch64 by default and added the aarch64 Cranelift setting use_csdb to opt back in. docs/security.md points embedders to that setting. Enabling it, though, makes Engine::check_compatible_with_native_host reject the engine, so no module can be compiled or loaded on an aarch64 host:

compilation settings are not compatible with the native host

Caused by:
    don't know how to test for target-specific flag "use_csdb" at runtime

Engine::new succeeds. The error comes from the check that Module::new and Module::deserialize* run first. Engine::precompile_module doesn't run it, so precompiling succeeds and loading the result fails. That check returns Ok for target-specific flags that need no host support, such as use_bti and sign_return_address*, and looks up the rest in the host's CPU features. use_csdb is on neither list, so it hits the final _ arm. On 43.0.x and earlier there was no flag, and csdb was emitted whenever Spectre mitigations were on.

Steps to reproduce

On any aarch64 Linux host:

let mut config = wasmtime::Config::new();
unsafe {
    config.cranelift_flag_enable("use_csdb");
}
let engine = wasmtime::Engine::new(&config)?;
wasmtime::Module::new(&engine, "(module)")?; // fails

Versions

Affects 44.0.0 through 51.0.0-rc.1, and main at 7d316a1b6. We hit it on Amazon Linux 2 and 2023 (aarch64) with 51.0.0-rc.1.

Expected

CSDB is encoded in the hint space and runs as a NOP on CPUs that don't implement it, so, like use_bti, it needs no host detection and should be accepted.

I have a fix with a test ready and will open a PR for it. Since use_csdb is the only way to get csdb back on aarch64, could it go into 51.0.0 as well?

view this post on Zulip Wasmtime GitHub notifications bot (Nov 18 2026 at 21:33):

andrewl6097 edited issue #15356:

Description

#12932 (44.0.0) stopped emitting csdb on aarch64 by default and added the aarch64 Cranelift setting use_csdb to opt back in. docs/security.md points embedders to that setting. Enabling it, though, makes Engine::check_compatible_with_native_host reject the engine, so no module can be compiled or loaded on an aarch64 host:

compilation settings are not compatible with the native host

Caused by:
    don't know how to test for target-specific flag "use_csdb" at runtime

Engine::new succeeds. The error comes from the check that Module::new and Module::deserialize* run first. Engine::precompile_module doesn't run it, so precompiling succeeds and loading the result fails. That check returns Ok for target-specific flags that need no host support, such as use_bti and sign_return_address*, and looks up the rest in the host's CPU features. use_csdb is on neither list, so it hits the final _ arm. On 43.0.x and earlier there was no flag, and csdb was emitted whenever Spectre mitigations were on.

Steps to reproduce

On any aarch64 Linux host:

let mut config = wasmtime::Config::new();
unsafe {
    config.cranelift_flag_enable("use_csdb");
}
let engine = wasmtime::Engine::new(&config)?;
wasmtime::Module::new(&engine, "(module)")?; // fails

Versions

Affects 44.0.0 through 51.0.0-rc.1, and main at 7d316a1b6. We hit it on Amazon Linux 2 and 2023 (aarch64) with 51.0.0-rc.1.

Expected

CSDB is encoded in the hint space and runs as a NOP on CPUs that don't implement it, so, like use_bti, it needs no host detection and should be accepted.

I have a fix with a test ready and have opened the PR https://github.com/bytecodealliance/wasmtime/pull/15357 . Since use_csdb is the only way to get csdb back on aarch64, could it go into 51.0.0 as well?

view this post on Zulip Wasmtime GitHub notifications bot (Nov 18 2026 at 21:33):

andrewl6097 edited issue #15356:

Description

#12932 (44.0.0) stopped emitting csdb on aarch64 by default and added the aarch64 Cranelift setting use_csdb to opt back in. docs/security.md points embedders to that setting. Enabling it, though, makes Engine::check_compatible_with_native_host reject the engine, so no module can be compiled or loaded on an aarch64 host:

compilation settings are not compatible with the native host

Caused by:
    don't know how to test for target-specific flag "use_csdb" at runtime

Engine::new succeeds. The error comes from the check that Module::new and Module::deserialize* run first. Engine::precompile_module doesn't run it, so precompiling succeeds and loading the result fails. That check returns Ok for target-specific flags that need no host support, such as use_bti and sign_return_address*, and looks up the rest in the host's CPU features. use_csdb is on neither list, so it hits the final _ arm. On 43.0.x and earlier there was no flag, and csdb was emitted whenever Spectre mitigations were on.

Steps to reproduce

On any aarch64 Linux host:

let mut config = wasmtime::Config::new();
unsafe {
    config.cranelift_flag_enable("use_csdb");
}
let engine = wasmtime::Engine::new(&config)?;
wasmtime::Module::new(&engine, "(module)")?; // fails

Versions

Affects 44.0.0 through 51.0.0-rc.1, and main at 7d316a1b6. We hit it on Amazon Linux 2 and 2023 (aarch64) with 51.0.0-rc.1.

Expected

CSDB is encoded in the hint space and runs as a NOP on CPUs that don't implement it, so, like use_bti, it needs no host detection and should be accepted.

I have a fix with a test ready and have opened the PR https://github.com/bytecodealliance/wasmtime/pull/15357

view this post on Zulip Wasmtime GitHub notifications bot (Nov 18 2026 at 22:13):

cfallin closed issue #15356:

Description

#12932 (44.0.0) stopped emitting csdb on aarch64 by default and added the aarch64 Cranelift setting use_csdb to opt back in. docs/security.md points embedders to that setting. Enabling it, though, makes Engine::check_compatible_with_native_host reject the engine, so no module can be compiled or loaded on an aarch64 host:

compilation settings are not compatible with the native host

Caused by:
    don't know how to test for target-specific flag "use_csdb" at runtime

Engine::new succeeds. The error comes from the check that Module::new and Module::deserialize* run first. Engine::precompile_module doesn't run it, so precompiling succeeds and loading the result fails. That check returns Ok for target-specific flags that need no host support, such as use_bti and sign_return_address*, and looks up the rest in the host's CPU features. use_csdb is on neither list, so it hits the final _ arm. On 43.0.x and earlier there was no flag, and csdb was emitted whenever Spectre mitigations were on.

Steps to reproduce

On any aarch64 Linux host:

let mut config = wasmtime::Config::new();
unsafe {
    config.cranelift_flag_enable("use_csdb");
}
let engine = wasmtime::Engine::new(&config)?;
wasmtime::Module::new(&engine, "(module)")?; // fails

Versions

Affects 44.0.0 through 51.0.0-rc.1, and main at 7d316a1b6. We hit it on Amazon Linux 2 and 2023 (aarch64) with 51.0.0-rc.1.

Expected

CSDB is encoded in the hint space and runs as a NOP on CPUs that don't implement it, so, like use_bti, it needs no host detection and should be accepted.

I have a fix with a test ready and have opened the PR https://github.com/bytecodealliance/wasmtime/pull/15357


Last updated: Nov 19 2026 at 20:05 UTC