Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
60c030d8ee
!19 [sync] PR-18: enable debug package
From: @openeuler-sync-bot 
Reviewed-by: @open-bot 
Signed-off-by: @open-bot
2024-07-10 09:27:13 +00:00
liweigang
eb7bee5920 feat: enable debug package
Signed-off-by: liweigang <liweiganga@uniontech.com>
(cherry picked from commit 44c07ea36d77d71a3a2884e6d8c5a259eac91922)
2024-07-10 15:48:46 +08:00
openeuler-ci-bot
eb663f1092
!16 [sync] PR-15: Fix CVE-2023-6209
From: @openeuler-sync-bot 
Reviewed-by: @open-bot 
Signed-off-by: @open-bot
2024-07-10 07:03:51 +00:00
lvfei
e51148c306 Fix CVE-2023-6209
(cherry picked from commit 813e88f60cfc28a032b4fd00a1dac187bf45eaa4)
2024-07-10 13:34:30 +08:00
openeuler-ci-bot
230678289b
!13 [sync] PR-11: Fix CVE-2023-44488
From: @openeuler-sync-bot 
Reviewed-by: @technology208 
Signed-off-by: @technology208
2024-07-04 07:06:17 +00:00
lvfei
d0ca1a2c8b Fix CVE-2023-44488
(cherry picked from commit 686d60c987391221262869c201737e8910c9745a)
2024-07-04 15:05:20 +08:00
openeuler-ci-bot
8d5984d7a2
!9 [sync] PR-5: Disable mold for riscv64
From: @openeuler-sync-bot 
Reviewed-by: @open-bot 
Signed-off-by: @open-bot
2024-04-11 09:31:16 +00:00
misaka00251
a3c6032f30 Disable mold for riscv64
(cherry picked from commit 0198d873db31ead88b170090e3b091cc50ee1ba9)
2024-04-11 16:39:48 +08:00
openeuler-ci-bot
3ea2ee3d87
!7 [sync] PR-4: fix build error for loongarch64
From: @openeuler-sync-bot 
Reviewed-by: @open-bot 
Signed-off-by: @open-bot
2024-04-11 07:13:32 +00:00
Wenlong Zhang
49f0016002 fix build error for loongarch64
(cherry picked from commit fa8eab48a4d21c9e227da17cb265f9b4a45d2a9b)
2024-04-11 14:13:40 +08:00
4 changed files with 239 additions and 5 deletions

127
CVE-2023-44488.patch Normal file
View File

