Skip to content

Commit a893277

Browse files
authored
Merge pull request #5533 from microsoft/joslobo/merge-from-main-to-fix-nodejs
Merge from main to fix nodejs build break on ARM64
2 parents da03d0b + 768dc42 commit a893277

File tree

5 files changed

+98
-21
lines changed

5 files changed

+98
-21
lines changed

SPECS/chrony/chrony.spec

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Name: chrony
66
Version: 4.1
7-
Release: 1%{?dist}
7+
Release: 2%{?dist}
88
Summary: An NTP client/server
99
Vendor: Microsoft Corporation
1010
Distribution: Mariner
@@ -151,7 +151,7 @@ install -m 755 -p %{SOURCE4} $RPM_BUILD_ROOT%{_libexecdir}/chrony-helper
151151

152152
cat > $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/chronyd <<EOF
153153
# Command-line options for chronyd
154-
OPTIONS=""
154+
OPTIONS="-u chrony"
155155
EOF
156156

157157
touch $RPM_BUILD_ROOT%{_localstatedir}/lib/chrony/{drift,rtc}
@@ -206,6 +206,9 @@ systemctl start chronyd.service
206206
%dir %attr(-,chrony,chrony) %{_localstatedir}/log/chrony
207207

208208
%changelog
209+
* Thu May 18 2023 Tobias Brick <[email protected]> - 4.1-2
210+
- Explicitly run chronyd as the user chrony
211+
209212
* Mon Mar 07 2022 Andrew Phelps <[email protected]> - 4.1-1
210213
- Upgrade to version 4.1
211214

SPECS/nodejs/nodejs.spec

+2-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Name: nodejs
66
# WARNINGS: MUST check and update the 'npm_version' macro for every version update of this package.
77
# The version of NPM can be found inside the sources under 'deps/npm/package.json'.
88
Version: 16.19.1
9-
Release: 2%{?dist}
9+
Release: 1%{?dist}
1010
License: BSD and MIT and Public Domain and NAIST-2003 and Artistic-2.0
1111
Group: Applications/System
1212
Vendor: Microsoft Corporation
@@ -80,10 +80,7 @@ python3 configure.py \
8080
--without-dtrace \
8181
--openssl-use-def-ca-store
8282

83-
# Some build scripts expect a "python" executable - create symlink to python3
84-
ln -sv /usr/bin/python3 /usr/bin/python
85-
86-
%ninja_build -C out/Release
83+
JOBS=4 make %{?_smp_mflags} V=0
8784

8885
%install
8986

@@ -117,9 +114,6 @@ make cctest
117114
%{_datadir}/systemtap/tapset/node.stp
118115

119116
%changelog
120-
* Thu May 04 2023 Andrew Phelps <[email protected]> - 16.19.1-2
121-
- Speed up compilation by using ninja build system
122-
123117
* Wed Mar 01 2023 CBL-Mariner Servicing Account <[email protected]> - 16.19.1-1
124118
- Auto-upgrade to 16.19.1 - to fix CVE-2023-23936
125119
- Update npm version to 8.19.3 to reflect the actual version of npm bundled with v16.19.1

SPECS/nodejs/nodejs18.spec

+2-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Name: nodejs18
66
# WARNINGS: MUST check and update the 'npm_version' macro for every version update of this package.
77
# The version of NPM can be found inside the sources under 'deps/npm/package.json'.
88
Version: 18.16.0
9-
Release: 2%{?dist}
9+
Release: 1%{?dist}
1010
License: BSD and MIT and Public Domain and NAIST-2003 and Artistic-2.0
1111
Group: Applications/System
1212
Vendor: Microsoft Corporation
@@ -80,10 +80,7 @@ python3 configure.py \
8080
--without-dtrace \
8181
--openssl-use-def-ca-store
8282

83-
# Some build scripts expect a "python" executable - create symlink to python3
84-
ln -sv /usr/bin/python3 /usr/bin/python
85-
86-
%ninja_build -C out/Release
83+
JOBS=4 make %{?_smp_mflags} V=0
8784

8885
%install
8986

@@ -117,9 +114,6 @@ make cctest
117114
%{_datadir}/systemtap/tapset/node.stp
118115

