diff --git a/1001-fix-CVE-2024-0684.patch b/1001-fix-CVE-2024-0684.patch new file mode 100644 index 0000000000000000000000000000000000000000..64583afd3681cbcf7a408375ba5f37486466000e --- /dev/null +++ b/1001-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 a1fabcb33be2aab71fb892a5af4685c47b10710e..646284336863feba3d9ab1f6d0ef6bf7e08d5dca 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -1,4 +1,4 @@ -%define anolis_release 4 +%define anolis_release 5 Summary: A set of basic GNU tools commonly used in shell scripts Name: coreutils Version: 9.4 @@ -53,6 +53,8 @@ Obsoletes: %{name} < 8.24 Patch001: 0001-fix-uname-processortype-error-for-loongarch64.patch +Patch002: 1001-fix-CVE-2024-0684.patch + %description These are the GNU core utilities. This package is the combination of the old GNU fileutils, sh-utils, and textutils packages. @@ -230,6 +232,9 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir %doc NEWS README THANKS TODO %changelog +* Mon Jun 03 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