git.iko.soy/typeable/nixpkgs
on master help sign in
guile-1.8: fix CVE-2016-8605

Backports 245608911698adb3472803856019bdd5670b6614 from guile.git Fixes https://github.com/NixOS/nixpkgs/issues/73648 Signed-off-by: Masanori Ogino <167209+omasanori@users.noreply.github.com>

commit8d213e1ff98b582b5f796dcb31d4818e7c2f529e authorMasanori Ogino <167209+omasanori@users.noreply.github.com> dateTue 23 Feb 2021, 16:53 (6 years ago) parentc670db3
2 files changed+63−1
pkgs/development/interpreters/guile/1.8.nix+4−1 pkgs/development/interpreters/guile/CVE-2016-8605.patch+59
pkgs/development/interpreters/guile/1.8.nix+4−1
@@ -37,7 +37,10 @@ stdenv.mkDerivation rec {
3737 libtool
3838 ];
3939
40− patches = [ ./cpp-4.5.patch ];
40+ patches = [
41+ ./cpp-4.5.patch
42+ ./CVE-2016-8605.patch
43+ ];
4144
4245 preBuild = ''
4346 sed -e '/lt_dlinit/a lt_dladdsearchdir("'$out/lib'");' -i libguile/dynl.c
pkgs/development/interpreters/guile/CVE-2016-8605.patchnew file+59
@@ -0,0 +1,59 @@
1+commit d514e3fc42eb14a1bc5846b27ef89f50ba3a5d48
2+Author: Ludovic Courtès <ludo@gnu.org>
3+Date: Tue Oct 11 10:14:26 2016 +0200
4+
5+ Remove 'umask' calls from 'mkdir'.
6+
7+ Fixes <http://bugs.gnu.org/24659>.
8+
9+ * libguile/filesys.c (SCM_DEFINE): Remove calls to 'umask' when MODE is
10+ unbound; instead, use 0777 as the mode. Update docstring to clarify
11+ this.
12+
13+diff --git a/libguile/filesys.c b/libguile/filesys.c
14+index c8acb13ef..921f765f1 100644
15+--- a/libguile/filesys.c
16++++ b/libguile/filesys.c
17+@@ -1,4 +1,5 @@
18+-/* Copyright (C) 1996,1997,1998,1999,2000,2001, 2002, 2004, 2006, 2008 Free Software Foundation, Inc.
19++/* Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2006,
20++ * 2009, 2010, 2011, 2012, 2013, 2014, 2016 Free Software Foundation, Inc.
21+ *
22+ * This library is free software; you can redistribute it and/or
23+ * modify it under the terms of the GNU Lesser General Public
24+@@ -791,26 +792,21 @@ SCM_DEFINE (scm_delete_file, "delete-file", 1, 0, 0,
25+ SCM_DEFINE (scm_mkdir, "mkdir", 1, 1, 0,
26+ (SCM path, SCM mode),
27+ "Create a new directory named by @var{path}. If @var{mode} is omitted\n"
28+- "then the permissions of the directory file are set using the current\n"
29+- "umask. Otherwise they are set to the decimal value specified with\n"
30+- "@var{mode}. The return value is unspecified.")
31++ "then the permissions of the directory are set to @code{#o777}\n"
32++ "masked with the current umask (@pxref{Processes, @code{umask}}).\n"
33++ "Otherwise they are set to the value specified with @var{mode}.\n"
34++ "The return value is unspecified.")
35+ #define FUNC_NAME s_scm_mkdir
36+ {
37+ int rv;
38+- mode_t mask;
39++ mode_t c_mode;
40+
41+- if (SCM_UNBNDP (mode))
42+- {
43+- mask = umask (0);
44+- umask (mask);
45+- STRING_SYSCALL (path, c_path, rv = mkdir (c_path, 0777 ^ mask));
46+- }
47+- else
48+- {
49+- STRING_SYSCALL (path, c_path, rv = mkdir (c_path, scm_to_uint (mode)));
50+- }
51++ c_mode = SCM_UNBNDP (mode) ? 0777 : scm_to_uint (mode);
52++
53++ STRING_SYSCALL (path, c_path, rv = mkdir (c_path, c_mode));
54+ if (rv != 0)
55+ SCM_SYSERROR;
56++
57+ return SCM_UNSPECIFIED;
58+ }
59+ #undef FUNC_NAME