Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (8a0fa2f84f29feef79454f0d1cc10e2695aa484a)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Pavel Vinogradov <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (8a0fa2f84f29feef79454f0d1cc10e2695aa484a)
  • Date: Sat, 13 Jan 2018 07:15:45 +0000

GIT changes to master grimoire by Pavel Vinogradov <public AT sourcemage.org>:

libs/glibc/DETAILS | 2 -
libs/glibc/HISTORY | 4 +++
libs/glibc/PRE_BUILD | 3 ++
libs/glibc/getcwd.patch | 58
++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 66 insertions(+), 1 deletion(-)

New commits:
commit 8a0fa2f84f29feef79454f0d1cc10e2695aa484a
Author: Pavel Vinogradov <public AT sourcemage.org>
Commit: Pavel Vinogradov <public AT sourcemage.org>

libs/glibc: SECURITY_PATCH++, fixed the CVE-2018-1000001

diff --git a/libs/glibc/DETAILS b/libs/glibc/DETAILS
index 8283ec3..7d0f4fe 100755
--- a/libs/glibc/DETAILS
+++ b/libs/glibc/DETAILS
@@ -37,7 +37,7 @@ SOURCE_DIRECTORY=$BUILD_DIRECTORY/$SPELL-$VERSION
SOURCE2_URL[0]=${SOURCE_URL[0]}.sig
SOURCE_GPG=glibc.gpg:$SOURCE.sig:UPSTREAM_KEY
SOURCE2_IGNORE=signature
- SECURITY_PATCH=10
+ SECURITY_PATCH=11
PATCHLEVEL=1
fi
if [[ $GLIBC_SANITIZE_HEADERS == n ]]; then
diff --git a/libs/glibc/HISTORY b/libs/glibc/HISTORY
index e1925f2..52a6857 100644
--- a/libs/glibc/HISTORY
+++ b/libs/glibc/HISTORY
@@ -1,3 +1,7 @@
+2018-01-13 Pavel Vinogradov <public AT sourcemage.org>
+ * DETAILS, PRE_BUILD, getcwd.patch: SECURITY_PATCH++,
+ (CVE-2018-1000001)
+
2016-12-26 Florian Franzmann <siflfran AT hawo.stw.uni-erlangen.de>
* INSTALL: create /usr/include/xlocale.h symlink

diff --git a/libs/glibc/PRE_BUILD b/libs/glibc/PRE_BUILD
index 2209e06..6703da5 100755
--- a/libs/glibc/PRE_BUILD
+++ b/libs/glibc/PRE_BUILD
@@ -101,6 +101,9 @@ patch -p1 < $SPELL_DIRECTORY/glibc-2.20-fhs-1.patch
# CVE-2017-15670 fix
patch -p1 < "${SPELL_DIRECTORY}/glob.patch"
&&

+# CVE-2018-1000001 fix
+patch -p1 < "${SPELL_DIRECTORY}/getcwd.patch"
&&
+
# disabled libgd detection/building memusagestat for now until a better
# fix has been found, bug #8277
#sedit 's/LIBGD=yes/LIBGD=no/' $SOURCE_DIRECTORY/configure &&
diff --git a/libs/glibc/getcwd.patch b/libs/glibc/getcwd.patch
new file mode 100644
index 0000000..41ce286
--- /dev/null
+++ b/libs/glibc/getcwd.patch
@@ -0,0 +1,58 @@
+From: Dmitry V. Levin <ldv AT altlinux.org>
+Date: Sun, 7 Jan 2018 02:03:41 +0000 (+0000)
+Subject: linux: make getcwd(3) fail if it cannot obtain an absolute path [BZ
#22679]
+X-Git-Url:
https://sourceware.org/git/?p=glibc.git;a=commitdiff_plain;h=52a713fdd0a30e1bd79818e2e3c4ab44ddca1a94
+
+linux: make getcwd(3) fail if it cannot obtain an absolute path [BZ #22679]
+
+Currently getcwd(3) can succeed without returning an absolute path
+because the underlying getcwd syscall, starting with linux commit
+v2.6.36-rc1~96^2~2, may succeed without returning an absolute path.
+
+This is a conformance issue because "The getcwd() function shall
+place an absolute pathname of the current working directory
+in the array pointed to by buf, and return buf".
+
+This is also a security issue because a non-absolute path returned
+by getcwd(3) causes a buffer underflow in realpath(3).
+
+Fix this by checking the path returned by getcwd syscall and falling
+back to generic_getcwd if the path is not absolute, effectively making
+getcwd(3) fail with ENOENT. The error code is chosen for consistency
+with the case when the current directory is unlinked.
+
+[BZ #22679]
+CVE-2018-1000001
+* sysdeps/unix/sysv/linux/getcwd.c (__getcwd): Fall back to
+generic_getcwd if the path returned by getcwd syscall is not absolute.
+* io/tst-getcwd-abspath.c: New test.
+* io/Makefile (tests): Add tst-getcwd-abspath.
+---
+
+diff --git a/sysdeps/unix/sysv/linux/getcwd.c
b/sysdeps/unix/sysv/linux/getcwd.c
+index f545106..866b9d2 100644 (file)
+--- a/sysdeps/unix/sysv/linux/getcwd.c
++++ b/sysdeps/unix/sysv/linux/getcwd.c
+@@ -76,7 +76,7 @@ __getcwd (char *buf, size_t size)
+ int retval;
+
+ retval = INLINE_SYSCALL (getcwd, 2, path, alloc_size);
+- if (retval >= 0)
++ if (retval > 0 && path[0] == '/')
+ {
+ #ifndef NO_ALLOCATION
+ if (buf == NULL && size == 0)
+@@ -92,10 +92,10 @@ __getcwd (char *buf, size_t size)
+ return buf;
+ }
+
+- /* The system call cannot handle paths longer than a page.
+- Neither can the magic symlink in /proc/self. Just use the
++ /* The system call either cannot handle paths longer than a page
++ or can succeed without returning an absolute path. Just use the
+ generic implementation right away. */
+- if (errno == ENAMETOOLONG)
++ if (retval >= 0 || errno == ENAMETOOLONG)
+ {
+ #ifndef NO_ALLOCATION
+ if (buf == NULL && size == 0)



  • [SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (8a0fa2f84f29feef79454f0d1cc10e2695aa484a), Pavel Vinogradov, 01/13/2018

Archive powered by MHonArc 2.6.24.

Top of Page