From 8d820d99e7c163cae92e44394f7065795f42d8fc Mon Sep 17 00:00:00 2001 From: Zhao Hang Date: Thu, 17 Feb 2022 16:49:14 +0800 Subject: [PATCH 1/3] update to vim-8.0.1763-16.el8_5.4 Signed-off-by: Zhao Hang --- ...llegal-memory-access-if-buffer-name-.patch | 35 +++++++++++ ...llegal-memory-access-when-C-indentin.patch | 34 +++++++++++ ...uffer-overflow-with-long-help-argume.patch | 14 +++++ ...h-8.2.3949-using-freed-memory-with-V.patch | 45 ++++++++++++++ ...oing-beyond-the-end-of-the-line-with.patch | 38 ++++++++++++ 0001-vim-anolis-build-with-ruby26.patch | 60 ------------------- vim.spec | 52 ++++++++++------ 7 files changed, 200 insertions(+), 78 deletions(-) create mode 100644 0001-patch-8.2.3487-illegal-memory-access-if-buffer-name-.patch create mode 100644 0001-patch-8.2.3625-illegal-memory-access-when-C-indentin.patch create mode 100644 0001-patch-8.2.3669-buffer-overflow-with-long-help-argume.patch create mode 100644 0001-patch-8.2.3949-using-freed-memory-with-V.patch create mode 100644 0001-patch-8.2.3950-going-beyond-the-end-of-the-line-with.patch delete mode 100644 0001-vim-anolis-build-with-ruby26.patch diff --git a/0001-patch-8.2.3487-illegal-memory-access-if-buffer-name-.patch b/0001-patch-8.2.3487-illegal-memory-access-if-buffer-name-.patch new file mode 100644 index 0000000..76018f9 --- /dev/null +++ b/0001-patch-8.2.3487-illegal-memory-access-if-buffer-name-.patch @@ -0,0 +1,35 @@ +diff -up vim80/src/screen.c.cve3872 vim80/src/screen.c +--- vim80/src/screen.c.cve3872 2021-10-21 13:20:27.694921335 +0200 ++++ vim80/src/screen.c 2021-10-21 13:22:42.221732996 +0200 +@@ -6911,13 +6911,13 @@ win_redr_status(win_T *wp) + *(p + len++) = ' '; + if (bt_help(wp->w_buffer)) + { +- STRCPY(p + len, _("[Help]")); ++ vim_snprintf((char *)p + len, MAXPATHL - len, "%s", _("[Help]")); + len += (int)STRLEN(p + len); + } + #ifdef FEAT_QUICKFIX + if (wp->w_p_pvw) + { +- STRCPY(p + len, _("[Preview]")); ++ vim_snprintf((char *)p + len, MAXPATHL - len, "%s", _("[Preview]")); + len += (int)STRLEN(p + len); + } + #endif +@@ -6927,12 +6927,12 @@ win_redr_status(win_T *wp) + #endif + ) + { +- STRCPY(p + len, "[+]"); +- len += 3; ++ vim_snprintf((char *)p + len, MAXPATHL - len, "%s", "[+]"); ++ len += (int)STRLEN(p + len); + } + if (wp->w_buffer->b_p_ro) + { +- STRCPY(p + len, _("[RO]")); ++ vim_snprintf((char *)p + len, MAXPATHL - len, "%s", _("[RO]")); + len += (int)STRLEN(p + len); + } + diff --git a/0001-patch-8.2.3625-illegal-memory-access-when-C-indentin.patch b/0001-patch-8.2.3625-illegal-memory-access-when-C-indentin.patch new file mode 100644 index 0000000..668ffe5 --- /dev/null +++ b/0001-patch-8.2.3625-illegal-memory-access-when-C-indentin.patch @@ -0,0 +1,34 @@ +diff --git a/src/misc1.c b/src/misc1.c +index de79c8e..1c5867d 100644 +--- a/src/misc1.c ++++ b/src/misc1.c +@@ -6792,7 +6792,7 @@ find_start_brace(void) /* XXX */ + && (pos = ind_find_start_CORS(NULL)) == NULL) /* XXX */ + break; + if (pos != NULL) +- curwin->w_cursor.lnum = pos->lnum; ++ curwin->w_cursor = *pos; + } + curwin->w_cursor = cursor_save; + return trypos; +diff --git a/src/testdir/test_cindent.vim b/src/testdir/test_cindent.vim +index 7c2c5e3..f8c7e57 100644 +--- a/src/testdir/test_cindent.vim ++++ b/src/testdir/test_cindent.vim +@@ -102,4 +102,16 @@ func Test_cindent_expr() + bw! + endfunc + ++func Test_find_brace_backwards() ++ " this was looking beyond the end of the line ++ new ++ norm R/* ++ norm o0{ ++ norm o// ++ norm V{= ++ call assert_equal(['/*', ' 0{', '//'], getline(1, 3)) ++ bwipe! ++endfunc ++ ++ + " vim: shiftwidth=2 sts=2 expandtab diff --git a/0001-patch-8.2.3669-buffer-overflow-with-long-help-argume.patch b/0001-patch-8.2.3669-buffer-overflow-with-long-help-argume.patch new file mode 100644 index 0000000..0cfaec6 --- /dev/null +++ b/0001-patch-8.2.3669-buffer-overflow-with-long-help-argume.patch @@ -0,0 +1,14 @@ +diff --git a/src/ex_cmds.c b/src/ex_cmds.c +index 1827fec..e69fbd3 100644 +--- a/src/ex_cmds.c ++++ b/src/ex_cmds.c +@@ -6537,8 +6537,7 @@ find_help_tags( + || (vim_strchr((char_u *)"%_z@", arg[1]) != NULL + && arg[2] != NUL))) + { +- STRCPY(d, "/\\\\"); +- STRCPY(d + 3, arg + 1); ++ vim_snprintf((char *)d, IOSIZE, "/\\\\%s", arg + 1); + /* Check for "/\\_$", should be "/\\_\$" */ + if (d[3] == '_' && d[4] == '$') + STRCPY(d + 4, "\\$"); diff --git a/0001-patch-8.2.3949-using-freed-memory-with-V.patch b/0001-patch-8.2.3949-using-freed-memory-with-V.patch new file mode 100644 index 0000000..c3f7bb1 --- /dev/null +++ b/0001-patch-8.2.3949-using-freed-memory-with-V.patch @@ -0,0 +1,45 @@ +diff -up vim80/src/regexp.c.cve4192 vim80/src/regexp.c +--- vim80/src/regexp.c.cve4192 2022-01-12 15:21:44.792239040 +0100 ++++ vim80/src/regexp.c 2022-01-12 15:34:35.190425880 +0100 +@@ -4203,9 +4203,9 @@ reg_match_visual(void) + if (lnum < top.lnum || lnum > bot.lnum) + return FALSE; + ++ col = (colnr_T)(reginput - regline); + if (mode == 'v') + { +- col = (colnr_T)(reginput - regline); + if ((lnum == top.lnum && col < top.col) + || (lnum == bot.lnum && col >= bot.col + (*p_sel != 'e'))) + return FALSE; +@@ -4220,7 +4220,12 @@ reg_match_visual(void) + end = end2; + if (top.col == MAXCOL || bot.col == MAXCOL) + end = MAXCOL; +- cols = win_linetabsize(wp, regline, (colnr_T)(reginput - regline)); ++ ++ // getvvcol() flushes rex.line, need to get it again ++ regline = reg_getline(reglnum); ++ reginput = regline + col; ++ ++ cols = win_linetabsize(wp, regline, col); + if (cols < start || cols > end - (*p_sel == 'e')) + return FALSE; + } +diff -up vim80/src/testdir/test_regexp_latin.vim.cve4192 vim80/src/testdir/test_regexp_latin.vim +--- vim80/src/testdir/test_regexp_latin.vim.cve4192 2022-01-12 15:21:44.792239040 +0100 ++++ vim80/src/testdir/test_regexp_latin.vim 2022-01-12 15:36:12.499693099 +0100 +@@ -80,3 +80,13 @@ func Test_using_invalid_visual_position( + /\%V + bwipe! + endfunc ++ ++func Test_using_visual_position() ++ " this was using freed memory ++ new ++ exe "norm 0o\\k\o0" ++ /\%V ++ bwipe! ++endfunc ++ ++" vim: shiftwidth=2 sts=2 expandtab diff --git a/0001-patch-8.2.3950-going-beyond-the-end-of-the-line-with.patch b/0001-patch-8.2.3950-going-beyond-the-end-of-the-line-with.patch new file mode 100644 index 0000000..485f00d --- /dev/null +++ b/0001-patch-8.2.3950-going-beyond-the-end-of-the-line-with.patch @@ -0,0 +1,38 @@ +diff -up vim80/src/charset.c.cve4193 vim80/src/charset.c +--- vim80/src/charset.c.cve4193 2022-01-12 14:49:08.710592947 +0100 ++++ vim80/src/charset.c 2022-01-12 14:49:47.594705863 +0100 +@@ -1291,10 +1291,15 @@ getvcol( + posptr = NULL; /* continue until the NUL */ + else + { +- /* Special check for an empty line, which can happen on exit, when +- * ml_get_buf() always returns an empty string. */ +- if (*ptr == NUL) +- pos->col = 0; ++ colnr_T i; ++ ++ // In a few cases the position can be beyond the end of the line. ++ for (i = 0; i < pos->col; ++i) ++ if (ptr[i] == NUL) ++ { ++ pos->col = i; ++ break; ++ } + posptr = ptr + pos->col; + #ifdef FEAT_MBYTE + if (has_mbyte) +diff -up vim80/src/testdir/test_regexp_latin.vim.cve4193 vim80/src/testdir/test_regexp_latin.vim +--- vim80/src/testdir/test_regexp_latin.vim.cve4193 2022-01-12 14:49:08.710592947 +0100 ++++ vim80/src/testdir/test_regexp_latin.vim 2022-01-12 14:50:45.186873107 +0100 +@@ -72,3 +72,11 @@ func Test_backref() + call assert_fails('call search("\\%#=2\\(e\\1\\)")', 'E65:') + bwipe! + endfunc ++ ++func Test_using_invalid_visual_position() ++ " this was going beyond the end of the line ++ new ++ exe "norm 0o000\0\$s0" ++ /\%V ++ bwipe! ++endfunc diff --git a/0001-vim-anolis-build-with-ruby26.patch b/0001-vim-anolis-build-with-ruby26.patch deleted file mode 100644 index 4611343..0000000 --- a/0001-vim-anolis-build-with-ruby26.patch +++ /dev/null @@ -1,60 +0,0 @@ -From b09c684195d803137d52c34fb4d3a410be5ac10f Mon Sep 17 00:00:00 2001 -From: Bram Moolenaar -Date: Thu, 27 Dec 2018 22:11:01 +0100 -Subject: [PATCH] patch 8.1.0646: cannot build with Ruby 2.6.0 - -Problem: Cannot build with Ruby 2.6.0. -Solution: Add rb_ary_detransient(). (Ozaki Kiichi, closes #3724) ---- - src/if_ruby.c | 15 +++++++++++---- - src/version.c | 2 ++ - 2 files changed, 13 insertions(+), 4 deletions(-) - -diff --git a/src/if_ruby.c b/src/if_ruby.c -index cb9b416036f..34fc0ed1cb3 100644 ---- a/src/if_ruby.c -+++ b/src/if_ruby.c -@@ -123,6 +123,10 @@ - # define rb_gc_writebarrier_unprotect rb_gc_writebarrier_unprotect_stub - #endif - -+#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 26 -+# define rb_ary_detransient (*dll_rb_ary_detransient) -+#endif -+ - #include - #ifdef RUBY19_OR_LATER - # include -@@ -455,6 +459,9 @@ static VALUE (*dll_rb_float_new) (double); - static VALUE (*dll_rb_float_new) (double); - static VALUE (*dll_rb_ary_new) (void); - static VALUE (*dll_rb_ary_push) (VALUE, VALUE); -+# if DYNAMIC_RUBY_VER >= 26 -+static void (*dll_rb_ary_detransient) (VALUE); -+# endif - # if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK) - # ifdef __ia64 - static void * (*dll_rb_ia64_bsp) (void); -@@ -666,6 +673,9 @@ static struct - {"rb_ary_new", (RUBY_PROC*)&dll_rb_ary_new}, - {"rb_ary_push", (RUBY_PROC*)&dll_rb_ary_push}, - # endif -+# if DYNAMIC_RUBY_VER >= 26 -+ {"rb_ary_detransient", (RUBY_PROC*)&dll_rb_ary_detransient}, -+# endif - # ifdef RUBY19_OR_LATER - {"rb_int2big", (RUBY_PROC*)&dll_rb_int2big}, - {"ruby_script", (RUBY_PROC*)&dll_ruby_script}, -@@ -966,11 +976,8 @@ static int ensure_ruby_initialized(void) - - static void error_print(int state) - { --#ifndef DYNAMIC_RUBY --#if !(defined(RUBY_VERSION) && RUBY_VERSION >= 19) \ -- && !(defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19) -+#if !defined(DYNAMIC_RUBY) && !defined(RUBY19_OR_LATER) - RUBYEXTERN VALUE ruby_errinfo; --#endif - #endif - VALUE eclass; - VALUE einfo; diff --git a/vim.spec b/vim.spec index a4749f8..0c0402a 100644 --- a/vim.spec +++ b/vim.spec @@ -1,4 +1,3 @@ -%define anolis_release .0.1 %define patchlevel 1763 %if %{?WITH_SELINUX:0}%{!?WITH_SELINUX:1} %define WITH_SELINUX 1 @@ -25,7 +24,7 @@ Summary: The VIM editor URL: http://www.vim.org/ Name: vim Version: %{baseversion}.%{patchlevel} -Release: 16%{anolis_release}%{?dist} +Release: 16%{?dist}.4 License: Vim and MIT Source0: ftp://ftp.vim.org/pub/vim/unix/vim-%{baseversion}-%{patchlevel}.tar.bz2 Source1: vim.sh @@ -80,11 +79,15 @@ Patch3021: 0001-patch-8.1.0881-can-execute-shell-commands-in-rvim-th.patch Patch3022: vim-cve3796.patch # 2004891 - CVE-2021-3778 vim: heap-based buffer overflow in utf_ptr2char() in mbyte.c [rhel-8.5.0] Patch3023: vim-cve3778-fix.patch - -# Add by Anolis -# backport patch to fix build error with ruby -Patch10000: 0001-vim-anolis-build-with-ruby26.patch -# End +Patch3024: 0001-patch-8.2.3487-illegal-memory-access-if-buffer-name-.patch +# 2028341 - CVE-2021-3984 vim: illegal memory access when C-indenting could lead to Heap Buffer Overflow [rhel-8.6.0] +Patch3025: 0001-patch-8.2.3625-illegal-memory-access-when-C-indentin.patch +# 2028430 - CVE-2021-4019 vim: heap-based buffer overflow in find_help_tags() in src/help.c [rhel-8.6.0] +Patch3026: 0001-patch-8.2.3669-buffer-overflow-with-long-help-argume.patch +# CVE-2021-4193 vim: vulnerable to Out-of-bounds Read +Patch3027: 0001-patch-8.2.3950-going-beyond-the-end-of-the-line-with.patch +# CVE-2021-4192 vim: vulnerable to Use After Free +Patch3028: 0001-patch-8.2.3949-using-freed-memory-with-V.patch # gcc is no longer in buildroot by default BuildRequires: gcc @@ -285,8 +288,11 @@ perl -pi -e "s,bin/nawk,bin/awk,g" runtime/tools/mve.awk %patch3021 -p1 -b .rvim %patch3022 -p1 -b .cve3796 %patch3023 -p1 -b .cve3778 - -%patch10000 -p1 +%patch3024 -p1 -b .cve3872 +%patch3025 -p1 -b .cve3984 +%patch3026 -p1 -b .cve4019 +%patch3027 -p1 -b .cve4193 +%patch3028 -p1 -b .cve4192 %build %if 0%{?rhel} > 7 @@ -317,8 +323,8 @@ perl -pi -e "s/vimrc/virc/" os_unix.h --disable-pythoninterp --disable-perlinterp --disable-tclinterp \ --with-tlib=ncurses --enable-gui=no --disable-gpm --exec-prefix=/ \ --enable-fips-warning \ - --with-compiledby="OpenAnolis Community" \ - --with-modified-by="OpenAnolis Community" + --with-compiledby="" \ + --with-modified-by="" make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir} %{?_smp_mflags} cp vim minimal-vim @@ -336,8 +342,8 @@ mv -f ex_cmds.c.save ex_cmds.c --with-tlib=ncurses \ --enable-gtk3-check --enable-gui=gtk3 \ --enable-fips-warning \ - --with-compiledby="OpenAnolis Community" --enable-cscope \ - --with-modified-by="OpenAnolis Community" \ + --with-compiledby="" --enable-cscope \ + --with-modified-by="" \ %if "%{withnetbeans}" == "1" --enable-netbeans \ %else @@ -371,10 +377,10 @@ make clean --disable-tclinterp \ --with-x=no \ --enable-gui=no --exec-prefix=%{_prefix} --enable-multibyte \ - --enable-cscope --with-modified-by="OpenAnolis Community" \ + --enable-cscope --with-modified-by="" \ --with-tlib=ncurses \ --enable-fips-warning \ - --with-compiledby="OpenAnolis Community" \ + --with-compiledby="" \ %if "%{withnetbeans}" == "1" --enable-netbeans \ %else @@ -805,9 +811,19 @@ touch %{buildroot}/%{_datadir}/%{name}/vimfiles/doc/tags %{_datadir}/icons/locolor/*/apps/* %changelog -* Wed Dec 15 2021 Mahailiang - 2:8.0.1763-16.0.1 -- Rebrand to Anolis -- Fix build issue with ruby +* Wed Jan 12 2022 Zdenek Dohnal - 2:8.0.1763-16.4 +- CVE-2021-4193 vim: vulnerable to Out-of-bounds Read +- CVE-2021-4192 vim: vulnerable to Use After Free + +* Fri Dec 03 2021 Zdenek Dohnal - 2:8.0.1763-16.3 +- 2028341 - CVE-2021-3984 vim: illegal memory access when C-indenting could lead to Heap Buffer Overflow [rhel-8.6.0] +- 2028430 - CVE-2021-4019 vim: heap-based buffer overflow in find_help_tags() in src/help.c [rhel-8.6.0] + +* Tue Oct 26 2021 Zdenek Dohnal - 2:8.0.1763-16.2 +- remove the upstream test - uses a feature which is not presented in RHEL 8 + +* Tue Oct 26 2021 Zdenek Dohnal - 2:8.0.1763-16.1 +- CVE-2021-3872 vim: heap-based buffer overflow in win_redr_status() drawscreen.c [rhel-8.6.0] * Mon Sep 20 2021 Zdenek Dohnal - 2:8.0.1763-16 - 2004974 - CVE-2021-3796 vim: use-after-free in nv_replace() in normal.c [rhel-8.5.0] -- Gitee From 4ed3a5492a31ae4f72be01f226dc831a3beea55b Mon Sep 17 00:00:00 2001 From: yangxiaoxuan Date: Thu, 28 Jan 2021 08:55:59 +0800 Subject: [PATCH 2/3] spec: rebrand to anolis modify bugurl Signed-off-by: yangxiaoxuan Change-Id: I5b26e101bdec7a3f037b710bab1d4dc31b0a29b2 --- vim.spec | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/vim.spec b/vim.spec index 0c0402a..fec8fa1 100644 --- a/vim.spec +++ b/vim.spec @@ -1,3 +1,4 @@ +%define anolis_release .0.1 %define patchlevel 1763 %if %{?WITH_SELINUX:0}%{!?WITH_SELINUX:1} %define WITH_SELINUX 1 @@ -24,7 +25,7 @@ Summary: The VIM editor URL: http://www.vim.org/ Name: vim Version: %{baseversion}.%{patchlevel} -Release: 16%{?dist}.4 +Release: 16%{anolis_release}%{?dist}.4 License: Vim and MIT Source0: ftp://ftp.vim.org/pub/vim/unix/vim-%{baseversion}-%{patchlevel}.tar.bz2 Source1: vim.sh @@ -323,8 +324,8 @@ perl -pi -e "s/vimrc/virc/" os_unix.h --disable-pythoninterp --disable-perlinterp --disable-tclinterp \ --with-tlib=ncurses --enable-gui=no --disable-gpm --exec-prefix=/ \ --enable-fips-warning \ - --with-compiledby="" \ - --with-modified-by="" + --with-compiledby="OpenAnolis Community" \ + --with-modified-by="OpenAnolis Community" make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir} %{?_smp_mflags} cp vim minimal-vim @@ -342,8 +343,8 @@ mv -f ex_cmds.c.save ex_cmds.c --with-tlib=ncurses \ --enable-gtk3-check --enable-gui=gtk3 \ --enable-fips-warning \ - --with-compiledby="" --enable-cscope \ - --with-modified-by="" \ + --with-compiledby="OpenAnolis Community" --enable-cscope \ + --with-modified-by="OpenAnolis Community" \ %if "%{withnetbeans}" == "1" --enable-netbeans \ %else @@ -377,10 +378,10 @@ make clean --disable-tclinterp \ --with-x=no \ --enable-gui=no --exec-prefix=%{_prefix} --enable-multibyte \ - --enable-cscope --with-modified-by="" \ + --enable-cscope --with-modified-by="OpenAnolis Community" \ --with-tlib=ncurses \ --enable-fips-warning \ - --with-compiledby="" \ + --with-compiledby="OpenAnolis Community" \ %if "%{withnetbeans}" == "1" --enable-netbeans \ %else @@ -811,6 +812,9 @@ touch %{buildroot}/%{_datadir}/%{name}/vimfiles/doc/tags %{_datadir}/icons/locolor/*/apps/* %changelog +* Thu Feb 17 2022 Mahailiang - 2:8.0.1763-16.0.1.4 +- Rebrand to Anolis + * Wed Jan 12 2022 Zdenek Dohnal - 2:8.0.1763-16.4 - CVE-2021-4193 vim: vulnerable to Out-of-bounds Read - CVE-2021-4192 vim: vulnerable to Use After Free -- Gitee From 3f90c510c6c7d4477c60a8ef591edb057b1bd714 Mon Sep 17 00:00:00 2001 From: Liwei Ge Date: Tue, 2 Feb 2021 20:59:11 +0800 Subject: [PATCH 3/3] build: fix build issue with ruby Signed-off-by: Liwei Ge Change-Id: I549044bc52aa557941a2d87f6fe8b8ce6a7b7539 --- 0001-vim-anolis-build-with-ruby26.patch | 60 +++++++++++++++++++++++++ vim.spec | 10 ++++- 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 0001-vim-anolis-build-with-ruby26.patch diff --git a/0001-vim-anolis-build-with-ruby26.patch b/0001-vim-anolis-build-with-ruby26.patch new file mode 100644 index 0000000..4611343 --- /dev/null +++ b/0001-vim-anolis-build-with-ruby26.patch @@ -0,0 +1,60 @@ +From b09c684195d803137d52c34fb4d3a410be5ac10f Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Thu, 27 Dec 2018 22:11:01 +0100 +Subject: [PATCH] patch 8.1.0646: cannot build with Ruby 2.6.0 + +Problem: Cannot build with Ruby 2.6.0. +Solution: Add rb_ary_detransient(). (Ozaki Kiichi, closes #3724) +--- + src/if_ruby.c | 15 +++++++++++---- + src/version.c | 2 ++ + 2 files changed, 13 insertions(+), 4 deletions(-) + +diff --git a/src/if_ruby.c b/src/if_ruby.c +index cb9b416036f..34fc0ed1cb3 100644 +--- a/src/if_ruby.c ++++ b/src/if_ruby.c +@@ -123,6 +123,10 @@ + # define rb_gc_writebarrier_unprotect rb_gc_writebarrier_unprotect_stub + #endif + ++#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 26 ++# define rb_ary_detransient (*dll_rb_ary_detransient) ++#endif ++ + #include + #ifdef RUBY19_OR_LATER + # include +@@ -455,6 +459,9 @@ static VALUE (*dll_rb_float_new) (double); + static VALUE (*dll_rb_float_new) (double); + static VALUE (*dll_rb_ary_new) (void); + static VALUE (*dll_rb_ary_push) (VALUE, VALUE); ++# if DYNAMIC_RUBY_VER >= 26 ++static void (*dll_rb_ary_detransient) (VALUE); ++# endif + # if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK) + # ifdef __ia64 + static void * (*dll_rb_ia64_bsp) (void); +@@ -666,6 +673,9 @@ static struct + {"rb_ary_new", (RUBY_PROC*)&dll_rb_ary_new}, + {"rb_ary_push", (RUBY_PROC*)&dll_rb_ary_push}, + # endif ++# if DYNAMIC_RUBY_VER >= 26 ++ {"rb_ary_detransient", (RUBY_PROC*)&dll_rb_ary_detransient}, ++# endif + # ifdef RUBY19_OR_LATER + {"rb_int2big", (RUBY_PROC*)&dll_rb_int2big}, + {"ruby_script", (RUBY_PROC*)&dll_ruby_script}, +@@ -966,11 +976,8 @@ static int ensure_ruby_initialized(void) + + static void error_print(int state) + { +-#ifndef DYNAMIC_RUBY +-#if !(defined(RUBY_VERSION) && RUBY_VERSION >= 19) \ +- && !(defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19) ++#if !defined(DYNAMIC_RUBY) && !defined(RUBY19_OR_LATER) + RUBYEXTERN VALUE ruby_errinfo; +-#endif + #endif + VALUE eclass; + VALUE einfo; diff --git a/vim.spec b/vim.spec index fec8fa1..94117fa 100644 --- a/vim.spec +++ b/vim.spec @@ -90,6 +90,11 @@ Patch3027: 0001-patch-8.2.3950-going-beyond-the-end-of-the-line-with.patch # CVE-2021-4192 vim: vulnerable to Use After Free Patch3028: 0001-patch-8.2.3949-using-freed-memory-with-V.patch +# Add by Anolis +# backport patch to fix build error with ruby +Patch10000: 0001-vim-anolis-build-with-ruby26.patch +# End + # gcc is no longer in buildroot by default BuildRequires: gcc @@ -295,6 +300,8 @@ perl -pi -e "s,bin/nawk,bin/awk,g" runtime/tools/mve.awk %patch3027 -p1 -b .cve4193 %patch3028 -p1 -b .cve4192 +%patch10000 -p1 + %build %if 0%{?rhel} > 7 export RHEL_ALLOW_PYTHON2_FOR_BUILD=1 @@ -813,7 +820,8 @@ touch %{buildroot}/%{_datadir}/%{name}/vimfiles/doc/tags %changelog * Thu Feb 17 2022 Mahailiang - 2:8.0.1763-16.0.1.4 -- Rebrand to Anolis +- Rebrand to Anolis(Xiaoxuan Yang) +- Fix build issue with ruby(Liwei Ge) * Wed Jan 12 2022 Zdenek Dohnal - 2:8.0.1763-16.4 - CVE-2021-4193 vim: vulnerable to Out-of-bounds Read -- Gitee