Possible bug: uninitialized variable in oidc_cache_mutex_post_config #1288
Closed
ErmakovDmitriy
started this conversation in
General
Replies: 3 comments 1 reply
-
agreed, we'll improve the error handling and avoid the segfault; thanks for reporting |
Beta Was this translation helpful? Give feedback.
1 reply
-
see a2cfc06, this will be included in the 2.4.16.6 release that is coming very soon |
Beta Was this translation helpful? Give feedback.
0 replies
-
https://github.com/OpenIDC/mod_auth_openidc/releases/tag/v2.4.16.6 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We have been running mod OpenIDC in a container with Debian 12 base image.
Container images with version 2.4.16.5 fail to start with segfault, see below:
I have tried to debug and it seems that in our configuration (I could only reproduce it in one of our environments, so it is hard to reproduce), function
apr_temp_dir_get
(https://github.com/OpenIDC/mod_auth_openidc/blob/master/src/cache/common.c#L89) fails to find a temporary dir which makes the value of thedir
unpredictable (https://github.com/apache/apr/blob/d131b4e1be4fc45e9f092cff90d7c87baa251e2b/file_io/unix/tempdir.c#L40C57-L40C65).I patched the code of this function to have it as below:
and when I run the patched module, I got an error:
[Thu Dec 05 15:13:43.547025 2024] [auth_openidc:error] [pid 83:tid 83] oidc_cache_mutex_post_config: Temp dir lookup result: Internal error (specific information not available)
, see below:which probably corresponds to this return https://github.com/apache/apr/blob/d131b4e1be4fc45e9f092cff90d7c87baa251e2b/file_io/unix/tempdir.c#L124 from
apr_temp_dir_get
.I think that although my container runtime environment configuration is not well-configured for the mod_oidc (no tmpdir at all) and I will fix it, it might be a good idea to handle the return code of
apr_temp_dir_get
and fail the module start in a nice way. Also, while I am not an expert, I can imagine a situation that the value of thedir
pointer might at some random case point to some critical memory/information because it was not initialized.Beta Was this translation helpful? Give feedback.
All reactions