Skip to contentSkip to conversation

vim: fix CVE-2021-3968 and CVE-2021-3973

PATCH Superseded Ross Burton 1 participant 1 message Nov 29, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vim: fix CVE-2021-3968 and CVE-2021-3973

---
 ...rash-when-ModeChanged-triggered-too-.patch | 41 +++++++++
 ...rash-when-using-CTRL-W-f-without-fin.patch | 92 +++++++++++++++++++
 meta/recipes-support/vim/vim.inc              |  2 +
 3 files changed, 135 insertions(+)
 create mode 100644 meta/recipes-support/vim/files/0001-patch-8.2.3610-crash-when-ModeChanged-triggered-too-.patch
 create mode 100644 meta/recipes-support/vim/files/0002-patch-8.2.3611-crash-when-using-CTRL-W-f-without-fin.patch
meta/recipes-support/vim/files/0001-patch-8.2.3610-crash-when-ModeChanged-triggered-too-.patch new file +41 -0
new file mode 100644
index 0000000000..0f774df251
@@ -0,0 +1,41 @@
+CVE: CVE-2021-3968
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <[email protected]>
+
+From 54a16b2da3a0f664ca7fd182c16d2c2b8ea8131f Mon Sep 17 00:00:00 2001
+From: Bram Moolenaar <[email protected]>
+Date: Wed, 17 Nov 2021 16:52:40 +0000
+Subject: [PATCH] patch 8.2.3610: crash when ModeChanged triggered too early
+
+Problem:    Crash when ModeChanged triggered too early.
+Solution:   Trigger ModeChanged after setting VIsual.
+---
+ src/normal.c  | 1 +
+ src/version.c | 2 ++
+ 2 files changed, 3 insertions(+)
+
+diff --git a/src/normal.c b/src/normal.c
+index d6333b948..7cb959257 100644
+--- a/src/normal.c
++++ b/src/normal.c
+@@ -5675,6 +5675,7 @@ n_start_visual_mode(int c)
+     foldAdjustVisual();
+ #endif
+ 
++    trigger_modechanged();
+     setmouse();
+ #ifdef FEAT_CONCEAL
+     // Check for redraw after changing the state.
+diff --git a/src/version.c b/src/version.c
+index e1bc0d09b..52be3c39d 100644
+--- a/src/version.c
++++ b/src/version.c
+@@ -742,6 +742,8 @@ static char *(features[]) =
+ 
+ static int included_patches[] =
+ {   /* Add new patch number below this line */
++/**/
++    3610,
+ /**/
+     3582,
+ /**/
meta/recipes-support/vim/files/0002-patch-8.2.3611-crash-when-using-CTRL-W-f-without-fin.patch new file +92 -0

92 lines not on this page · raw message

meta/recipes-support/vim/vim.inc +2 -0
index d0957bfeae..7b2928675d 100644
@@ -25,6 +25,8 @@ SRC_URI = "git://github.com/vim/vim.git;branch=master;protocol=https \
            file://0005-patch-8.2.3564-invalid-memory-access-when-scrolling-.patch \
            file://0001-patch-8.2.3581-reading-character-past-end-of-line.patch \
            file://0002-patch-8.2.3582-reading-uninitialized-memory-when-giv.patch \
+           file://0001-patch-8.2.3610-crash-when-ModeChanged-triggered-too-.patch \
+           file://0002-patch-8.2.3611-crash-when-using-CTRL-W-f-without-fin.patch \
            "
 
 SRCREV = "98056533b96b6b5d8849641de93185dd7bcadc44"
Signature · 1 line
2.25.1