diff -Nru rustc-1.58.1+dfsg1~ubuntu1/debian/changelog rustc-1.58.1+dfsg1~ubuntu1/debian/changelog --- rustc-1.58.1+dfsg1~ubuntu1/debian/changelog 2022-02-24 13:41:38.000000000 +0100 +++ rustc-1.58.1+dfsg1~ubuntu1/debian/changelog 2022-03-21 19:02:27.000000000 +0100 @@ -1,3 +1,12 @@ +rustc (1.58.1+dfsg1~ubuntu1-0ubuntu2) jammy; urgency=medium + + * d/p/ubuntu-fix-crossbeam-CVE-2022-23639.patch: amended to also patch the + 0.7.2 version of the crate + * Downgrade cargo from rustc Recommends to Suggests to make rustc promotable to + main. + + -- Simon Chopin Mon, 21 Mar 2022 19:02:27 +0100 + rustc (1.58.1+dfsg1~ubuntu1-0ubuntu1) jammy; urgency=medium * New upstream version. diff -Nru rustc-1.58.1+dfsg1~ubuntu1/debian/control rustc-1.58.1+dfsg1~ubuntu1/debian/control --- rustc-1.58.1+dfsg1~ubuntu1/debian/control 2022-02-15 18:00:56.000000000 +0100 +++ rustc-1.58.1+dfsg1~ubuntu1/debian/control 2022-03-21 19:02:27.000000000 +0100 @@ -61,11 +61,11 @@ libstd-rust-dev (= ${binary:Version}), gcc, libc-dev, binutils (>= 2.26) Recommends: - cargo (>= 0.58.0~~), cargo (<< 0.59.0~~), # llvm is needed for llvm-dwp for -C split-debuginfo=packed llvm-13, Suggests: # lld and clang are needed for wasm compilation + cargo (>= 0.58.0~~), cargo (<< 0.59.0~~), lld-13, clang-13, Replaces: libstd-rust-dev (<< 1.26.2+dfsg1+llvm-0ubuntu1~~) Breaks: libstd-rust-dev (<< 1.26.2+dfsg1+llvm-0ubuntu1~~) diff -Nru rustc-1.58.1+dfsg1~ubuntu1/debian/patches/ubuntu-fix-crossbeam-CVE-2022-23639.patch rustc-1.58.1+dfsg1~ubuntu1/debian/patches/ubuntu-fix-crossbeam-CVE-2022-23639.patch --- rustc-1.58.1+dfsg1~ubuntu1/debian/patches/ubuntu-fix-crossbeam-CVE-2022-23639.patch 2022-02-24 12:43:26.000000000 +0100 +++ rustc-1.58.1+dfsg1~ubuntu1/debian/patches/ubuntu-fix-crossbeam-CVE-2022-23639.patch 2022-03-21 17:36:09.000000000 +0100 @@ -9,11 +9,9 @@ crossbeam-utils/src/atomic/atomic_cell.rs | 100 +++++++++++++++++++--- 1 file changed, 90 insertions(+), 10 deletions(-) -diff --git a/crossbeam-utils/src/atomic/atomic_cell.rs b/crossbeam-utils/src/atomic/atomic_cell.rs -index 8e1478fc9..cf829e619 100644 --- a/vendor/crossbeam-utils/src/atomic/atomic_cell.rs +++ b/vendor/crossbeam-utils/src/atomic/atomic_cell.rs -@@ -465,8 +465,24 @@ macro_rules! impl_arithmetic { +@@ -450,8 +450,24 @@ /// ``` #[inline] pub fn fetch_add(&self, val: $t) -> $t { @@ -40,7 +38,7 @@ } /// Decrements the current value by `val` and returns the previous value. -@@ -485,8 +501,24 @@ macro_rules! impl_arithmetic { +@@ -470,8 +486,24 @@ /// ``` #[inline] pub fn fetch_sub(&self, val: $t) -> $t { @@ -67,7 +65,7 @@ } /// Applies bitwise "and" to the current value and returns the previous value. -@@ -503,8 +535,24 @@ macro_rules! impl_arithmetic { +@@ -488,8 +520,24 @@ /// ``` #[inline] pub fn fetch_and(&self, val: $t) -> $t { @@ -94,7 +92,7 @@ } /// Applies bitwise "or" to the current value and returns the previous value. -@@ -521,8 +569,24 @@ macro_rules! impl_arithmetic { +@@ -506,8 +554,24 @@ /// ``` #[inline] pub fn fetch_or(&self, val: $t) -> $t { @@ -121,7 +119,144 @@ } /// Applies bitwise "xor" to the current value and returns the previous value. -@@ -539,8 +603,24 @@ macro_rules! impl_arithmetic { +@@ -524,8 +588,24 @@ + /// ``` + #[inline] + pub fn fetch_xor(&self, val: $t) -> $t { +- let a = unsafe { &*(self.value.get() as *const $atomic) }; +- a.fetch_xor(val, Ordering::AcqRel) ++ if can_transmute::<$t, $atomic>() { ++ let a = unsafe { &*(self.value.get() as *const $atomic) }; ++ a.fetch_xor(val, Ordering::AcqRel) ++ } else { ++ #[cfg(crossbeam_loom)] ++ { ++ let _ = val; ++ unimplemented!("loom does not support non-atomic atomic ops"); ++ } ++ #[cfg(not(crossbeam_loom))] ++ { ++ let _guard = lock(self.value.get() as usize).write(); ++ let value = unsafe { &mut *(self.value.get()) }; ++ let old = *value; ++ *value ^= val; ++ old ++ } ++ } + } + } + }; +--- a/vendor/crossbeam-utils-0.7.2/src/atomic/atomic_cell.rs ++++ b/vendor/crossbeam-utils-0.7.2/src/atomic/atomic_cell.rs +@@ -440,8 +440,24 @@ + /// ``` + #[inline] + pub fn fetch_add(&self, val: $t) -> $t { +- let a = unsafe { &*(self.value.get() as *const $atomic) }; +- a.fetch_add(val, Ordering::AcqRel) ++ if can_transmute::<$t, $atomic>() { ++ let a = unsafe { &*(self.value.get() as *const $atomic) }; ++ a.fetch_add(val, Ordering::AcqRel) ++ } else { ++ #[cfg(crossbeam_loom)] ++ { ++ let _ = val; ++ unimplemented!("loom does not support non-atomic atomic ops"); ++ } ++ #[cfg(not(crossbeam_loom))] ++ { ++ let _guard = lock(self.value.get() as usize).write(); ++ let value = unsafe { &mut *(self.value.get()) }; ++ let old = *value; ++ *value = value.wrapping_add(val); ++ old ++ } ++ } + } + + /// Decrements the current value by `val` and returns the previous value. +@@ -460,8 +476,24 @@ + /// ``` + #[inline] + pub fn fetch_sub(&self, val: $t) -> $t { +- let a = unsafe { &*(self.value.get() as *const $atomic) }; +- a.fetch_sub(val, Ordering::AcqRel) ++ if can_transmute::<$t, $atomic>() { ++ let a = unsafe { &*(self.value.get() as *const $atomic) }; ++ a.fetch_sub(val, Ordering::AcqRel) ++ } else { ++ #[cfg(crossbeam_loom)] ++ { ++ let _ = val; ++ unimplemented!("loom does not support non-atomic atomic ops"); ++ } ++ #[cfg(not(crossbeam_loom))] ++ { ++ let _guard = lock(self.value.get() as usize).write(); ++ let value = unsafe { &mut *(self.value.get()) }; ++ let old = *value; ++ *value = value.wrapping_sub(val); ++ old ++ } ++ } + } + + /// Applies bitwise "and" to the current value and returns the previous value. +@@ -478,8 +510,24 @@ + /// ``` + #[inline] + pub fn fetch_and(&self, val: $t) -> $t { +- let a = unsafe { &*(self.value.get() as *const $atomic) }; +- a.fetch_and(val, Ordering::AcqRel) ++ if can_transmute::<$t, $atomic>() { ++ let a = unsafe { &*(self.value.get() as *const $atomic) }; ++ a.fetch_and(val, Ordering::AcqRel) ++ } else { ++ #[cfg(crossbeam_loom)] ++ { ++ let _ = val; ++ unimplemented!("loom does not support non-atomic atomic ops"); ++ } ++ #[cfg(not(crossbeam_loom))] ++ { ++ let _guard = lock(self.value.get() as usize).write(); ++ let value = unsafe { &mut *(self.value.get()) }; ++ let old = *value; ++ *value &= val; ++ old ++ } ++ } + } + + /// Applies bitwise "or" to the current value and returns the previous value. +@@ -496,8 +544,24 @@ + /// ``` + #[inline] + pub fn fetch_or(&self, val: $t) -> $t { +- let a = unsafe { &*(self.value.get() as *const $atomic) }; +- a.fetch_or(val, Ordering::AcqRel) ++ if can_transmute::<$t, $atomic>() { ++ let a = unsafe { &*(self.value.get() as *const $atomic) }; ++ a.fetch_or(val, Ordering::AcqRel) ++ } else { ++ #[cfg(crossbeam_loom)] ++ { ++ let _ = val; ++ unimplemented!("loom does not support non-atomic atomic ops"); ++ } ++ #[cfg(not(crossbeam_loom))] ++ { ++ let _guard = lock(self.value.get() as usize).write(); ++ let value = unsafe { &mut *(self.value.get()) }; ++ let old = *value; ++ *value |= val; ++ old ++ } ++ } + } + + /// Applies bitwise "xor" to the current value and returns the previous value. +@@ -514,8 +578,24 @@ /// ``` #[inline] pub fn fetch_xor(&self, val: $t) -> $t {