diff options
author | Nalin Dahyabhai <nalin@redhat.com> | 2011-02-08 15:01:34 -0500 |
---|---|---|
committer | Nalin Dahyabhai <nalin@redhat.com> | 2011-02-08 15:01:34 -0500 |
commit | 3888c74aa32e096786b0864695cc788784e5a50b (patch) | |
tree | e4c6ea08df440fd530e66caced507bae25f03926 | |
parent | 4ea64b866f2bb14ecf69282d9cd6bfc3db1d566e (diff) | |
download | krb5-3888c74aa32e096786b0864695cc788784e5a50b.tar.gz krb5-3888c74aa32e096786b0864695cc788784e5a50b.tar.xz krb5-3888c74aa32e096786b0864695cc788784e5a50b.zip |
- add upstream patches to fix standalone kpropd exiting if the per-clientkrb5-1.7.1-17.fc13
child process exits with an error (MITKRB5-SA-2011-001), and a hang or
crash in the KDC when using the LDAP kdb backend (MITKRB5-SA-2011-002)
(CVE-2010-4022, #664009, CVE-2011-0281, #668719, CVE-2011-0282, #668726)
-rw-r--r-- | 2011-001-patch.txt | 19 | ||||
-rw-r--r-- | 2011-002-patch.txt | 115 | ||||
-rw-r--r-- | krb5.spec | 12 |
3 files changed, 145 insertions, 1 deletions
diff --git a/2011-001-patch.txt b/2011-001-patch.txt new file mode 100644 index 0000000..1629f40 --- /dev/null +++ b/2011-001-patch.txt @@ -0,0 +1,19 @@ +diff -up krb5/src/slave/kpropd.c krb5/src/slave/kpropd.c +--- krb5/src/slave/kpropd.c 2010-12-17 11:14:26.000000000 -0500 ++++ krb5/src/slave/kpropd.c 2010-12-17 11:41:19.000000000 -0500 +@@ -404,11 +404,11 @@ retry: + } + + close(s); +- if (iproprole == IPROP_SLAVE) ++ if (iproprole == IPROP_SLAVE) { + close(finet); +- +- if ((ret = WEXITSTATUS(status)) != 0) +- return (ret); ++ if ((ret = WEXITSTATUS(status)) != 0) ++ return (ret); ++ } + } + if (iproprole == IPROP_SLAVE) + break; diff --git a/2011-002-patch.txt b/2011-002-patch.txt new file mode 100644 index 0000000..9f1bb84 --- /dev/null +++ b/2011-002-patch.txt @@ -0,0 +1,115 @@ +Original version, with dispatch.c section removed (not applicable before 1.9) +and fuzz cleaned up. + +diff --git a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.h b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.h +index d677bb2..a356907 100644 +--- a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.h ++++ b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.h +@@ -102,14 +102,18 @@ extern void prepend_err_str (krb5_context ctx, const char *s, krb5_error_code er + #define LDAP_SEARCH(base, scope, filter, attrs) LDAP_SEARCH_1(base, scope, filter, attrs, CHECK_STATUS) + + #define LDAP_SEARCH_1(base, scope, filter, attrs, status_check) \ +- do { \ +- st = ldap_search_ext_s(ld, base, scope, filter, attrs, 0, NULL, NULL, &timelimit, LDAP_NO_LIMIT, &result); \ +- if (translate_ldap_error(st, OP_SEARCH) == KRB5_KDB_ACCESS_ERROR) { \ +- tempst = krb5_ldap_rebind(ldap_context, &ldap_server_handle); \ +- if (ldap_server_handle) \ +- ld = ldap_server_handle->ldap_handle; \ +- } \ +- }while (translate_ldap_error(st, OP_SEARCH) == KRB5_KDB_ACCESS_ERROR && tempst == 0); \ ++ tempst = 0; \ ++ st = ldap_search_ext_s(ld, base, scope, filter, attrs, 0, NULL, \ ++ NULL, &timelimit, LDAP_NO_LIMIT, &result); \ ++ if (translate_ldap_error(st, OP_SEARCH) == KRB5_KDB_ACCESS_ERROR) { \ ++ tempst = krb5_ldap_rebind(ldap_context, &ldap_server_handle); \ ++ if (ldap_server_handle) \ ++ ld = ldap_server_handle->ldap_handle; \ ++ if (tempst == 0) \ ++ st = ldap_search_ext_s(ld, base, scope, filter, attrs, 0, \ ++ NULL, NULL, &timelimit, \ ++ LDAP_NO_LIMIT, &result); \ ++ } \ + \ + if (status_check != IGNORE_STATUS) { \ + if (tempst != 0) { \ +diff --git a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap_conn.c b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap_conn.c +index 82b0333..84e80ee 100644 +--- a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap_conn.c ++++ b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap_conn.c +@@ -302,6 +302,7 @@ krb5_ldap_rebind(krb5_ldap_context *ldap_context, + { + krb5_ldap_server_handle *handle = *ldap_server_handle; + ++ ldap_unbind_ext_s(handle->ldap_handle, NULL, NULL); + if ((ldap_initialize(&handle->ldap_handle, handle->server_info->server_name) != LDAP_SUCCESS) + || (krb5_ldap_bind(ldap_context, handle) != LDAP_SUCCESS)) + return krb5_ldap_request_next_handle_from_pool(ldap_context, ldap_server_handle); +diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c b/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c +index 86fa4d1..0f49c86 100644 +--- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c ++++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c +@@ -487,12 +487,11 @@ is_principal_in_realm(krb5_ldap_context *ldap_context, + * portion, then the first portion of the principal name SHOULD be + * "krbtgt". All this check is done in the immediate block. + */ +- if (searchfor->length == 2) +- if ((strncasecmp(searchfor->data[0].data, "krbtgt", +- FIND_MAX(searchfor->data[0].length, strlen("krbtgt"))) == 0) && +- (strncasecmp(searchfor->data[1].data, defrealm, +- FIND_MAX(searchfor->data[1].length, defrealmlen)) == 0)) ++ if (searchfor->length == 2) { ++ if (data_eq_string(searchfor->data[0], "krbtgt") && ++ data_eq_string(searchfor->data[1], defrealm)) + return 0; ++ } + + /* first check the length, if they are not equal, then they are not same */ + if (strlen(defrealm) != searchfor->realm.length) +diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c b/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c +index 140db1a..552e39a 100644 +--- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c ++++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c +@@ -78,10 +78,10 @@ krb5_ldap_get_principal(krb5_context context, krb5_const_principal searchfor, + int *nentries; /* how much room/how many found */ + krb5_boolean *more; /* are there more? */ + { +- char *user=NULL, *filter=NULL, **subtree=NULL; ++ char *user=NULL, *filter=NULL, *filtuser=NULL; + unsigned int tree=0, ntrees=1, princlen=0; + krb5_error_code tempst=0, st=0; +- char **values=NULL, *cname=NULL; ++ char **values=NULL, **subtree=NULL, *cname=NULL; + LDAP *ld=NULL; + LDAPMessage *result=NULL, *ent=NULL; + krb5_ldap_context *ldap_context=NULL; +@@ -115,12 +115,18 @@ krb5_ldap_get_principal(krb5_context context, krb5_const_principal searchfor, + if ((st=krb5_ldap_unparse_principal_name(user)) != 0) + goto cleanup; + +- princlen = strlen(FILTER) + strlen(user) + 2 + 1; /* 2 for closing brackets */ ++ filtuser = ldap_filter_correct(user); ++ if (filtuser == NULL) { ++ st = ENOMEM; ++ goto cleanup; ++ } ++ ++ princlen = strlen(FILTER) + strlen(filtuser) + 2 + 1; /* 2 for closing brackets */ + if ((filter = malloc(princlen)) == NULL) { + st = ENOMEM; + goto cleanup; + } +- snprintf(filter, princlen, FILTER"%s))", user); ++ snprintf(filter, princlen, FILTER"%s))", filtuser); + + if ((st = krb5_get_subtree_info(ldap_context, &subtree, &ntrees)) != 0) + goto cleanup; +@@ -207,6 +213,9 @@ cleanup: + if (user) + free(user); + ++ if (filtuser) ++ free(filtuser); ++ + if (cname) + free(cname); + @@ -10,7 +10,7 @@ Summary: The Kerberos network authentication system Name: krb5 Version: 1.7.1 -Release: 16%{?dist} +Release: 17%{?dist} # Maybe we should explode from the now-available-to-everybody tarball instead? # http://web.mit.edu/kerberos/dist/krb5/1.7/krb5-1.7.1-signed.tar Source0: krb5-%{version}.tar.gz @@ -92,6 +92,8 @@ Patch102: krb5-CVE-2010-1321-1.7.1.patch Patch103: krb5-1.7.1-24139.patch Patch104: krb5-1.7.1-explife.patch Patch105: http://web.mit.edu/kerberos/advisories/2010-007-patch-r17.txt +Patch106: http://web.mit.edu/kerberos/advisories/2011-001-patch.txt +Patch107: http://web.mit.edu/kerberos/advisories/2011-002-patch.txt License: MIT URL: http://web.mit.edu/kerberos/www/ @@ -230,6 +232,12 @@ to obtain initial credentials from a KDC using a private key and a certificate. %changelog +* Tue Feb 8 2011 Nalin Dahyabhai <nalin@redhat.com> 1.7.1-17 +- add upstream patches to fix standalone kpropd exiting if the per-client + child process exits with an error (MITKRB5-SA-2011-001), and a hang or + crash in the KDC when using the LDAP kdb backend (MITKRB5-SA-2011-002) + (CVE-2010-4022, #664009, CVE-2011-0281, #668719, CVE-2011-0282, #668726) + * Tue Nov 30 2010 Nalin Dahyabhai <nalin@redhat.com> 1.7.1-16 - add upstream patch to fix various issues from MITKRB5-SA-2010-007 (CVE-2010-1323, #648734, CVE-2010-1324, #648674) @@ -1668,6 +1676,8 @@ popd %patch103 -p1 -b .24139 %patch104 -p0 -b .explife %patch105 -p1 -b .2010-007 +%patch106 -p1 -b .2011-001 +%patch107 -p1 -b .2011-002 gzip doc/*.ps sed -i -e '1s!\[twoside\]!!;s!%\(\\usepackage{hyperref}\)!\1!' doc/api/library.tex |