summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support
diff options
context:
space:
mode:
authorGyorgy Sarvari <skandigraun@gmail.com>2025-10-05 12:50:26 +0200
committerGyorgy Sarvari <skandigraun@gmail.com>2025-10-12 13:08:33 +0200
commit91a9a3d61f4ea3f0be960b069f84ef3462696379 (patch)
treef177404f5b135f2c12b82a552429482b03144f13 /meta-networking/recipes-support
parentb157fa04127d93164027b1b6f2b23063c8aa9192 (diff)
downloadmeta-openembedded-91a9a3d61f4ea3f0be960b069f84ef3462696379.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>
Diffstat (limited to 'meta-networking/recipes-support')
-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.14.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..7a5ebb6589
--- /dev/null
+++ b/meta-networking/recipes-support/dovecot/dovecot/0001-auth-Fix-handling-passdbs-with-identical-driver-args.patch
@@ -0,0 +1,137 @@
1From 9cc83ac206dba2de5ac92d4c5fbad5720f605631 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 9151807..c4f5a0c 100644
30--- a/src/auth/auth-request.c
31+++ b/src/auth/auth-request.c
32@@ -553,8 +553,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@@ -567,7 +567,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 2b8d32a..324bd79 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 21fd385..4652015 100644
99--- a/src/auth/passdb.c
100+++ b/src/auth/passdb.c
101@@ -226,19 +226,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 b405aa7..8f50050 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.14.bb b/meta-networking/recipes-support/dovecot/dovecot_2.3.14.bb
index 451edef9a0..4c55c0e081 100644
--- a/meta-networking/recipes-support/dovecot/dovecot_2.3.14.bb
+++ b/meta-networking/recipes-support/dovecot/dovecot_2.3.14.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 "
15 16
16SRC_URI[md5sum] = "2f03532cec3280ae45a101a7a55ccef5" 17SRC_URI[md5sum] = "2f03532cec3280ae45a101a7a55ccef5"