summaryrefslogtreecommitdiffstats
path: root/include/internal
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2021-02-19 17:03:43 +0000
committerPauli <ppzgs1@gmail.com>2021-02-25 08:37:22 +1000
commitd84f5515faf3fe00ed5eeca7e7b8b041be863e90 (patch)
treeb2e8245e0a152f16b5bb2c5260e47781a6261c9d /include/internal
parent6be27456e1346121b1fed797e92353733b59e16e (diff)
Don't hold a lock when calling a callback in ossl_namemap_doall_names
We don't want to hold a read lock when calling a user supplied callback. That callback could do anything so the risk of a deadlock is high. Instead we collect all the names first inside the read lock, and then subsequently call the user callback outside the read lock. Fixes #14225 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14250)
Diffstat (limited to 'include/internal')
-rw-r--r--include/internal/namemap.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/internal/namemap.h b/include/internal/namemap.h
index 685ccb41c1..bbdc041173 100644
--- a/include/internal/namemap.h
+++ b/include/internal/namemap.h
@@ -31,9 +31,9 @@ int ossl_namemap_name2num_n(const OSSL_NAMEMAP *namemap,
const char *name, size_t name_len);
const char *ossl_namemap_num2name(const OSSL_NAMEMAP *namemap, int number,
size_t idx);
-void ossl_namemap_doall_names(const OSSL_NAMEMAP *namemap, int number,
- void (*fn)(const char *name, void *data),
- void *data);
+int ossl_namemap_doall_names(const OSSL_NAMEMAP *namemap, int number,
+ void (*fn)(const char *name, void *data),
+ void *data);
/*
* A utility that handles several names in a string, divided by a given