@ -0,0 +1,127 @@
From dfff1be88eaa0e0756c74b702484465b48b66fca Mon Sep 17 00:00:00 2001
From: Jerome Jiang <jianj@google.com>
Date: Thu, 30 Jun 2022 13:48:56 -0400
Subject: [PATCH] CVE-2023-44488 Fix bug with smaller width bigger size
Origin: https://github.com/webmproject/libvpx/commit/df9fd9d5b7325060b2b921558a1eb20ca7880937
---
media/libvpx/libvpx/test/resize_test.cc | 9 +++----
.../libvpx/vp9/common/vp9_alloccommon.c | 14 +++++-----
media/libvpx/libvpx/vp9/encoder/vp9_encoder.c | 27 +++++++++++++++++--
3 files changed, 35 insertions(+), 15 deletions(-)
diff --git a/media/libvpx/libvpx/test/resize_test.cc b/media/libvpx/libvpx/test/resize_test.cc
index 5f323db5ab..55a2fe58c6 100644
--- a/media/libvpx/libvpx/test/resize_test.cc
+++ b/media/libvpx/libvpx/test/resize_test.cc
@@ -101,11 +101,8 @@ void ScaleForFrameNumber(unsigned int frame, unsigned int initial_w,
*h = initial_h;
return;
}
- if (frame < 100) {
- *w = initial_w * 7 / 10;
- *h = initial_h * 16 / 10;
- return;
- }
+ *w = initial_w * 7 / 10;
+ *h = initial_h * 16 / 10;
return;
}
if (frame < 10) {
@@ -578,7 +575,7 @@ TEST_P(ResizeRealtimeTest, TestExternalResizeWorks) {
}
}
-TEST_P(ResizeRealtimeTest, DISABLED_TestExternalResizeSmallerWidthBiggerSize) {
+TEST_P(ResizeRealtimeTest, TestExternalResizeSmallerWidthBiggerSize) {
ResizingVideoSource video;
video.flag_codec_ = true;
video.smaller_width_larger_size_ = true;
diff --git a/media/libvpx/libvpx/vp9/common/vp9_alloccommon.c b/media/libvpx/libvpx/vp9/common/vp9_alloccommon.c
index 5702dca718..7841c5e793 100644
--- a/media/libvpx/libvpx/vp9/common/vp9_alloccommon.c
+++ b/media/libvpx/libvpx/vp9/common/vp9_alloccommon.c
@@ -131,13 +131,7 @@ int vp9_alloc_context_buffers(VP9_COMMON *cm, int width, int height) {
cm->free_mi(cm);
if (cm->alloc_mi(cm, new_mi_size)) goto fail;
}
-
- if (cm->seg_map_alloc_size < cm->mi_rows * cm->mi_cols) {
- // Create the segmentation map structure and set to 0.
- free_seg_map(cm);
- if (alloc_seg_map(cm, cm->mi_rows * cm->mi_cols)) goto fail;
- }
-
+
if (cm->above_context_alloc_cols < cm->mi_cols) {
vpx_free(cm->above_context);
cm->above_context = (ENTROPY_CONTEXT *)vpx_calloc(
@@ -151,6 +145,12 @@ int vp9_alloc_context_buffers(VP9_COMMON *cm, int width, int height) {
if (!cm->above_seg_context) goto fail;
cm->above_context_alloc_cols = cm->mi_cols;
}
+
+ if (cm->seg_map_alloc_size < cm->mi_rows * cm->mi_cols) {
+ // Create the segmentation map structure and set to 0.
+ free_seg_map(cm);
+ if (alloc_seg_map(cm, cm->mi_rows * cm->mi_cols)) goto fail;
+ }
if (vp9_alloc_loop_filter(cm)) goto fail;
diff --git a/media/libvpx/libvpx/vp9/encoder/vp9_encoder.c b/media/libvpx/libvpx/vp9/encoder/vp9_encoder.c
index 4a37816e20..6efcf91066 100644
--- a/media/libvpx/libvpx/vp9/encoder/vp9_encoder.c
+++ b/media/libvpx/libvpx/vp9/encoder/vp9_encoder.c
@@ -1937,6 +1937,17 @@ static void alloc_copy_partition_data(VP9_COMP *cpi) {
}
}
+static void free_copy_partition_data(VP9_COMP *cpi) {
+ vpx_free(cpi->prev_partition);
+ cpi->prev_partition = NULL;
+ vpx_free(cpi->prev_segment_id);
+ cpi->prev_segment_id = NULL;
+ vpx_free(cpi->prev_variance_low);
+ cpi->prev_variance_low = NULL;
+ vpx_free(cpi->copied_frame_cnt);
+ cpi->copied_frame_cnt = NULL;
+}
+
void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) {
VP9_COMMON *const cm = &cpi->common;
RATE_CONTROL *const rc = &cpi->rc;
@@ -2021,6 +2032,8 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) {
new_mi_size = cm->mi_stride * calc_mi_size(cm->mi_rows);
if (cm->mi_alloc_size < new_mi_size) {
vp9_free_context_buffers(cm);
+ vp9_free_pc_tree(&cpi->td);
+ vpx_free(cpi->mbmi_ext_base);
alloc_compressor_data(cpi);
realloc_segmentation_maps(cpi);
cpi->initial_width = cpi->initial_height = 0;
@@ -2036,8 +2049,18 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) {
update_frame_size(cpi);
if (last_w != cpi->oxcf.width || last_h != cpi->oxcf.height) {
- memset(cpi->consec_zero_mv, 0,
- cm->mi_rows * cm->mi_cols * sizeof(*cpi->consec_zero_mv));
+ vpx_free(cpi->consec_zero_mv);
+ CHECK_MEM_ERROR(
+ cm, cpi->consec_zero_mv,
+ vpx_calloc(cm->mi_rows * cm->mi_cols, sizeof(*cpi->consec_zero_mv)));
+
+ vpx_free(cpi->skin_map);
+ CHECK_MEM_ERROR(
+ cm, cpi->skin_map,
+ vpx_calloc(cm->mi_rows * cm->mi_cols, sizeof(cpi->skin_map[0])));
+
+ free_copy_partition_data(cpi);
+ alloc_copy_partition_data(cpi);
if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ)
vp9_cyclic_refresh_reset_resize(cpi);
rc->rc_1_frame = 0;
--
2.27.0

33
CVE-2023-6209.patch Normal file
View File

@ -0,0 +1,33 @@
From f8389177cbce4fe098042850ada25feb7e6ba5a7 Mon Sep 17 00:00:00 2001
From: Valentin Gosu <valentin.gosu@gmail.com>
Date: Thu, 19 Oct 2023 07:40:28 +0000 (8 months ago)
Subject: [PATCH] CVE-2023-6209
---
netwerk/base/nsStandardURL.cpp | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/netwerk/base/nsStandardURL.cpp b/netwerk/base/nsStandardURL.cpp
index b1b3ba1ef4..14aa8d5a5d 100644
--- a/netwerk/base/nsStandardURL.cpp
+++ b/netwerk/base/nsStandardURL.cpp
@@ -2707,7 +2707,15 @@ nsStandardURL::Resolve(const nsACString& in, nsACString& out) {
// locate result path
resultPath = strstr(result, "://");
if (resultPath) {
- resultPath = strchr(resultPath + 3, '/');
+ // If there are multiple slashes after :// we must ignore them
+ // otherwise net_CoalesceDirs may think the host is a part of the path.
+ resultPath += 3;
+ if (protocol.IsEmpty() && Scheme() != "file") {
+ while (*resultPath == '/') {
+ resultPath++;
+ }
+ }
+ resultPath = strchr(resultPath, '/');
if (resultPath) {
net_CoalesceDirs(coalesceFlag, resultPath);
}
--
2.33.0

View File

@ -0,0 +1,55 @@
From 4afb7390412988eb41ccaf264dea45876f0801d9 Mon Sep 17 00:00:00 2001
From: liuyu <liuyu@loongson.cn>
Date: Thu, 7 Sep 2023 19:17:52 +0800
Subject: [PATCH] Enable JIT compiler of loong64 port by default
---
js/moz.configure | 2 ++
js/src/wasm/WasmSignalHandlers.cpp | 10 +++++-----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/js/moz.configure b/js/moz.configure
index 7a241cac76..2bb7979e36 100644
--- a/js/moz.configure
+++ b/js/moz.configure
@@ -234,6 +234,8 @@ def jit_codegen(jit_enabled, simulator, target):
return namespace(arm64=True)
elif target.cpu == "x86_64":
return namespace(x64=True)
+ elif target.cpu == "loongarch64":
+ return namespace(loong64=True)
return namespace(**{str(target.cpu): True})
diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp
index 4a45905431..074c373106 100644
--- a/js/src/wasm/WasmSignalHandlers.cpp
+++ b/js/src/wasm/WasmSignalHandlers.cpp
@@ -158,10 +158,10 @@ using mozilla::DebugOnly;
# define R32_sig(p) ((p)->uc_mcontext.gp_regs[32])
# endif
# if defined(__linux__) && defined(__loongarch__)
-# define EPC_sig(p) ((p)->uc_mcontext.pc)
-# define RRA_sig(p) ((p)->uc_mcontext.gregs[1])
-# define RSP_sig(p) ((p)->uc_mcontext.gregs[3])
-# define RFP_sig(p) ((p)->uc_mcontext.gregs[22])
+# define EPC_sig(p) ((p)->uc_mcontext.__pc)
+# define RRA_sig(p) ((p)->uc_mcontext.__gregs[1])
+# define R03_sig(p) ((p)->uc_mcontext.__gregs[3])
+# define RFP_sig(p) ((p)->uc_mcontext.__gregs[22])
# endif
# elif defined(__NetBSD__)
# define EIP_sig(p) ((p)->uc_mcontext.__gregs[_REG_EIP])
@@ -403,7 +403,7 @@ struct macos_aarch64_context {
# elif defined(__loongarch__)
# define PC_sig(p) EPC_sig(p)
# define FP_sig(p) RFP_sig(p)
-# define SP_sig(p) RSP_sig(p)
+# define SP_sig(p) R03_sig(p)
# define LR_sig(p) RRA_sig(p)
# endif
--
2.20.1

View File

@ -1,5 +1,4 @@
%define debug_package %{nil}
%global major 102
%global major 102
# LTO - Enable in Release builds, but consider disabling for development as it increases compile time
%global build_with_lto 1
@ -19,12 +18,12 @@
%endif
%ifarch riscv64
%global build_mold 1
%global build_mold 0
%endif
Name: mozjs%{major}
Version: 102.9.0
Release: 1
Release: 6
Summary: SpiderMonkey JavaScript library
License: MPL-2.0 AND Apache-2.0 AND BSD-3-Clause AND BSD-2-Clause AND MIT AND GPL-3.0-or-later
URL: https://hg.mozilla.org/releases/mozilla-esr102
@ -61,11 +60,16 @@ Patch21: 0001-Skip-failing-tests-on-ppc64-and-s390x.patch
# riscv64 sipdermonkey jit
Patch22: spidermonkey-riscv64-plct.patch
Patch23: CVE-2023-44488.patch
Patch25: CVE-2023-6209.patch
# mold
%if 0%{?build_mold}
Patch23: D134330.diff
%endif
# Enable jit compiler in loongarch64
Patch24: enable-jit-compiler-of-loongarch64-port-by-default.patch
BuildRequires: cargo
BuildRequires: ccache
@ -174,7 +178,7 @@ case `uname -i` in
i386 | ppc | s390 | sparc )
wordsize="32"
;;
x86_64 | ppc64 | s390x | sparc64 | riscv64 )
x86_64 | ppc64 | s390x | sparc64 | riscv64 | loongarch64 )
wordsize="64"
;;
*)
@ -250,6 +254,21 @@ ln -s libmozjs-%{major}.so.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so
%{_includedir}/mozjs-%{major}/
%changelog
* Wed Jul 10 2024 liweigang <liweiganga@uniontech.com> - 102.9.0-6
- enable debug package
* Wed Jul 10 2024 lvfei <lvfei@kylinos.cn> - 102.9.0-5
- Fix CVE-2023-6209
* Tue Jun 25 2024 lvfei <lvfei@kylinos.cn> - 102.9.0-4
- Fix CVE-2023-44488.patch
* Thu Apr 11 2024 misaka00251 <liuxin@iscas.ac.cn> - 102.9.0-3
- Disable mold for riscv64
* Thu Mar 28 2024 Wenlong Zhang <zhangwenlong@loongson.cn> - 102.9.0-2
- fix build error for loongarch64
* Thu Mar 16 2023 Jingwiw <wangjingwei@iscas.ac.cn> - 102.9.0-1
- upgrade to 102.9.0
- add sipdermonkey jit support for riscv64