summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGyorgy Sarvari <skandigraun@gmail.com>2025-10-05 12:33:13 +0200
committerAnuj Mittal <anuj.mittal@intel.com>2025-10-06 16:10:53 +0800
commit065ff230496e7ae1644713c108d45eefe37d0495 (patch)
treee5c6dda7fbb6d093feb092200a0fb886e253e489
parent64981bc05763a6772740afbbab365eb90e63f3f0 (diff)
downloadmeta-openembedded-065ff230496e7ae1644713c108d45eefe37d0495.tar.gz
dovecot: patch CVE-2022-30550
Details: https://nvd.nist.gov/vuln/detail/CVE-2022-30550 Pick the commit referenced in https://www.openwall.com/lists/oss-security/2022/07/08/1 Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
-rw-r--r--meta-networking/recipes-support/dovecot/dovecot/0001-auth-Fix-handling-passdbs-with-identical-driver-args.patch137
-rw-r--r--meta-networking/recipes-support/dovecot/dovecot_2.3.21.bb1
2 files changed, 138 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/dovecot/dovecot/0001-auth-Fix-handling-passdbs-with-identical-driver-args.patch b/meta-networking/recipes-support/dovecot/dovecot/0001-auth-Fix-handling-passdbs-with-identical-driver-args.patch
new file mode 100644
index 0000000000..2adbee491e
--- /dev/null
+++ b/meta-networking/recipes-support/dovecot/dovecot/0001-auth-Fix-handling-passdbs-with-identical-driver-args.patch
@@ -0,0 +1,137 @@
1From 30be738858f6e0b314717ea7ceb24fee165ce642 Mon Sep 17 00:00:00 2001
2From: Timo Sirainen <timo.sirainen@open-xchange.com>
3Date: Mon, 9 May 2022 15:23:33 +0300
4Subject: [PATCH] auth: Fix handling passdbs with identical driver/args but
5 different mechanisms/username_filter
6
7The passdb was wrongly deduplicated in this situation, causing wrong
8mechanisms or username_filter setting to be used. This would be a rather
9unlikely configuration though.
10
11Fixed by moving mechanisms and username_filter from struct passdb_module
12to struct auth_passdb, which is where they should have been in the first
13place.
14
15CVE: CVE-2022-30550
16
17Upstream-Status: Backport [https://github.com/dovecot/core/commit/7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904]
18
19Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
20---
21 src/auth/auth-request.c | 6 +++---
22 src/auth/auth.c | 18 ++++++++++++++++++
23 src/auth/auth.h | 5 +++++
24 src/auth/passdb.c | 15 ++-------------
25 src/auth/passdb.h | 4 ----
26 5 files changed, 28 insertions(+), 20 deletions(-)
27
28diff --git a/src/auth/auth-request.c b/src/auth/auth-request.c
29index 635ee20..fab655e 100644
30--- a/src/auth/auth-request.c
31+++ b/src/auth/auth-request.c
32@@ -560,8 +560,8 @@ auth_request_want_skip_passdb(struct auth_request *request,
33 struct auth_passdb *passdb)
34 {
35 /* if mechanism is not supported, skip */
36- const char *const *mechs = passdb->passdb->mechanisms;
37- const char *const *username_filter = passdb->passdb->username_filter;
38+ const char *const *mechs = passdb->mechanisms;
39+ const char *const *username_filter = passdb->username_filter;
40 const char *username;
41
42 username = request->fields.user;
43@@ -574,7 +574,7 @@ auth_request_want_skip_passdb(struct auth_request *request,
44 return TRUE;
45 }
46
47- if (passdb->passdb->username_filter != NULL &&
48+ if (passdb->username_filter != NULL &&
49 !auth_request_username_accepted(username_filter, username)) {
50 auth_request_log_debug(request,
51 request->mech != NULL ? AUTH_SUBSYS_MECH
52diff --git a/src/auth/auth.c b/src/auth/auth.c
53index 845c43c..a5a4c81 100644
54--- a/src/auth/auth.c
55+++ b/src/auth/auth.c
56@@ -93,6 +93,24 @@ auth_passdb_preinit(struct auth *auth, const struct auth_passdb_settings *set,
57 auth_passdb->override_fields_tmpl =
58 passdb_template_build(auth->pool, set->override_fields);
59
60+ if (*set->mechanisms == '\0') {
61+ auth_passdb->mechanisms = NULL;
62+ } else if (strcasecmp(set->mechanisms, "none") == 0) {
63+ auth_passdb->mechanisms = (const char *const[]){ NULL };
64+ } else {
65+ auth_passdb->mechanisms =
66+ (const char *const *)p_strsplit_spaces(auth->pool,
67+ set->mechanisms, " ,");
68+ }
69+
70+ if (*set->username_filter == '\0') {
71+ auth_passdb->username_filter = NULL;
72+ } else {
73+ auth_passdb->username_filter =
74+ (const char *const *)p_strsplit_spaces(auth->pool,
75+ set->username_filter, " ,");
76+ }
77+
78 /* for backwards compatibility: */
79 if (set->pass)
80 auth_passdb->result_success = AUTH_DB_RULE_CONTINUE;
81diff --git a/src/auth/auth.h b/src/auth/auth.h
82index 3ca5a9b..6208e4d 100644
83--- a/src/auth/auth.h
84+++ b/src/auth/auth.h
85@@ -41,6 +41,11 @@ struct auth_passdb {
86 struct passdb_template *default_fields_tmpl;
87 struct passdb_template *override_fields_tmpl;
88
89+ /* Supported authentication mechanisms, NULL is all, {NULL} is none */
90+ const char *const *mechanisms;
91+ /* Username filter, NULL is no filter */
92+ const char *const *username_filter;
93+
94 enum auth_passdb_skip skip;
95 enum auth_db_rule result_success;
96 enum auth_db_rule result_failure;
97diff --git a/src/auth/passdb.c b/src/auth/passdb.c
98index 9bc2b87..d3c61cc 100644
99--- a/src/auth/passdb.c
100+++ b/src/auth/passdb.c
101@@ -224,19 +224,8 @@ passdb_preinit(pool_t pool, const struct auth_passdb_settings *set)
102 passdb->id = ++auth_passdb_id;
103 passdb->iface = *iface;
104 passdb->args = p_strdup(pool, set->args);
105- if (*set->mechanisms == '\0') {
106- passdb->mechanisms = NULL;
107- } else if (strcasecmp(set->mechanisms, "none") == 0) {
108- passdb->mechanisms = (const char *const[]){NULL};
109- } else {
110- passdb->mechanisms = (const char* const*)p_strsplit_spaces(pool, set->mechanisms, " ,");
111- }
112-
113- if (*set->username_filter == '\0') {
114- passdb->username_filter = NULL;
115- } else {
116- passdb->username_filter = (const char* const*)p_strsplit_spaces(pool, set->username_filter, " ,");
117- }
118+ /* NOTE: if anything else than driver & args are added here,
119+ passdb_find() also needs to be updated. */
120 array_push_back(&passdb_modules, &passdb);
121 return passdb;
122 }
123diff --git a/src/auth/passdb.h b/src/auth/passdb.h
124index f9b33ea..f515b1d 100644
125--- a/src/auth/passdb.h
126+++ b/src/auth/passdb.h
127@@ -63,10 +63,6 @@ struct passdb_module {
128 /* Default password scheme for this module.
129 If default_cache_key is set, must not be NULL. */
130 const char *default_pass_scheme;
131- /* Supported authentication mechanisms, NULL is all, [NULL] is none*/
132- const char *const *mechanisms;
133- /* Username filter, NULL is no filter */
134- const char *const *username_filter;
135
136 /* If blocking is set to TRUE, use child processes to access
137 this passdb. */
diff --git a/meta-networking/recipes-support/dovecot/dovecot_2.3.21.bb b/meta-networking/recipes-support/dovecot/dovecot_2.3.21.bb
index 17fbd789b6..c626f26457 100644
--- a/meta-networking/recipes-support/dovecot/dovecot_2.3.21.bb
+++ b/meta-networking/recipes-support/dovecot/dovecot_2.3.21.bb
@@ -11,6 +11,7 @@ SRC_URI = "http://dovecot.org/releases/2.3/dovecot-${PV}.tar.gz \
11 file://dovecot.socket \ 11 file://dovecot.socket \
12 file://0001-not-check-pandoc.patch \ 12 file://0001-not-check-pandoc.patch \
13 file://0001-m4-Check-for-libunwind-instead-of-libunwind-generic.patch \ 13 file://0001-m4-Check-for-libunwind-instead-of-libunwind-generic.patch \
14 file://0001-auth-Fix-handling-passdbs-with-identical-driver-args.patch \
14 " 15 "
15SRC_URI[sha256sum] = "05b11093a71c237c2ef309ad587510721cc93bbee6828251549fc1586c36502d" 16SRC_URI[sha256sum] = "05b11093a71c237c2ef309ad587510721cc93bbee6828251549fc1586c36502d"
16 17