119116
%changelog
120-
* Thu May 04 2023 Andrew Phelps <[email protected]> - 18.16.0-2
121-
- Speed up compilation by using ninja build system
122-
123117
* Wed Apr 12 2023 Riken Maharjan <[email protected]> - 18.16.0-1
124118
- Upgrade to 18.16.0
125119

SPECS/rust/CVE-2023-27477.patch

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
Fixes CVE-2023-27477: https://nvd.nist.gov/vuln/detail/CVE-2023-27477, which is a
2+
vulnerability in cranelift that is exposed in rust.
3+
4+
Adapted by [email protected] from patch to wasmtime/cranelift:
5+
https://github.com/bytecodealliance/wasmtime/commit/5dc2bbccbb363e474d2c9a1b8e38a89a43bbd5d1.
6+
7+
From 5dc2bbccbb363e474d2c9a1b8e38a89a43bbd5d1 Mon Sep 17 00:00:00 2001
8+
From: <redacted>
9+
Date: Wed, 8 Mar 2023 13:00:00 -0600
10+
Subject: [PATCH] Merge pull request from GHSA-xm67-587q-r2vw
11+
12+
This commit fixes an off-by-one error in the subtraction of indices when
13+
shuffling a vector with itself. Lanes 16-and-above are mapped to select
14+
from the first vector since the first and second element are the same,
15+
but the subtraction was with 15 rather than 16 by accident.
16+
---
17+
PATCH NOTE -- ORIGINAL:
18+
cranelift/codegen/src/isa/x64/lower/isle.rs | 2 +-
19+
PATCH NOTE -- UPDATED:
20+
vendor/cranelift-codegen/src/isa/x64/lower/isle.rs | 2 +-
21+
22+
PATCH NOTE: These clif files are not included in the rust source, so they are not included in the patch.
23+
.../filetests/isa/x64/simd-lane-access-compile.clif | 3 ++-
24+
cranelift/filetests/filetests/runtests/simd-shuffle.clif | 7 +++++++
25+
26+
PATCH NOTE -- ORIGINAL:
27+
3 files changed, 10 insertions(+), 2 deletions(-)
28+
PATCH NOTE -- UPDATED:
29+
1 file changed, 1 insertion(+), 1 deletion(-)
30+
31+
# PATCH NOTE -- ORIGINAL:
32+
#diff --git a/cranelift/codegen/src/isa/x64/lower/isle.rs b/cranelift/codegen/src/isa/x64/lower/isle.rs
33+
# PATCH NOTE: UPDATED with path used within rust source:
34+
diff --git a/vendor/cranelift-codegen/src/isa/x64/lower/isle.rs b/vendor/cranelift-codegen/src/isa/x64/lower/isle.rs
35+
36+
index 0267c3d32ce..61be54a0052 100644
37+
# PATCH NOTE -- ORIGINAL:
38+
#--- a/cranelift/codegen/src/isa/x64/lower/isle.rs
39+
#+++ b/cranelift/codegen/src/isa/x64/lower/isle.rs
40+
# PATCH NOTE: UPDATED with path used within rust source:
41+
--- a/vendor/cranelift-codegen/src/isa/x64/lower/isle.rs
42+
+++ b/vendor/cranelift-codegen/src/isa/x64/lower/isle.rs
43+
@@ -752,7 +752,7 @@ impl Context for IsleContext<'_, '_, MInst, X64Backend> {
44+
fn shuffle_0_31_mask(&mut self, mask: &VecMask) -> VCodeConstant {
45+
let mask = mask
46+
.iter()
47+
- .map(|&b| if b > 15 { b.wrapping_sub(15) } else { b })
48+
+ .map(|&b| if b > 15 { b.wrapping_sub(16) } else { b })
49+
.map(|b| if b > 15 { 0b10000000 } else { b })
50+
.collect();
51+
self.lower_ctx
52+
53+
# PATCH NOTE: The rest of the diffs are not applied because the tests are not included in the rust source.
54+
# diff --git a/cranelift/filetests/filetests/isa/x64/simd-lane-access-compile.clif b/cranelift/filetests/filetests/isa/x64/simd-lane-access-compile.clif
55+
# index f58cad93a64..f414054edb8 100644
56+
# --- a/cranelift/filetests/filetests/isa/x64/simd-lane-access-compile.clif
57+
# +++ b/cranelift/filetests/filetests/isa/x64/simd-lane-access-compile.clif
58+
# @@ -101,7 +101,8 @@ block0:
59+
# ; addb %al, (%rax)
60+
# ; addb %al, (%rax)
61+
# ; addb %al, (%rax)
62+
# -; addb %al, (%rcx, %rax)
63+
# +; addb %al, (%rbx)
64+
# +; addl %eax, (%rax)
65+
# ; addb %al, (%rax)
66+
# ; addb %al, (%rax)
67+
# ; addb %al, (%rax)
68+
# diff --git a/cranelift/filetests/filetests/runtests/simd-shuffle.clif b/cranelift/filetests/filetests/runtests/simd-shuffle.clif
69+
# index cbb8bef5aed..621eebda629 100644
70+
# --- a/cranelift/filetests/filetests/runtests/simd-shuffle.clif
71+
# +++ b/cranelift/filetests/filetests/runtests/simd-shuffle.clif
72+
# @@ -19,3 +19,10 @@ block0(v0: i8x16, v1: i8x16):
73+
# return v2
74+
# }
75+
# ; run: %shuffle_zeros([1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16], [17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32]) == [4 1 0 0 5 7 13 12 24 14 25 5 3 0 18 6]
76+
# +
77+
# +function %shuffle1(i8x16) -> i8x16 {
78+
# +block0(v0: i8x16):
79+
# + v1 = shuffle v0, v0, [8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23]
80+
# + return v1
81+
# +}
82+
# +; run: %shuffle1([0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]) == [8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7]

SPECS/rust/rust.spec

+7-3
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@
99
Summary: Rust Programming Language
1010
Name: rust
1111
Version: 1.68.2
12-
Release: 1%{?dist}
12+
Release: 2%{?dist}
1313
License: (ASL 2.0 OR MIT) AND BSD AND CC-BY-3.0
1414
Vendor: Microsoft Corporation
1515
Distribution: Mariner
1616
Group: Applications/System
1717
URL: https://www.rust-lang.org/
18-
# Notes:
18+
# Notes:
1919
# - rust source official repo is https://github.com/rust-lang/rust
2020
# - cargo source official repo is https://github.com/rust-lang/cargo
2121
# - crates.io source official repo is https://github.com/rust-lang/crates.io
2222
Source0: https://static.rust-lang.org/dist/rustc-%{version}-src.tar.xz
2323
# Note: the rust-%%{version}-cargo.tar.gz file contains a cache created by capturing the contents downloaded into $CARGO_HOME.
2424
# To update the cache, leverage the: generate_source_tarball.sh
25-
#
25+
#
2626
# An example run for rust 1.68.2:
2727
# - Download Rust Source (1.68.2):
2828
# wget https://static.rust-lang.org/dist/rustc-1.68.2-src.tar.xz
@@ -39,6 +39,7 @@ Source4: https://static.rust-lang.org/dist/%{release_date}/rust-std-%{sta
3939
Source5: https://static.rust-lang.org/dist/%{release_date}/cargo-%{stage0_version}-aarch64-unknown-linux-gnu.tar.gz
4040
Source6: https://static.rust-lang.org/dist/%{release_date}/rustc-%{stage0_version}-aarch64-unknown-linux-gnu.tar.gz
4141
Source7: https://static.rust-lang.org/dist/%{release_date}/rust-std-%{stage0_version}-aarch64-unknown-linux-gnu.tar.gz
42+
Patch0: CVE-2023-27477.patch
4243
BuildRequires: binutils
4344
BuildRequires: cmake
4445
# make sure rust relies on curl from CBL-Mariner (instead of using its vendored flavor)
@@ -162,6 +163,9 @@ rm %{buildroot}%{_docdir}/%{name}/*.old
162163
%{_mandir}/man1/*
163164

164165
%changelog
166+
* Wed May 17 2023 Tobias Brick <[email protected]> - 1.68.2-2
167+
- Fix CVE-2023-27477 by patching cranelift vulnerability that is exposed in rust
168+
165169
* Tue Mar 28 2023 Muhammad Falak <[email protected]> - 1.68.2-1
166170
- Bump version to 1.68.2 to revoke leaked github keys
167171

0 commit comments

Comments
 (0)