summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/openssh/openssh/CVE-2016-6210_p3.patch
diff options
context:
space:
mode:
authorArmin Kuster <akuster@mvista.com>2016-09-17 20:58:40 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-23 15:27:05 +0100
commit414aad04b631baddfc8e3dd02c305da0ddf9b883 (patch)
tree4e91d6a6b5dfaa82bc9eb3dc7cfb4e014c5a9ffb /meta/recipes-connectivity/openssh/openssh/CVE-2016-6210_p3.patch
parent8a7607f470ae2a63e9c7b0caddd0db2f6b259053 (diff)
downloadpoky-414aad04b631baddfc8e3dd02c305da0ddf9b883.tar.gz
openssh: Security fix CVE-2016-6210
affects openssh < 7.3 (From OE-Core rev: 3bc2ea285637894d158d951ed721c54c1f1af4c3) Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/openssh/openssh/CVE-2016-6210_p3.patch')
-rw-r--r--meta/recipes-connectivity/openssh/openssh/CVE-2016-6210_p3.patch62
1 files changed, 62 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssh/openssh/CVE-2016-6210_p3.patch b/meta/recipes-connectivity/openssh/openssh/CVE-2016-6210_p3.patch
new file mode 100644
index 0000000000..790ec808be
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/CVE-2016-6210_p3.patch
@@ -0,0 +1,62 @@
1From dbf788b4d9d9490a5fff08a7b09888272bb10fcc Mon Sep 17 00:00:00 2001
2From: Darren Tucker <dtucker@zip.com.au>
3Date: Thu, 21 Jul 2016 14:17:31 +1000
4Subject: [PATCH] Search users for one with a valid salt.
5
6If the root account is locked (eg password "!!" or "*LK*") keep looking
7until we find a user with a valid salt to use for crypting passwords of
8invalid users. ok djm@
9
10Upstream-Status: Backport
11CVE: CVE-2016-6210
12Signed-off-by: Armin Kuster <akuster@mvista.com>
13
14---
15 openbsd-compat/xcrypt.c | 24 +++++++++++++++---------
16 1 file changed, 15 insertions(+), 9 deletions(-)
17
18diff --git a/openbsd-compat/xcrypt.c b/openbsd-compat/xcrypt.c
19index 8913bb8..cf6a9b9 100644
20--- a/openbsd-compat/xcrypt.c
21+++ b/openbsd-compat/xcrypt.c
22@@ -65,7 +65,9 @@
23
24 /*
25 * Pick an appropriate password encryption type and salt for the running
26- * system.
27+ * system by searching through accounts until we find one that has a valid
28+ * salt. Usually this will be root unless the root account is locked out.
29+ * If we don't find one we return a traditional DES-based salt.
30 */
31 static const char *
32 pick_salt(void)
33@@ -78,14 +80,18 @@ pick_salt(void)
34 if (salt[0] != '\0')
35 return salt;
36 strlcpy(salt, "xx", sizeof(salt));
37- if ((pw = getpwuid(0)) == NULL)
38- return salt;
39- passwd = shadow_pw(pw);
40- if (passwd[0] != '$' || (p = strrchr(passwd + 1, '$')) == NULL)
41- return salt; /* no $, DES */
42- typelen = p - passwd + 1;
43- strlcpy(salt, passwd, MIN(typelen, sizeof(salt)));
44- explicit_bzero(passwd, strlen(passwd));
45+ setpwent();
46+ while ((pw = getpwent()) != NULL) {
47+ passwd = shadow_pw(pw);
48+ if (passwd[0] == '$' && (p = strrchr(passwd+1, '$')) != NULL) {
49+ typelen = p - passwd + 1;
50+ strlcpy(salt, passwd, MIN(typelen, sizeof(salt)));
51+ explicit_bzero(passwd, strlen(passwd));
52+ goto out;
53+ }
54+ }
55+ out:
56+ endpwent();
57 return salt;
58 }
59
60--
612.7.4
62