Skip to content

Commit 95559c0

Browse files
authored
Merge pull request from GHSA-hpqh-2wqx-7qp5
Fix spillslot reload of narrow values: zero-extend, don't sign-extend. Release v0.74.0 as security-patch release.
2 parents 0f5bdc6 + 8845500 commit 95559c0

File tree

60 files changed

+372
-264
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+372
-264
lines changed

Cargo.lock

Lines changed: 51 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "wasmtime-cli"
3-
version = "0.26.0"
3+
version = "0.27.0"
44
authors = ["The Wasmtime Project Developers"]
55
description = "Command-line interface for Wasmtime"
66
license = "Apache-2.0 WITH LLVM-exception"
@@ -22,16 +22,16 @@ doc = false
2222

2323
[dependencies]
2424
# Enable all supported architectures by default.
25-
wasmtime = { path = "crates/wasmtime", version = "0.26.0", default-features = false, features = ['cache'] }
26-
wasmtime-cache = { path = "crates/cache", version = "0.26.0" }
27-
wasmtime-debug = { path = "crates/debug", version = "0.26.0" }
28-
wasmtime-environ = { path = "crates/environ", version = "0.26.0" }
29-
wasmtime-jit = { path = "crates/jit", version = "0.26.0" }
30-
wasmtime-obj = { path = "crates/obj", version = "0.26.0" }
31-
wasmtime-wast = { path = "crates/wast", version = "0.26.0" }
32-
wasmtime-wasi = { path = "crates/wasi", version = "0.26.0" }
33-
wasmtime-wasi-crypto = { path = "crates/wasi-crypto", version = "0.26.0", optional = true }
34-
wasmtime-wasi-nn = { path = "crates/wasi-nn", version = "0.26.0", optional = true }
25+
wasmtime = { path = "crates/wasmtime", version = "0.27.0", default-features = false, features = ['cache'] }
26+
wasmtime-cache = { path = "crates/cache", version = "0.27.0" }
27+
wasmtime-debug = { path = "crates/debug", version = "0.27.0" }
28+
wasmtime-environ = { path = "crates/environ", version = "0.27.0" }
29+
wasmtime-jit = { path = "crates/jit", version = "0.27.0" }
30+
wasmtime-obj = { path = "crates/obj", version = "0.27.0" }
31+
wasmtime-wast = { path = "crates/wast", version = "0.27.0" }
32+
wasmtime-wasi = { path = "crates/wasi", version = "0.27.0" }
33+
wasmtime-wasi-crypto = { path = "crates/wasi-crypto", version = "0.27.0", optional = true }
34+
wasmtime-wasi-nn = { path = "crates/wasi-nn", version = "0.27.0", optional = true }
3535
structopt = { version = "0.3.5", features = ["color", "suggestions"] }
3636
object = { version = "0.24.0", default-features = false, features = ["write"] }
3737
anyhow = "1.0.19"

RELEASES.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,88 @@
44

55
## Unreleased
66

