[openssl/openssl] 1ce249: prov: remove static globals from provider_init

"'nikolapajkovsky' via openssl-commits" <[email protected]>
Newsgroups gmane.comp.encryption.openssl.cvs
Message-ID <openssl/openssl/push/refs/heads/openssl-3.4/[email protected]>
  Branch: refs/heads/openssl-3.4
  Home:   https://github.com/openssl/openssl
  Commit: 1ce249061e119eba0034ea79f8fc158facbc7e31
      https://github.com/openssl/openssl/commit/1ce249061e119eba0034ea79f8fc158facbc7e31
  Author: Matt Van Horn <[email protected]>
  Date:   2026-07-03 (Fri, 03 Jul 2026)

  Changed paths:
    M providers/defltprov.c

  Log Message:
  -----------
  prov: remove static globals from provider_init

The default provider stored two function pointers from the core
dispatch table (c_gettable_params, c_get_params) in file-scope statics,
written by ossl_default_provider_init() without any synchronization.
When OSSL_PROVIDER_load() is invoked from multiple threads concurrently,
TSAN reports a data race on both writes (issue #28935).

c_gettable_params is never read anywhere in the file; it was dead
storage. c_get_params is only consumed once, inside the same call to
ossl_default_provider_init(), to seed the provider context via
ossl_prov_ctx_set0_core_get_params(). It can therefore be a local
variable rather than file-scope state.

Drop the unused c_gettable_params static together with its dispatch
case, and scope c_get_params inside the init function. The behavior of
the default provider is unchanged for single-threaded callers; the
concurrent-load race goes away because the shared mutable state is
gone.

CLA: trivial
Fixes #28935

Reviewed-by: Eugene Syromiatnikov <[email protected]>
Reviewed-by: Norbert Pocs <[email protected]>
MergeDate: Fri Jul  3 19:37:32 2026
(Merged from https://github.com/openssl/openssl/pull/31634)


  Commit: fdfba64f4fa4f27baec5664201eeaee419298235
      https://github.com/openssl/openssl/commit/fdfba64f4fa4f27baec5664201eeaee419298235
  Author: Nikola Pajkovsky <[email protected]>
  Date:   2026-07-03 (Fri, 03 Jul 2026)

  Changed paths:
    M providers/baseprov.c

  Log Message:
  -----------
  baseprov: remove static globals

c_gettable_params is never read anywhere in the file; it was dead
storage. c_get_params is only consumed once, inside the same call to
ossl_default_provider_init(), to seed the provider context via
ossl_prov_ctx_set0_core_get_params(). It can therefore be a local
variable rather than file-scope state.

drop the unused c_gettable_params static together with its dispatch
case, and scope c_get_params inside the init function. The behavior of
the base provider is unchanged for single-threaded callers; the
concurrent-load race goes away because the shared mutable state is
gone.

Signed-off-by: Nikola Pajkovsky <[email protected]>

Reviewed-by: Eugene Syromiatnikov <[email protected]>
Reviewed-by: Norbert Pocs <[email protected]>
MergeDate: Fri Jul  3 19:37:34 2026
(Merged from https://github.com/openssl/openssl/pull/31634)


  Commit: b582229e185bb4c6fb5ece74badafa783906afc4
      https://github.com/openssl/openssl/commit/b582229e185bb4c6fb5ece74badafa783906afc4
  Author: Nikola Pajkovsky <[email protected]>
  Date:   2026-07-03 (Fri, 03 Jul 2026)

  Changed paths:
    M providers/fips/fipsprov.c
    M test/p_test.c

  Log Message:
  -----------
  fipsprov: remove c_gettable_params static global

c_gettable_params is never read anywhere in the file; it was dead
storage.

Signed-off-by: Nikola Pajkovsky <[email protected]>

Reviewed-by: Eugene Syromiatnikov <[email protected]>
Reviewed-by: Norbert Pocs <[email protected]>
MergeDate: Fri Jul  3 19:37:35 2026
(Merged from https://github.com/openssl/openssl/pull/31634)


Compare: https://github.com/openssl/openssl/compare/07acd00d39cf...b582229e185b

To unsubscribe from these emails, change your notification settings at https://github.com/openssl/openssl/settings/notifications

-- 
You received this message because you are subscribed to the Google Groups "openssl-commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/a/openssl.org/d/msgid/openssl-commits/openssl/openssl/push/refs/heads/openssl-3.4/07acd0-b58222%40github.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.