Patchwork [3/6] subversion: fix for Security Advisory CVE-2013-4131

login
register
mail settings
Submitter rongqing.li@windriver.com
Date May 16, 2014, 6 a.m.
Message ID <98fe814faed625743400ada37e7b7104ad63962c.1400219191.git.rongqing.li@windriver.com>
Download mbox | patch
Permalink /patch/72277/
State Accepted
Commit 722ff438b355afc04f82e0aca47f9082d2d3d7df
Headers show

Comments

rongqing.li@windriver.com - May 16, 2014, 6 a.m.
From: Yue Tao <Yue.Tao@windriver.com>

The mod_dav_svn Apache HTTPD server module in Subversion 1.7.0 through
1.7.10 and 1.8.x before 1.8.1 allows remote authenticated users to cause
a denial of service (assertion failure or out-of-bounds read) via a
certain (1) COPY, (2) DELETE, or (3) MOVE request against a revision
root.

http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-4131

Signed-off-by: Yue Tao <Yue.Tao@windriver.com>
Signed-off-by: Roy Li <rongqing.li@windriver.com>
---
 .../subversion-CVE-2013-4131.patch                 |   42 ++++++++++++++++++++
 .../subversion/subversion_1.7.10.bb                |    1 +
 2 files changed, 43 insertions(+)
 create mode 100644 meta/recipes-devtools/subversion/subversion-1.7.10/subversion-CVE-2013-4131.patch

Patch

diff --git a/meta/recipes-devtools/subversion/subversion-1.7.10/subversion-CVE-2013-4131.patch b/meta/recipes-devtools/subversion/subversion-1.7.10/subversion-CVE-2013-4131.patch
new file mode 100644
index 0000000..88bd25e
--- /dev/null
+++ b/meta/recipes-devtools/subversion/subversion-1.7.10/subversion-CVE-2013-4131.patch
@@ -0,0 +1,42 @@ 
+Upstream-Status: Backport
+
+Index: subversion/mod_dav_svn/repos.c
+===================================================================
+--- a/subversion/mod_dav_svn/repos.c	(revision 1503527)
++++ b/subversion/mod_dav_svn/repos.c	(revision 1503528)
+@@ -2408,21 +2408,12 @@
+                 svn_boolean_t is_urlpath,
+                 apr_pool_t *pool)
+ {
+-  apr_size_t len;
+-  char *tmp = apr_pstrdup(pool, path);
+-
+-  len = strlen(tmp);
+-
+-  if (len > 0)
++  if (*path != '\0') /* not an empty string */
+     {
+-      /* Remove any trailing slash; else svn_path_dirname() asserts. */
+-      if (tmp[len-1] == '/')
+-        tmp[len-1] = '\0';
+-
+       if (is_urlpath)
+-        return svn_urlpath__dirname(tmp, pool);
++        return svn_urlpath__dirname(path, pool);
+       else
+-        return svn_fspath__dirname(tmp, pool);
++        return svn_fspath__dirname(path, pool);
+     }
+ 
+   return path;
+@@ -2458,7 +2449,9 @@
+       parent->versioned = 1;
+       parent->hooks = resource->hooks;
+       parent->pool = resource->pool;
+-      parent->uri = get_parent_path(resource->uri, TRUE, resource->pool);
++      parent->uri = get_parent_path(svn_urlpath__canonicalize(resource->uri,
++                                                              resource->pool),
++                                    TRUE, resource->pool);
+       parent->info = parentinfo;
+ 
+       parentinfo->uri_path =
diff --git a/meta/recipes-devtools/subversion/subversion_1.7.10.bb b/meta/recipes-devtools/subversion/subversion_1.7.10.bb
index 011d51b..2d06263 100644
--- a/meta/recipes-devtools/subversion/subversion_1.7.10.bb
+++ b/meta/recipes-devtools/subversion/subversion_1.7.10.bb
@@ -15,6 +15,7 @@  SRC_URI = "${APACHE_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
            file://allow-updated-neon.patch \
            file://neon.m4-fix-includes-and-cflags.patch \
            file://subversion-CVE-2013-4505.patch \
+           file://subversion-CVE-2013-4131.patch \
 "
 SRC_URI[md5sum] = "4088a77e14232876c9b4ff1541e6e200"
 SRC_URI[sha256sum] = "c1df222bec83d014d17785e2ceba6bc80962f64b280967de0285836d8d77a8e7"