diff options
-rw-r--r-- | 0002-Bug-1694670.-Fix-the-OOB-check-in-write_u32-u16.-r-a.patch | 34 | ||||
-rw-r--r-- | PKGBUILD | 7 |
2 files changed, 40 insertions, 1 deletions
diff --git a/0002-Bug-1694670.-Fix-the-OOB-check-in-write_u32-u16.-r-a.patch b/0002-Bug-1694670.-Fix-the-OOB-check-in-write_u32-u16.-r-a.patch new file mode 100644 index 0000000..8c44bf7 --- /dev/null +++ b/0002-Bug-1694670.-Fix-the-OOB-check-in-write_u32-u16.-r-a.patch @@ -0,0 +1,34 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jeff Muizelaar <jmuizelaar@mozilla.com> +Date: Thu, 25 Feb 2021 13:18:47 +0000 +Subject: [PATCH] Bug 1694670. Fix the OOB check in write_u32/u16. r=aosmond, + a=RyanVM + +Differential Revision: https://phabricator.services.mozilla.com/D106362 +--- + gfx/qcms/src/iccread.rs | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gfx/qcms/src/iccread.rs b/gfx/qcms/src/iccread.rs +index 0113e17aff3e6..f1107d50a86b6 100644 +--- a/gfx/qcms/src/iccread.rs ++++ b/gfx/qcms/src/iccread.rs +@@ -229,16 +229,16 @@ fn read_uInt16Number(mem: &mut MemSource, offset: usize) -> uInt16Number { + read_u16(mem, offset) + } + pub fn write_u32(mem: &mut [u8], offset: usize, value: u32) { +- if offset <= mem.len() - std::mem::size_of_val(&value) { ++ if offset > mem.len() - std::mem::size_of_val(&value) { + panic!("OOB"); + } + let mem = mem.as_mut_ptr(); + unsafe { + std::ptr::write_unaligned(mem.add(offset) as *mut u32, cpu_to_be32(value)); + } + } + pub fn write_u16(mem: &mut [u8], offset: usize, value: u16) { +- if offset <= mem.len() - std::mem::size_of_val(&value) { ++ if offset > mem.len() - std::mem::size_of_val(&value) { + panic!("OOB"); + } + let mem = mem.as_mut_ptr(); @@ -20,7 +20,7 @@ _testgcc=0 pkgname=firefox pkgver=86.0 -pkgrel=1 +pkgrel=2 pkgdesc="Standalone web browser from mozilla.org" arch=(x86_64 aarch64) license=(MPL GPL LGPL) @@ -44,6 +44,7 @@ conflicts=(firefox-esr) source=( "https://archive.mozilla.org/pub/$pkgname/releases/$pkgver/source/$pkgname-$pkgver.source.tar.xz"{,.asc} 0001-Use-remoting-name-for-GDK-application-names.patch + 0002-Bug-1694670.-Fix-the-OOB-check-in-write_u32-u16.-r-a.patch $pkgname.desktop distribution.ini mozconfig.in @@ -59,6 +60,7 @@ source=( b2sums=('64c122dd16b3d020fd5cd1098d32b7b3b4fe15e8f8b28e5b5986971bff71c80a72d12d2c9eeb192d3319661c3b06506c1548eef95ff3f84d13479664e68e8d58' 'SKIP' 'c83065fa6eab83c4b74c5e6d5eb61cdc0b050debbb25aae5800a3ab5b58ff946c75d63f5373fc1995f03513888d57f7ee1d63d14c2c891f23460e0a8ee642eb2' + '5d5d088972d852973496ee9051f8d984d5983ea8e6b4d31345f46206c4d50aa30968112c2223613096ca562c0d6a333c9c2adf8d0910b14b81f8da82fa6d2195' 'e18f2c22e394ca3b6758bc130245b254947e4d15921be3da443d6d7c3c4b0d22ead1b39fbc10a4f896edd19e2a1dffbd1cbb34dc4beb0621a6ddb70ccc53b3a7' '877eda442eb4730600dccf209a6e961ad3122ab456bbfda4ff041e8493ebaaf96224ac218360931259ff4214482f6bf65b3a3052f977ade1a274f38ffd859535' '715b4f8d73bf07a02ea3cfdb75cb992331f354880b8194717720e45872fdbcd99534b6d73bf4caf7dc561df4060f07239eb1172b604cc7cbd31be9d3d72331e0' @@ -79,6 +81,9 @@ prepare() { # https://bugzilla.mozilla.org/show_bug.cgi?id=1530052 patch -Np1 -i ../0001-Use-remoting-name-for-GDK-application-names.patch + # https://bugs.archlinux.org/task/69821 + patch -Np1 -i ../0002-Bug-1694670.-Fix-the-OOB-check-in-write_u32-u16.-r-a.patch + if [ "${_modclang}" != "1" ]; then # Apply gcc pgo patches patch -Np1 -i ../arc4_enable-lto-for-gcc.patch |