[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
15/17: gnu: guile-ssh: Fix potential double-free/use-after-free issue.
From: |
Ludovic Courtès |
Subject: |
15/17: gnu: guile-ssh: Fix potential double-free/use-after-free issue. |
Date: |
Sat, 20 May 2017 04:24:06 -0400 (EDT) |
civodul pushed a commit to branch version-0.13.0
in repository guix.
commit c383dc520f4b71bcb99115768bfafa00df85f9d1
Author: Ludovic Courtès <address@hidden>
Date: Fri May 19 10:50:20 2017 +0200
gnu: guile-ssh: Fix potential double-free/use-after-free issue.
Fixes <http://bugs.gnu.org/26976>.
Reported by Mark H Weaver <address@hidden>.
* gnu/packages/patches/guile-ssh-double-free.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/ssh.scm (guile-ssh)[source](patches): Add it.
---
gnu/local.mk | 1 +
gnu/packages/patches/guile-ssh-double-free.patch | 37 ++++++++++++++++++++++++
gnu/packages/ssh.scm | 3 +-
3 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/gnu/local.mk b/gnu/local.mk
index ca26bcd..f1a3cf6 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -651,6 +651,7 @@ dist_patch_DATA =
\
%D%/packages/patches/guile-relocatable.patch \
%D%/packages/patches/guile-rsvg-pkgconfig.patch \
%D%/packages/patches/guile-ssh-rexec-bug.patch \
+ %D%/packages/patches/guile-ssh-double-free.patch \
%D%/packages/patches/gtk2-respect-GUIX_GTK2_PATH.patch \
%D%/packages/patches/gtk2-respect-GUIX_GTK2_IM_MODULE_FILE.patch \
%D%/packages/patches/gtk2-theme-paths.patch \
diff --git a/gnu/packages/patches/guile-ssh-double-free.patch
b/gnu/packages/patches/guile-ssh-double-free.patch
new file mode 100644
index 0000000..9692b81
--- /dev/null
+++ b/gnu/packages/patches/guile-ssh-double-free.patch
@@ -0,0 +1,37 @@
+Fix a double-free or use-after-free issue with Guile-SSH used
+with Guile 2.2. See <https://bugs.gnu.org/26976>.
+
+diff --git a/libguile-ssh/channel-type.c b/libguile-ssh/channel-type.c
+index 3dd641f..0839854 100644
+--- a/libguile-ssh/channel-type.c
++++ b/libguile-ssh/channel-type.c
+@@ -229,10 +229,11 @@ ptob_close (SCM channel)
+ ssh_channel_free (ch->ssh_channel);
+ }
+
++ SCM_SETSTREAM (channel, NULL);
++
+ #if USING_GUILE_BEFORE_2_2
+ scm_gc_free (pt->write_buf, pt->write_buf_size, "port write buffer");
+ scm_gc_free (pt->read_buf, pt->read_buf_size, "port read buffer");
+- SCM_SETSTREAM (channel, NULL);
+
+ return 0;
+ #endif
+diff --git a/libguile-ssh/sftp-file-type.c b/libguile-ssh/sftp-file-type.c
+index 8879924..f87cf03 100644
+--- a/libguile-ssh/sftp-file-type.c
++++ b/libguile-ssh/sftp-file-type.c
+@@ -224,10 +224,11 @@ ptob_close (SCM sftp_file)
+ sftp_close (fd->file);
+ }
+
++ SCM_SETSTREAM (sftp_file, NULL);
++
+ #if USING_GUILE_BEFORE_2_2
+ scm_gc_free (pt->write_buf, pt->write_buf_size, "port write buffer");
+ scm_gc_free (pt->read_buf, pt->read_buf_size, "port read buffer");
+- SCM_SETSTREAM (sftp_file, NULL);
+
+ return 1;
+ #endif
diff --git a/gnu/packages/ssh.scm b/gnu/packages/ssh.scm
index 6a074d1..bb18987 100644
--- a/gnu/packages/ssh.scm
+++ b/gnu/packages/ssh.scm
@@ -226,7 +226,8 @@ Additionally, various channel-specific options can be
negotiated.")
(sha256
(base32
"0r261i8kc3avbmbwgyzak2vnqwssjlgz37g2y2fwm80w9bmn2m7j"))
- (patches (search-patches "guile-ssh-rexec-bug.patch"))
+ (patches (search-patches "guile-ssh-rexec-bug.patch"
+ "guile-ssh-double-free.patch"))
(modules '((guix build utils)))
(snippet
;; 'configure.ac' mistakenly tries to link files from examples/
- branch version-0.13.0 updated (920803f -> 03119da), Ludovic Courtès, 2017/05/20
- 04/17: profiles: Add elapsed time to manual-database hook to output message., Ludovic Courtès, 2017/05/20
- 01/17: gnu: tor: Update to 0.3.0.7., Ludovic Courtès, 2017/05/20
- 02/17: gnu: glibc/hurd: Use modify-phases syntax., Ludovic Courtès, 2017/05/20
- 03/17: gnu: glibc/hurd: Do not apply i686 patch., Ludovic Courtès, 2017/05/20
- 06/17: build: Compile stackage only if 'guile-json' is available., Ludovic Courtès, 2017/05/20
- 09/17: services: openssh: Don't depend on networking., Ludovic Courtès, 2017/05/20
- 11/17: services: user-homes: Do not create home directories marked as no-create., Ludovic Courtès, 2017/05/20
- 10/17: install: Enable SSH in installation image., Ludovic Courtès, 2017/05/20
- 15/17: gnu: guile-ssh: Fix potential double-free/use-after-free issue.,
Ludovic Courtès <=
- 07/17: gnu: aspell: 'dict-dir' set to ~/.guix-profile/lib/aspell or $ASPELL_DICT_DIR., Ludovic Courtès, 2017/05/20
- 14/17: modules: Add more source-less modules., Ludovic Courtès, 2017/05/20
- 12/17: union: Gracefully handle dangling symlinks in the input., Ludovic Courtès, 2017/05/20
- 13/17: publish: Fix narinfo rendering for already-compressed items., Ludovic Courtès, 2017/05/20
- 17/17: vm: Support creating FAT partitions., Ludovic Courtès, 2017/05/20
- 05/17: gnu: qemu: Fix CVE-2017-7493., Ludovic Courtès, 2017/05/20
- 08/17: maint: The 'release' target builds a VM image., Ludovic Courtès, 2017/05/20
- 16/17: vm: Support arbitrary partition flags., Ludovic Courtès, 2017/05/20