From a99dad53c1c0a1b0e4bcc7fad998493458bce45c Mon Sep 17 00:00:00 2001 From: mgb01105731 Date: Fri, 19 Jan 2024 10:21:38 +0800 Subject: [PATCH] fix CVE-2024-0684 --- 0002-fix-CVE-2024-0684.patch | 31 +++++++++++++++++++++++++++++++ coreutils.spec | 9 ++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 0002-fix-CVE-2024-0684.patch diff --git a/0002-fix-CVE-2024-0684.patch b/0002-fix-CVE-2024-0684.patch new file mode 100644 index 0000000..64583af --- /dev/null +++ b/0002-fix-CVE-2024-0684.patch @@ -0,0 +1,31 @@ +From c4c5ed8f4e9cd55a12966d4f520e3a13101637d9 Mon Sep 17 00:00:00 2001 +From: Paul Eggert +Date: Tue, 16 Jan 2024 13:48:32 -0800 +Subject: [PATCH] split: do not shrink hold buffer +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +* src/split.c (line_bytes_split): Do not shrink hold buffer. +If it’s large for this batch it’s likely to be large for the next +batch, and for ‘split’ it’s not worth the complexity/CPU hassle to +shrink it. Do not assume hold_size can be bufsize. +--- + src/split.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/src/split.c b/src/split.c +index 64020c859..037960a59 100644 +--- a/src/split.c ++++ b/src/split.c +@@ -809,10 +809,7 @@ line_bytes_split (intmax_t n_bytes, char *buf, idx_t bufsize) + { + cwrite (n_out == 0, hold, n_hold); + n_out += n_hold; +- if (n_hold > bufsize) +- hold = xirealloc (hold, bufsize); + n_hold = 0; +- hold_size = bufsize; + } + + /* Output to eol if present. */ diff --git a/coreutils.spec b/coreutils.spec index 6f01fb9..ad32f73 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -1,4 +1,4 @@ -%define anolis_release 3 +%define anolis_release 5 Summary: A set of basic GNU tools commonly used in shell scripts Name: coreutils Version: 9.4 @@ -52,6 +52,7 @@ Obsoletes: %{name} < 8.24 # backport patch from upstream Patch001: 0001-fix-uname-processortype-error-for-loongarch64.patch +Patch002: 0002-fix-CVE-2024-0684.patch %description These are the GNU core utilities. This package is the combination of @@ -230,6 +231,12 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir %doc NEWS README THANKS TODO %changelog +* Mon Jan 22 2024 mgb01105731 - 9.4-5 +- fix CVE-2024-0684 + +* Fri Jan 19 2024 Chang Gao - 9.4-4 +- Rebuild because of the builder time offset incorrect + * Wed Jan 17 2024 Wenlong Zhang - 9.4-3 - fix uname processortype error for loongarch64 -- Gitee