This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, api-next has been updated via df97183dd71b214df6da679bbaf795a66bae4fdc (commit) via b7da911ca3a7d3ed172f4e4010912ef920ddcf1f (commit) from 9d65090ebcf45deb5677ffeb4aa2a26a96235dc5 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit df97183dd71b214df6da679bbaf795a66bae4fdc Author: Christophe Milard christophe.milard@linaro.org Date: Mon Jan 2 10:41:42 2017 +0100
linux-gen: init: avoiding segfault if cleaning files
The call the the cleanup_files() function (which cleans up possible remaining file(s) from a defunc OPD with same pid) may use ODP_DBG and ODP_ERR functions, but is (before this patch) placed before these ODP_* functions are initialized. This would surely sigfault. The call the the cleanup_files() function is hence placed after ODP_DBG and ODP_ERR function initialization to avoid this situation.
Signed-off-by: Christophe Milard christophe.milard@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index 1b0d8f8..06c6143 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -73,7 +73,6 @@ int odp_init_global(odp_instance_t *instance,
memset(&odp_global_data, 0, sizeof(struct odp_global_data_s)); odp_global_data.main_pid = getpid(); - cleanup_files(_ODP_TMPDIR, odp_global_data.main_pid);
enum init_stage stage = NO_INIT; odp_global_data.log_fn = odp_override_log; @@ -86,6 +85,8 @@ int odp_init_global(odp_instance_t *instance, odp_global_data.abort_fn = params->abort_fn; }
+ cleanup_files(_ODP_TMPDIR, odp_global_data.main_pid); + if (odp_cpumask_init_global(params)) { ODP_ERR("ODP cpumask init failed.\n"); goto init_failed;
commit b7da911ca3a7d3ed172f4e4010912ef920ddcf1f Author: Bill Fischofer bill.fischofer@linaro.org Date: Mon Jan 9 09:24:02 2017 -0600
linux-generic: crypto: add openssl locking support for thread safety
Resolve Bug https://bugs.linaro.org/show_bug.cgi?id=2798 by adding OpenSSL callbacks for locking that use ticketlocks to provide thread-safety for OpenSSL calls made by ODP components such as random number generation.
Signed-off-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Christophe Milard christophe.milard@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index 5808d16..4f17fd6 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -64,6 +64,7 @@ typedef struct odp_crypto_global_s odp_crypto_global_t;
struct odp_crypto_global_s { odp_spinlock_t lock; + odp_ticketlock_t **openssl_lock; odp_crypto_generic_session_t *free; odp_crypto_generic_session_t sessions[0]; }; @@ -948,16 +949,35 @@ odp_crypto_operation(odp_crypto_op_param_t *param, return 0; }
+static unsigned long openssl_thread_id(void) +{ + return (unsigned long)odp_thread_id(); +} + +static void openssl_lock(int mode, int n, + const char *file ODP_UNUSED, + int line ODP_UNUSED) +{ + if (mode & CRYPTO_LOCK) + odp_ticketlock_lock((odp_ticketlock_t *) + &global->openssl_lock[n]); + else + odp_ticketlock_unlock((odp_ticketlock_t *) + &global->openssl_lock[n]); +} + int odp_crypto_init_global(void) { size_t mem_size; odp_shm_t shm; int idx; + int nlocks = CRYPTO_num_locks();
/* Calculate the memory size we need */ mem_size = sizeof(*global); mem_size += (MAX_SESSIONS * sizeof(odp_crypto_generic_session_t)); + mem_size += nlocks * sizeof(odp_ticketlock_t);
/* Allocate our globally shared memory */ shm = odp_shm_reserve("crypto_pool", mem_size, @@ -975,6 +995,18 @@ odp_crypto_init_global(void) } odp_spinlock_init(&global->lock);
+ if (nlocks > 0) { + global->openssl_lock = + (odp_ticketlock_t **)&global->sessions[MAX_SESSIONS]; + + for (idx = 0; idx < nlocks; idx++) + odp_ticketlock_init((odp_ticketlock_t *) + &global->openssl_lock[idx]); + + CRYPTO_set_id_callback(openssl_thread_id); + CRYPTO_set_locking_callback(openssl_lock); + } + return 0; }
@@ -992,6 +1024,9 @@ int odp_crypto_term_global(void) rc = -1; }
+ CRYPTO_set_locking_callback(NULL); + CRYPTO_set_id_callback(NULL); + ret = odp_shm_free(odp_shm_lookup("crypto_pool")); if (ret < 0) { ODP_ERR("shm free failed for crypto_pool\n");
-----------------------------------------------------------------------
Summary of changes: platform/linux-generic/odp_crypto.c | 35 +++++++++++++++++++++++++++++++++++ platform/linux-generic/odp_init.c | 3 ++- 2 files changed, 37 insertions(+), 1 deletion(-)
hooks/post-receive