7+
## 0.27.0
8+
9+
Released 2021-05-21.
10+
11+
### Security Fixes
12+
13+
* Fixed a security issue in Cranelift's x64 backend that could result in a heap
14+
sandbox escape due to an incorrect sign-extension:
15+
[#2913](https://github.com/bytecodealliance/wasmtime/issues/2913).
16+
717
### Added
818

19+
* Support for IBM z/Archiecture (`s390x`) machines in Cranelift and Wasmtime:
20+
[#2836](https://github.com/bytecodealliance/wasmtime/pull/2836),
21+
[#2837](https://github.com/bytecodealliance/wasmtime/pull/2837),
22+
[#2838](https://github.com/bytecodealliance/wasmtime/pull/2838),
23+
[#2843](https://github.com/bytecodealliance/wasmtime/pull/2843),
24+
[#2854](https://github.com/bytecodealliance/wasmtime/pull/2854),
25+
[#2870](https://github.com/bytecodealliance/wasmtime/pull/2870),
26+
[#2871](https://github.com/bytecodealliance/wasmtime/pull/2871),
27+
[#2872](https://github.com/bytecodealliance/wasmtime/pull/2872),
28+
[#2874](https://github.com/bytecodealliance/wasmtime/pull/2874).
29+
30+
* Improved async support in wasi-common runtime:
31+
[#2832](https://github.com/bytecodealliance/wasmtime/pull/2832).
32+
933
* Added `Store::with_limits`, `StoreLimits`, and `ResourceLimiter` to the
1034
Wasmtime API to help with enforcing resource limits at runtime. The
1135
`ResourceLimiter` trait can be implemented by custom resource limiters to
1236
decide if linear memories or tables can be grown.
1337

38+
* Added `allow-unknown-exports` option for the run command:
39+
[#2879](https://github.com/bytecodealliance/wasmtime/pull/2879).
40+
41+
* Added API to notify that a `Store` has moved to a new thread:
42+
[#2822](https://github.com/bytecodealliance/wasmtime/pull/2822).
43+
44+
* Documented guidance around using Wasmtime in multithreaded contexts:
45+
[#2812](https://github.com/bytecodealliance/wasmtime/pull/2812).
46+
In the future, the Wasmtime API will change to allow some of its core types
47+
to be Send/Sync; see the in-progress
48+
[#2897](https://github.com/bytecodealliance/wasmtime/pull/2897) for details.
49+
50+
* Support calls from native code to multiple-return-value functions:
51+
[#2806](https://github.com/bytecodealliance/wasmtime/pull/2806).
52+
1453
### Changed
1554

1655
* Breaking: `Memory::new` has been changed to return `Result` as creating a
1756
host memory object is now a fallible operation when the initial size of
1857
the memory exceeds the store limits.
1958

59+
### Fixed
60+
61+
* Many instruction selection improvements on x64 and aarch64:
62+
[#2819](https://github.com/bytecodealliance/wasmtime/pull/2819),
63+
[#2828](https://github.com/bytecodealliance/wasmtime/pull/2828),
64+
[#2823](https://github.com/bytecodealliance/wasmtime/pull/2823),
65+
[#2862](https://github.com/bytecodealliance/wasmtime/pull/2862),
66+
[#2886](https://github.com/bytecodealliance/wasmtime/pull/2886),
67+
[#2889](https://github.com/bytecodealliance/wasmtime/pull/2889),
68+
[#2905](https://github.com/bytecodealliance/wasmtime/pull/2905).
69+
70+
* Improved performance of Wasmtime runtime substantially:
71+
[#2811](https://github.com/bytecodealliance/wasmtime/pull/2811),
72+
[#2818](https://github.com/bytecodealliance/wasmtime/pull/2818),
73+
[#2821](https://github.com/bytecodealliance/wasmtime/pull/2821),
74+
[#2847](https://github.com/bytecodealliance/wasmtime/pull/2847),
75+
[#2900](https://github.com/bytecodealliance/wasmtime/pull/2900).
76+
77+
* Fixed WASI issue with file metadata on Windows:
78+
[#2884](https://github.com/bytecodealliance/wasmtime/pull/2884).
79+
80+
* Fixed an issue with debug info and an underflowing (trapping) offset:
81+
[#2866](https://github.com/bytecodealliance/wasmtime/pull/2866).
82+
83+
* Fixed an issue with unwind information in the old x86 backend:
84+
[#2845](https://github.com/bytecodealliance/wasmtime/pull/2845).
85+
86+
* Fixed i32 spilling in x64 backend:
87+
[#2840](https://github.com/bytecodealliance/wasmtime/pull/2840).
88+
2089
## 0.26.0
2190

2291
Released 2021-04-05.

cranelift/Cargo.toml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,27 @@ path = "src/clif-util.rs"
1515

1616
[dependencies]
1717
cfg-if = "1.0"
18-
cranelift-codegen = { path = "codegen", version = "0.73.0" }
19-
cranelift-entity = { path = "entity", version = "0.73.0" }
20-
cranelift-interpreter = { path = "interpreter", version = "0.73.0" }
21-
cranelift-reader = { path = "reader", version = "0.73.0" }
22-
cranelift-frontend = { path = "frontend", version = "0.73.0" }
23-
cranelift-serde = { path = "serde", version = "0.73.0", optional = true }
24-
cranelift-wasm = { path = "wasm", version = "0.73.0", optional = true }
25-
cranelift-native = { path = "native", version = "0.73.0" }
18+
cranelift-codegen = { path = "codegen", version = "0.74.0" }
19+
cranelift-entity = { path = "entity", version = "0.74.0" }
20+
cranelift-interpreter = { path = "interpreter", version = "0.74.0" }
21+
cranelift-reader = { path = "reader", version = "0.74.0" }
22+
cranelift-frontend = { path = "frontend", version = "0.74.0" }
23+
cranelift-serde = { path = "serde", version = "0.74.0", optional = true }
24+
cranelift-wasm = { path = "wasm", version = "0.74.0", optional = true }
25+
cranelift-native = { path = "native", version = "0.74.0" }
2626
cranelift-filetests = { path = "filetests", version = "0.73.0" }
27-
cranelift-module = { path = "module", version = "0.73.0" }
28-
cranelift-object = { path = "object", version = "0.73.0" }
29-
cranelift-jit = { path = "jit", version = "0.73.0" }
30-
cranelift-preopt = { path = "preopt", version = "0.73.0" }
31-
cranelift = { path = "umbrella", version = "0.73.0" }
27+
cranelift-module = { path = "module", version = "0.74.0" }
28+
cranelift-object = { path = "object", version = "0.74.0" }
29+
cranelift-jit = { path = "jit", version = "0.74.0" }
30+
cranelift-preopt = { path = "preopt", version = "0.74.0" }
31+
cranelift = { path = "umbrella", version = "0.74.0" }
3232
filecheck = "0.5.0"
3333
log = "0.4.8"
3434
termcolor = "1.1.2"
3535
capstone = { version = "0.7.0", optional = true }
3636
wat = { version = "1.0.36", optional = true }
3737
target-lexicon = { version = "0.12", features = ["std"] }
38-
peepmatic-souper = { path = "./peepmatic/crates/souper", version = "0.73.0", optional = true }
38+
peepmatic-souper = { path = "./peepmatic/crates/souper", version = "0.74.0", optional = true }
3939
pretty_env_logger = "0.4.0"
4040
rayon = { version = "1", optional = true }
4141
file-per-thread-logger = "0.1.2"

cranelift/bforest/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
authors = ["The Cranelift Project Developers"]
33
name = "cranelift-bforest"
4-
version = "0.73.0"
4+
version = "0.74.0"
55
description = "A forest of B+-trees"
66
license = "Apache-2.0 WITH LLVM-exception"
77
documentation = "https://docs.rs/cranelift-bforest"
@@ -12,7 +12,7 @@ keywords = ["btree", "forest", "set", "map"]
1212
edition = "2018"
1313

1414
[dependencies]
15-
cranelift-entity = { path = "../entity", version = "0.73.0", default-features = false }
15+
cranelift-entity = { path = "../entity", version = "0.74.0", default-features = false }
1616

1717
[badges]
1818
maintenance = { status = "experimental" }

cranelift/codegen/Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
authors = ["The Cranelift Project Developers"]
33
name = "cranelift-codegen"
4-
version = "0.73.0"
4+
version = "0.74.0"
55
description = "Low-level code generator library"
66
license = "Apache-2.0 WITH LLVM-exception"
77
documentation = "https://docs.rs/cranelift-codegen"
@@ -13,19 +13,19 @@ build = "build.rs"
1313
edition = "2018"
1414

1515
[dependencies]
16-
cranelift-codegen-shared = { path = "./shared", version = "0.73.0" }
17-
cranelift-entity = { path = "../entity", version = "0.73.0" }
18-
cranelift-bforest = { path = "../bforest", version = "0.73.0" }
16+
cranelift-codegen-shared = { path = "./shared", version = "0.74.0" }
17+
cranelift-entity = { path = "../entity", version = "0.74.0" }
18+
cranelift-bforest = { path = "../bforest", version = "0.74.0" }
1919
hashbrown = { version = "0.9.1", optional = true }
2020
target-lexicon = "0.12"
2121
log = { version = "0.4.6", default-features = false }
2222
serde = { version = "1.0.94", features = ["derive"], optional = true }
2323
bincode = { version = "1.2.1", optional = true }
2424
gimli = { version = "0.24.0", default-features = false, features = ["write"], optional = true }
2525
smallvec = { version = "1.6.1" }
26-
peepmatic = { path = "../peepmatic", optional = true, version = "0.73.0" }
27-
peepmatic-traits = { path = "../peepmatic/crates/traits", optional = true, version = "0.73.0" }
28-
peepmatic-runtime = { path = "../peepmatic/crates/runtime", optional = true, version = "0.73.0" }
26+
peepmatic = { path = "../peepmatic", optional = true, version = "0.74.0" }
27+
peepmatic-traits = { path = "../peepmatic/crates/traits", optional = true, version = "0.74.0" }
28+
peepmatic-runtime = { path = "../peepmatic/crates/runtime", optional = true, version = "0.74.0" }
2929
regalloc = { version = "0.0.31" }
3030
souper-ir = { version = "2.1.0", optional = true }
3131
wast = { version = "35.0.0", optional = true }
@@ -38,7 +38,7 @@ wast = { version = "35.0.0", optional = true }
3838
criterion = "0.3"
3939

4040
[build-dependencies]
41-
cranelift-codegen-meta = { path = "meta", version = "0.73.0" }
41+
cranelift-codegen-meta = { path = "meta", version = "0.74.0" }
4242

4343
[features]
4444
default = ["std", "unwind"]

cranelift/codegen/meta/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "cranelift-codegen-meta"
33
authors = ["The Cranelift Project Developers"]
4-
version = "0.73.0"
4+
version = "0.74.0"
55
description = "Metaprogram for cranelift-codegen code generator library"
66
license = "Apache-2.0 WITH LLVM-exception"
77
repository = "https://github.com/bytecodealliance/wasmtime"
@@ -13,8 +13,8 @@ edition = "2018"
1313
# rustdoc-args = [ "--document-private-items" ]
1414

1515
[dependencies]
16-
cranelift-codegen-shared = { path = "../shared", version = "0.73.0" }
17-
cranelift-entity = { path = "../../entity", version = "0.73.0" }
16+
cranelift-codegen-shared = { path = "../shared", version = "0.74.0" }
17+
cranelift-entity = { path = "../../entity", version = "0.74.0" }
1818

1919
[badges]
2020
maintenance = { status = "experimental" }

cranelift/codegen/shared/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
authors = ["The Cranelift Project Developers"]
33
name = "cranelift-codegen-shared"
4-
version = "0.73.0"
4+
version = "0.74.0"
55
description = "For code shared between cranelift-codegen-meta and cranelift-codegen"
66
license = "Apache-2.0 WITH LLVM-exception"
77
repository = "https://github.com/bytecodealliance/wasmtime"

cranelift/codegen/src/isa/x64/abi.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,19 +317,19 @@ impl ABIMachineSpec for X64ABIMachineSpec {
317317
}
318318

319319
fn gen_load_stack(mem: StackAMode, into_reg: Writable<Reg>, ty: Type) -> Self::I {
320-
let ext_kind = match ty {
320+
// For integer-typed values, we always load a full 64 bits (and we always spill a full 64
321+
// bits as well -- see `Inst::store()`).
322+
let ty = match ty {
321323
types::B1
322324
| types::B8
323325
| types::I8
324326
| types::B16
325327
| types::I16
326328
| types::B32
327-
| types::I32 => ExtKind::SignExtend,
328-
types::B64 | types::I64 | types::R64 | types::F32 | types::F64 => ExtKind::None,
329-
_ if ty.bytes() == 16 => ExtKind::None,
330-
_ => panic!("load_stack({})", ty),
329+
| types::I32 => types::I64,
330+
_ => ty,
331331
};
332-
Inst::load(ty, mem, into_reg, ext_kind)
332+
Inst::load(ty, mem, into_reg, ExtKind::None)
333333
}
334334

335335
fn gen_store_stack(mem: StackAMode, from_reg: Reg, ty: Type) -> Self::I {

cranelift/codegen/src/isa/x64/inst/args.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,7 @@ impl fmt::Display for Avx512Opcode {
10381038
/// This defines the ways a value can be extended: either signed- or zero-extension, or none for
10391039
/// types that are not extended. Contrast with [ExtMode], which defines the widths from and to which
10401040
/// values can be extended.
1041+
#[allow(dead_code)]
10411042
#[derive(Clone, PartialEq)]
10421043
pub enum ExtKind {
10431044
None,

0 commit comments

Comments
 (0)