diff options
| author | Ross Burton <ross@burtonini.com> | 2021-11-09 23:13:07 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-11-21 11:41:39 +0000 |
| commit | e8bdd45fe802aab8dcb6cf7e13f352bb0e5a522b (patch) | |
| tree | cd944be818ee6d153f0fe4873458d87d89ad46f5 /meta/recipes-support/vim/files/0004-patch-8.2.3489-ml_get-error-after-search-with-range.patch | |
| parent | f8ad42fc4909961878eb74eefaec8b86f62e6721 (diff) | |
| download | poky-e8bdd45fe802aab8dcb6cf7e13f352bb0e5a522b.tar.gz | |
vim: fix CVE-2021-3796, CVE-2021-3872, and CVE-2021-3875
Backport patches from upstream to fix these CVEs.
(From OE-Core rev: 2ed29a813fa07a2e6d2637f7fc63d5e0066b6304)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit b493eb4f9a6bb75a2f01a53b6c70762845bf79f9)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support/vim/files/0004-patch-8.2.3489-ml_get-error-after-search-with-range.patch')
| -rw-r--r-- | meta/recipes-support/vim/files/0004-patch-8.2.3489-ml_get-error-after-search-with-range.patch | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/meta/recipes-support/vim/files/0004-patch-8.2.3489-ml_get-error-after-search-with-range.patch b/meta/recipes-support/vim/files/0004-patch-8.2.3489-ml_get-error-after-search-with-range.patch new file mode 100644 index 0000000000..045081579c --- /dev/null +++ b/meta/recipes-support/vim/files/0004-patch-8.2.3489-ml_get-error-after-search-with-range.patch | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | CVE: CVE-2021-3875 | ||
| 2 | Upstream-Status: Backport | ||
| 3 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
| 4 | |||
| 5 | From b8968e26d7508e7d64bfc86808142818b0a9288c Mon Sep 17 00:00:00 2001 | ||
| 6 | From: Bram Moolenaar <Bram@vim.org> | ||
| 7 | Date: Sat, 9 Oct 2021 13:58:55 +0100 | ||
| 8 | Subject: [PATCH] patch 8.2.3489: ml_get error after search with range | ||
| 9 | |||
| 10 | Problem: ml_get error after search with range. | ||
| 11 | Solution: Limit the line number to the buffer line count. | ||
| 12 | --- | ||
| 13 | src/ex_docmd.c | 6 ++++-- | ||
| 14 | src/testdir/test_search.vim | 17 +++++++++++++++++ | ||
| 15 | src/version.c | 2 ++ | ||
| 16 | 3 files changed, 23 insertions(+), 2 deletions(-) | ||
| 17 | |||
| 18 | diff --git a/src/ex_docmd.c b/src/ex_docmd.c | ||
| 19 | index fb07450f8..fde726477 100644 | ||
| 20 | --- a/src/ex_docmd.c | ||
| 21 | +++ b/src/ex_docmd.c | ||
| 22 | @@ -3586,8 +3586,10 @@ get_address( | ||
| 23 | |||
| 24 | // When '/' or '?' follows another address, start from | ||
| 25 | // there. | ||
| 26 | - if (lnum != MAXLNUM) | ||
| 27 | - curwin->w_cursor.lnum = lnum; | ||
| 28 | + if (lnum > 0 && lnum != MAXLNUM) | ||
| 29 | + curwin->w_cursor.lnum = | ||
| 30 | + lnum > curbuf->b_ml.ml_line_count | ||
| 31 | + ? curbuf->b_ml.ml_line_count : lnum; | ||
| 32 | |||
| 33 | // Start a forward search at the end of the line (unless | ||
| 34 | // before the first line). | ||
| 35 | diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim | ||
| 36 | index 187671305..e142c3547 100644 | ||
| 37 | --- a/src/testdir/test_search.vim | ||
| 38 | +++ b/src/testdir/test_search.vim | ||
| 39 | @@ -1366,3 +1366,20 @@ func Test_searchdecl() | ||
| 40 | |||
| 41 | bwipe! | ||
| 42 | endfunc | ||
| 43 | + | ||
| 44 | +func Test_search_with_invalid_range() | ||
| 45 | + new | ||
| 46 | + let lines =<< trim END | ||
| 47 | + /\%.v | ||
| 48 | + 5/ | ||
| 49 | + c | ||
| 50 | + END | ||
| 51 | + call writefile(lines, 'Xrangesearch') | ||
| 52 | + source Xrangesearch | ||
| 53 | + | ||
| 54 | + bwipe! | ||
| 55 | + call delete('Xrangesearch') | ||
| 56 | +endfunc | ||
| 57 | + | ||
| 58 | + | ||
| 59 | +" vim: shiftwidth=2 sts=2 expandtab | ||
| 60 | diff --git a/src/version.c b/src/version.c | ||
| 61 | index 2b5de5ccf..092864bbb 100644 | ||
| 62 | --- a/src/version.c | ||
| 63 | +++ b/src/version.c | ||
| 64 | @@ -742,6 +742,8 @@ static char *(features[]) = | ||
| 65 | |||
| 66 | static int included_patches[] = | ||
| 67 | { /* Add new patch number below this line */ | ||
| 68 | +/**/ | ||
| 69 | + 3489, | ||
| 70 | /**/ | ||
| 71 | 3487, | ||
| 72 | /**/ | ||
