X-Original-To: alpine-aports@lists.alpinelinux.org Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) by lists.alpinelinux.org (Postfix) with ESMTP id 8C7BA5C41B5 for ; Mon, 23 Jan 2017 09:37:15 +0000 (GMT) Received: by mail-lf0-f65.google.com with SMTP id h65so13510105lfi.3 for ; Mon, 23 Jan 2017 01:37:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ibuQJ68vceJ8WltiIE7/J6EbzJcpF2ikK9VytDjui/U=; b=cLmrG43saQ15v/Bbh/QWjv5Ac1jCV5Q/PPVU1r7d6/wJTvsAud0aghJHCvdq5F/vAG DRDHNZpMPcX630P3/xgtfJ5pcvjWLyE5tgcXySwwF4/9nnhF+qcQKDixFTE231PJ2Tm7 8XVOTf5biVpqEHpXjfJmnz7JMpPC39oXUI2a+Gufn1ROTmlClrPh6gZtdP+ybifxWQQc UpjB+MEUazWUq7yqlNqFrMJGKCrKYeDueo6lSi3trl2FnEtviC01Hhqts4EB3bNk66V6 KnnKmh85GY6F3AJGt3SZ7PFI8tIPH7bdD9uIY3e7G2mUtu+hLNddZ1jkJnQWm9BdEn3G AEgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ibuQJ68vceJ8WltiIE7/J6EbzJcpF2ikK9VytDjui/U=; b=SjbCZ4WjwazMPfy3N9YkoMNVoxQqysLOhNiCWnok+YLDOeiQKXBwyasGZnK7SHN65y OVQI2ertfkibsYIBAQAzdVd5ALu6em9JevOrDidTMNboDjTI/oXEyF6r/QzT5GeGOU/u TLMPAuzYsK9QdXMrjJbiRPfhLBXhc0Ikd9Vs+uMFMT30PL7e6x8gkPNx5PbGbX74g648 yfI83Cx4t5W1XDCrNLaE9k/Ygu+CPFdJVdW7yhaRB164PC0cCeIkGqvbjf1XL5LwF4AI Cl7KD0K7D50hkF2Y8cr6fvzkW6oE5hmgoiFJy8iALQW6O+vKkzmbqgBp8/pGn4a+w4Fn s9Rw== X-Gm-Message-State: AIkVDXJLDsanr7NBE43ENuJ9rMfmJjj+Zq6pEVF9ioNNtcfOMM7+yCftLSi6BtJPIwTeEQ== X-Received: by 10.25.127.2 with SMTP id a2mr8873776lfd.68.1485164234650; Mon, 23 Jan 2017 01:37:14 -0800 (PST) Received: from v3-2.util.wtbts.net ([83.145.235.199]) by smtp.gmail.com with ESMTPSA id 4sm6217092ljv.40.2017.01.23.01.37.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Jan 2017 01:37:13 -0800 (PST) From: Sergei Lukin To: alpine-aports@lists.alpinelinux.org Cc: Sergei Lukin Subject: [alpine-aports] [PATCH v3.2] main/guile: security fixes #6367 Date: Mon, 23 Jan 2017 09:37:07 +0000 Message-Id: <1485164227-204-1-git-send-email-sergej.lukin@gmail.com> X-Mailer: git-send-email 2.4.11 X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: CVE-2016-8605: Thread-unsafe umask modification --- main/guile/APKBUILD | 4 ++- main/guile/CVE-2016-8605.patch | 70 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 main/guile/CVE-2016-8605.patch diff --git a/main/guile/APKBUILD b/main/guile/APKBUILD index c4563e3..7fe67c8 100644 --- a/main/guile/APKBUILD +++ b/main/guile/APKBUILD @@ -1,7 +1,8 @@ +# Contributor: Sergei Lukin # Maintainer: Natanael Copa pkgname=guile pkgver=1.8.8 -pkgrel=2 +pkgrel=3 pkgdesc="Guile is a portable, embeddable Scheme implementation written in C" url="http://www.gnu.org/software/guile/" arch="all" @@ -13,6 +14,7 @@ install= source="ftp://ftp.gnu.org/pub/gnu/$pkgname/$pkgname-$pkgver.tar.gz guile-1.8.7-gcc45.patch fix-defines.patch + CVE-2016-8605.patch " _builddir="$srcdir"/$pkgname-$pkgver diff --git a/main/guile/CVE-2016-8605.patch b/main/guile/CVE-2016-8605.patch new file mode 100644 index 0000000..0f179ce --- /dev/null +++ b/main/guile/CVE-2016-8605.patch @@ -0,0 +1,70 @@ +CVE-2016-8605: Thread-unsafe umask modification +https://bugs.alpinelinux.org/issues/6367 +http://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=245608911698adb3472803856019bdd5670b6614 + +Remove 'umask' calls from 'mkdir'. +Fixes . + +* libguile/filesys.c (SCM_DEFINE): Remove calls to 'umask' when MODE is +unbound; instead, use 0777 as the mode. Update docstring to clarify +this. +* doc/ref/posix.texi (File System): Adjust accordingly. + +diff -ru guile-1.8.8.orig/doc/ref/posix.texi guile-1.8.8/doc/ref/posix.texi +--- guile-1.8.8.orig/doc/ref/posix.texi ++++ guile-1.8.8/doc/ref/posix.texi +@@ -815,9 +815,10 @@ + @deffn {Scheme Procedure} mkdir path [mode] + @deffnx {C Function} scm_mkdir (path, mode) + Create a new directory named by @var{path}. If @var{mode} is omitted +-then the permissions of the directory file are set using the current +-umask (@pxref{Processes}). Otherwise they are set to the decimal +-value specified with @var{mode}. The return value is unspecified. ++then the permissions of the directory are set to @code{#o777} ++masked with the current umask (@pxref{Processes, @code{umask}}). ++Otherwise they are set to the value specified with @var{mode}. ++The return value is unspecified. + @end deffn + + @deffn {Scheme Procedure} rmdir path +diff -ru guile-1.8.8.orig/libguile/filesys.c guile-1.8.8/libguile/filesys.c +--- guile-1.8.8.orig/libguile/filesys.c ++++ guile-1.8.8/libguile/filesys.c +@@ -790,27 +790,22 @@ + #ifdef HAVE_MKDIR + SCM_DEFINE (scm_mkdir, "mkdir", 1, 1, 0, + (SCM path, SCM mode), +- "Create a new directory named by @var{path}. If @var{mode} is omitted\n" +- "then the permissions of the directory file are set using the current\n" +- "umask. Otherwise they are set to the decimal value specified with\n" +- "@var{mode}. The return value is unspecified.") ++ "Create a new directory named by @var{path}. If @var{mode} is omitted\n" ++ "then the permissions of the directory are set to @code{#o777}\n" ++ "masked with the current umask (@pxref{Processes, @code{umask}}).\n" ++ "Otherwise they are set to the value specified with @var{mode}.\n" ++ "The return value is unspecified.") + #define FUNC_NAME s_scm_mkdir + { + int rv; +- mode_t mask; ++ mode_t c_mode; + +- if (SCM_UNBNDP (mode)) +- { +- mask = umask (0); +- umask (mask); +- STRING_SYSCALL (path, c_path, rv = mkdir (c_path, 0777 ^ mask)); +- } +- else +- { +- STRING_SYSCALL (path, c_path, rv = mkdir (c_path, scm_to_uint (mode))); +- } ++ c_mode = SCM_UNBNDP (mode) ? 0777 : scm_to_uint (mode); ++ ++ STRING_SYSCALL (path, c_path, rv = mkdir (c_path, c_mode)); + if (rv != 0) + SCM_SYSERROR; ++ + return SCM_UNSPECIFIED; + } + #undef FUNC_NAME -- 2.4.11 --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---