diff options
author | Roy.Li <rongqing.li@windriver.com> | 2013-06-14 15:02:51 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-06-17 16:45:36 +0100 |
commit | 58256120e803c210c5168262def5c65b4967b624 (patch) | |
tree | 428d3cbeec70e00b2441ca8897b1b135514088b7 /meta/recipes-connectivity/openssh | |
parent | 7346d891f27089ffcfb7c576a6a81c62394db051 (diff) | |
download | poky-58256120e803c210c5168262def5c65b4967b624.tar.gz |
openssh: fix a unaligned memory access issue
Backport patch to fix segment fault due to unaligned memory access
(From OE-Core rev: c2ce8e3bc10aec4cb53faea091ad867bab405bb7)
Signed-off-by: Roy.Li <rongqing.li@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/openssh')
-rw-r--r-- | meta/recipes-connectivity/openssh/openssh-6.2p2/mac.patch | 76 | ||||
-rw-r--r-- | meta/recipes-connectivity/openssh/openssh_6.2p2.bb | 1 |
2 files changed, 77 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssh/openssh-6.2p2/mac.patch b/meta/recipes-connectivity/openssh/openssh-6.2p2/mac.patch new file mode 100644 index 0000000000..69fb69daeb --- /dev/null +++ b/meta/recipes-connectivity/openssh/openssh-6.2p2/mac.patch | |||
@@ -0,0 +1,76 @@ | |||
1 | [PATCH] force the MAC output to be 64-bit aligned | ||
2 | |||
3 | Upstream-Status: Backport[anoncvs.mindrot.org/index.cgi/openssh/mac.c?r1=1.27&r2=1.28] | ||
4 | |||
5 | Backport patch to fix segment fault due to unaligned memory access | ||
6 | |||
7 | Wed Jun 5 22:12:37 2013 UTC (7 days, 3 hours ago) by dtucker | ||
8 | Branch: MAIN | ||
9 | CVS Tags: HEAD | ||
10 | Changes since 1.27: +11 -8 lines | ||
11 | Diff to previous 1.27 | ||
12 | |||
13 | - dtucker@cvs.openbsd.org 2013/06/03 00:03:18 | ||
14 | [mac.c] | ||
15 | force the MAC output to be 64-bit aligned so umac won't see | ||
16 | unaligned | ||
17 | accesses on strict-alignment architectures. bz#2101, patch from | ||
18 | tomas.kuthan at oracle.com, ok djm@ | ||
19 | --- | ||
20 | mac.c | 18 +++++++++++------- | ||
21 | 1 file changed, 11 insertions(+), 7 deletions(-) | ||
22 | |||
23 | diff --git a/mac.c b/mac.c | ||
24 | index 3f2dc6f..a5a80d3 100644 | ||
25 | --- a/mac.c | ||
26 | +++ b/mac.c | ||
27 | @@ -152,12 +152,16 @@ mac_init(Mac *mac) | ||
28 | u_char * | ||
29 | mac_compute(Mac *mac, u_int32_t seqno, u_char *data, int datalen) | ||
30 | { | ||
31 | - static u_char m[EVP_MAX_MD_SIZE]; | ||
32 | + static union { | ||
33 | + u_char m[EVP_MAX_MD_SIZE]; | ||
34 | + u_int64_t for_align; | ||
35 | + } u; | ||
36 | + | ||
37 | u_char b[4], nonce[8]; | ||
38 | |||
39 | - if (mac->mac_len > sizeof(m)) | ||
40 | + if (mac->mac_len > sizeof(u)) | ||
41 | fatal("mac_compute: mac too long %u %lu", | ||
42 | - mac->mac_len, (u_long)sizeof(m)); | ||
43 | + mac->mac_len, (u_long)sizeof(u)); | ||
44 | |||
45 | switch (mac->type) { | ||
46 | case SSH_EVP: | ||
47 | @@ -166,22 +170,22 @@ mac_compute(Mac *mac, u_int32_t seqno, u_char *data, int datalen) | ||
48 | HMAC_Init(&mac->evp_ctx, NULL, 0, NULL); | ||
49 | HMAC_Update(&mac->evp_ctx, b, sizeof(b)); | ||
50 | HMAC_Update(&mac->evp_ctx, data, datalen); | ||
51 | - HMAC_Final(&mac->evp_ctx, m, NULL); | ||
52 | + HMAC_Final(&mac->evp_ctx, u.m, NULL); | ||
53 | break; | ||
54 | case SSH_UMAC: | ||
55 | put_u64(nonce, seqno); | ||
56 | umac_update(mac->umac_ctx, data, datalen); | ||
57 | - umac_final(mac->umac_ctx, m, nonce); | ||
58 | + umac_final(mac->umac_ctx, u.m, nonce); | ||
59 | break; | ||
60 | case SSH_UMAC128: | ||
61 | put_u64(nonce, seqno); | ||
62 | umac128_update(mac->umac_ctx, data, datalen); | ||
63 | - umac128_final(mac->umac_ctx, m, nonce); | ||
64 | + umac128_final(mac->umac_ctx, u.m, nonce); | ||
65 | break; | ||
66 | default: | ||
67 | fatal("mac_compute: unknown MAC type"); | ||
68 | } | ||
69 | - return (m); | ||
70 | + return (u.m); | ||
71 | } | ||
72 | |||
73 | void | ||
74 | -- | ||
75 | 1.7.9.5 | ||
76 | |||
diff --git a/meta/recipes-connectivity/openssh/openssh_6.2p2.bb b/meta/recipes-connectivity/openssh/openssh_6.2p2.bb index 06297da007..0459032afe 100644 --- a/meta/recipes-connectivity/openssh/openssh_6.2p2.bb +++ b/meta/recipes-connectivity/openssh/openssh_6.2p2.bb | |||
@@ -25,6 +25,7 @@ SRC_URI = "ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar. | |||
25 | file://ssh_config \ | 25 | file://ssh_config \ |
26 | file://init \ | 26 | file://init \ |
27 | file://openssh-CVE-2011-4327.patch \ | 27 | file://openssh-CVE-2011-4327.patch \ |
28 | file://mac.patch \ | ||
28 | ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)}" | 29 | ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)}" |
29 | 30 | ||
30 | PAM_SRC_URI = "file://sshd" | 31 | PAM_SRC_URI = "file://sshd" |