[openssl/openssl] 57f4bd: providers/defltprov.c: remove static globals from ...

"'nikolapajkovsky' via openssl-commits" <[email protected]>
Newsgroups gmane.comp.encryption.openssl.cvs
Message-ID <openssl/openssl/push/refs/heads/master/[email protected]>
  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: 57f4bd9ab801c9d362ef5e110b74362f41db26c3
      https://github.com/openssl/openssl/commit/57f4bd9ab801c9d362ef5e110b74362f41db26c3
  Author: Matt Van Horn <[email protected]>
  Date:   2026-06-28 (Sun, 28 Jun 2026)

  Changed paths:
    M providers/defltprov.c

  Log Message:
  -----------
  providers/defltprov.c: 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[1].

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.

[1] https://github.com/openssl/openssl/issues/28935

CLA: trivial
Resolves: https://github.com/openssl/openssl/issues/28935

Reviewed-by: Norbert Pocs <[email protected]>
Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Eugene Syromiatnikov <[email protected]>
MergeDate: Sun Jun 28 17:51:52 2026
(Merged from https://github.com/openssl/openssl/pull/31508)


  Commit: f3447c3bc217a4439470fb65609b1c3e77956116
      https://github.com/openssl/openssl/commit/f3447c3bc217a4439470fb65609b1c3e77956116
  Author: Nikola Pajkovsky <[email protected]>
  Date:   2026-06-28 (Sun, 28 Jun 2026)

  Changed paths:
    M providers/baseprov.c

  Log Message:
  -----------
  providers/baseprov.c: 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: Norbert Pocs <[email protected]>
Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Eugene Syromiatnikov <[email protected]>
MergeDate: Sun Jun 28 17:51:54 2026
(Merged from https://github.com/openssl/openssl/pull/31508)


  Commit: f32f8682eac94360684d9856b7f72de4948b8637
      https://github.com/openssl/openssl/commit/f32f8682eac94360684d9856b7f72de4948b8637
  Author: Nikola Pajkovsky <[email protected]>
  Date:   2026-06-28 (Sun, 28 Jun 2026)

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

  Log Message:
  -----------
  providers/fips/fipsprov.c, test/p_test.c: remove c_gettable_params static global

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

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

Reviewed-by: Norbert Pocs <[email protected]>
Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Eugene Syromiatnikov <[email protected]>
MergeDate: Sun Jun 28 17:51:55 2026
(Merged from https://github.com/openssl/openssl/pull/31508)


Compare: https://github.com/openssl/openssl/compare/fc7363688813...f32f8682eac9

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/master/fc7363-f32f86%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.