~alpine/aports

v3.3: main/vim: security fixes #6865 v1 PROPOSED

Sergei Lukin: 1
 main/vim: security fixes #6865

 2 files changed, 39 insertions(+), 4 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.alpinelinux.org/~alpine/aports/patches/2554/mbox | git am -3
Learn more about email & git

[alpine-aports] [PATCH v3.3] main/vim: security fixes #6865 Export this patch

CVE-2017-5953: Tree length values not validated properly when handling a spell file
---
 main/vim/APKBUILD            | 15 +++++++++++----
 main/vim/CVE-2017-5953.patch | 28 ++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 4 deletions(-)
 create mode 100644 main/vim/CVE-2017-5953.patch

diff --git a/main/vim/APKBUILD b/main/vim/APKBUILD
index 9ca2d46..95175c0 100644
--- a/main/vim/APKBUILD
+++ b/main/vim/APKBUILD
@@ -1,8 +1,9 @@
# Contributor: Sergei Lukin <sergej.lukin@gmail.com>
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=vim
pkgver=7.4.943
pkgrel=4
pkgrel=5
pkgdesc="advanced text editor"
url="http://www.vim.org"
arch="all"
@@ -13,11 +14,14 @@ subpackages="$pkgname-doc ${pkgname}diff"
source="$pkgname-$pkgver.tar.gz::https://github.com/$pkgname/$pkgname/archive/v$pkgver.tar.gz
	vimrc
	CVE-2016-1248.patch
	CVE-2017-5953.patch
	"

_builddir="$srcdir"/$pkgname-$pkgver

# secfixes:
#   7.4.943-r5:
#   - CVE-2017-5953
#   7.4.943-r4:
#   - CVE-2016-1248

@@ -69,10 +73,13 @@ vimdiff() {

md5sums="ba7668832e3948bee645a51d279e14a3  vim-7.4.943.tar.gz
97aecde2ab504e543a96bec84b3b5638  vimrc
65cd79792f8150130c4aafb7842b80cf  CVE-2016-1248.patch"
65cd79792f8150130c4aafb7842b80cf  CVE-2016-1248.patch
9ef01e90bbb56924265c7306ae9f58c3  CVE-2017-5953.patch"
sha256sums="1229ca675062ff4983040e59417bfb80c49bf1ebcb54f7b513291a97df1fc77e  vim-7.4.943.tar.gz
7ac7e5fd75fe315fd8b3ca4172056ebb9f06df0b5985d3ff88133dfcdd87076b  vimrc
b8d1227a41d6f7f596f3bf45dfaf9d0dbbbcf091c5f145c95d464986031446e5  CVE-2016-1248.patch"
b8d1227a41d6f7f596f3bf45dfaf9d0dbbbcf091c5f145c95d464986031446e5  CVE-2016-1248.patch
79dfa7c82565efe85f5cbcc889aa45cc46f2c6a83c58b35b834e05b54367c44d  CVE-2017-5953.patch"
sha512sums="578351f4a92127a9d357aeba2ce6b88f8e2ff0c66f3f4980633b34f91dba57be9ec5f95a79aa9b6d5943f1db79f0df33cb2eb4bc4ff16a14b80a9d5732a1865f  vim-7.4.943.tar.gz
d9586b777881973cb5e48e18750336a522ed72c3127b2d6b6991e2b943468ca5b694476e7fa39ab469178c1375fc8f52627484e0fe377aea5811a513e35a7b02  vimrc
e773f8c497364930dea10585af5888f12ea7be1effb23461df9f92c10c2c0e9e55e127b9465f62a20c03e08ab77f9c9f140f50277d7c9cc5c318e84725434d18  CVE-2016-1248.patch"
e773f8c497364930dea10585af5888f12ea7be1effb23461df9f92c10c2c0e9e55e127b9465f62a20c03e08ab77f9c9f140f50277d7c9cc5c318e84725434d18  CVE-2016-1248.patch
e9f2bef38bf5257857f2936d6e3e7d7564d97701bf2f89ad1fd56ff7d0f7f8d722801b4c6ace859101e7611e74d48bf052f6cca9e2b6b4720d9adc1a1d38e2cf  CVE-2017-5953.patch"
diff --git a/main/vim/CVE-2017-5953.patch b/main/vim/CVE-2017-5953.patch
new file mode 100644
index 0000000..26e8abe
--- /dev/null
+++ b/main/vim/CVE-2017-5953.patch
@@ -0,0 +1,28 @@
Source:
https://github.com/vim/vim/commit/399c297aa93afe2c0a39e2a1b3f972aebba44c9d
Script was adjusted for vim-7.4.1831

commit 399c297aa93afe2c0a39e2a1b3f972aebba44c9d
Author: Bram Moolenaar <Bram@vim.org>
Date:   Thu Feb 9 21:07:12 2017 +0100

    patch 8.0.0322: possible overflow with corrupted spell file
    
    Problem:    Possible overflow with spell file where the tree length is
                corrupted.
    Solution:   Check for an invalid length (suggested by shqking)

diff --git a/src/spell.c b/src/spell.c
index c7d87c6c7..8b1a3a633 100644
--- a/src/spell.c
+++ b/src/spell.c
@@ -1595,6 +1595,9 @@ spell_read_tree(
     len = get4c(fd);
     if (len < 0)
 	return SP_TRUNCERROR;
+    if (len >= 0x3ffffff)
+	/* Invalid length, multiply with sizeof(int) would overflow. */
+	return SP_FORMERROR;
     if (len > 0)
     {
 	/* Allocate the byte array. */
-- 
2.6.6



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---