summaryrefslogtreecommitdiff
path: root/debian/patches/backport-pam-use-after-free.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/backport-pam-use-after-free.patch')
-rw-r--r--debian/patches/backport-pam-use-after-free.patch39
1 files changed, 0 insertions, 39 deletions
diff --git a/debian/patches/backport-pam-use-after-free.patch b/debian/patches/backport-pam-use-after-free.patch
deleted file mode 100644
index 4baecfe1b..000000000
--- a/debian/patches/backport-pam-use-after-free.patch
+++ /dev/null
@@ -1,39 +0,0 @@
1From fddd7fcb2ccb2cfdd88328d1149c0c31fcf21447 Mon Sep 17 00:00:00 2001
2From: Damien Miller <djm@mindrot.org>
3Date: Tue, 11 Aug 2015 13:34:12 +1000
4Subject: set sshpam_ctxt to NULL after free
5
6Avoids use-after-free in monitor when privsep child is compromised.
7Reported by Moritz Jodeit; ok dtucker@
8
9Origin: upstream, https://anongit.mindrot.org/openssh.git/commit/?id=5e75f5198769056089fb06c4d738ab0e5abc66f7
10Forwarded: not-needed
11Last-Update: 2015-08-19
12
13Patch-Name: backport-pam-use-after-free.patch
14---
15 monitor.c | 4 +++-
16 1 file changed, 3 insertions(+), 1 deletion(-)
17
18diff --git a/monitor.c b/monitor.c
19index 3fc9253..c063ad1 100644
20--- a/monitor.c
21+++ b/monitor.c
22@@ -1209,14 +1209,16 @@ mm_answer_pam_respond(int sock, Buffer *m)
23 int
24 mm_answer_pam_free_ctx(int sock, Buffer *m)
25 {
26+ int r = sshpam_authok != NULL && sshpam_authok == sshpam_ctxt;
27
28 debug3("%s", __func__);
29 (sshpam_device.free_ctx)(sshpam_ctxt);
30+ sshpam_ctxt = sshpam_authok = NULL;
31 buffer_clear(m);
32 mm_request_send(sock, MONITOR_ANS_PAM_FREE_CTX, m);
33 auth_method = "keyboard-interactive";
34 auth_submethod = "pam";
35- return (sshpam_authok == sshpam_ctxt);
36+ return r;
37 }
38 #endif
39