Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
d4619f43
Commit
d4619f43
authored
7 years ago
by
David G. Quintas
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #11819 from dgquintas/timer_manager_uaf
Fix use-after-free in timer manager
parents
bf828943
fc94d1f4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core/lib/iomgr/timer_manager.c
+7
-0
7 additions, 0 deletions
src/core/lib/iomgr/timer_manager.c
with
7 additions
and
0 deletions
src/core/lib/iomgr/timer_manager.c
+
7
−
0
View file @
d4619f43
...
@@ -84,7 +84,14 @@ static void start_timer_thread_and_unlock(void) {
...
@@ -84,7 +84,14 @@ static void start_timer_thread_and_unlock(void) {
gpr_thd_options
opt
=
gpr_thd_options_default
();
gpr_thd_options
opt
=
gpr_thd_options_default
();
gpr_thd_options_set_joinable
(
&
opt
);
gpr_thd_options_set_joinable
(
&
opt
);
completed_thread
*
ct
=
gpr_malloc
(
sizeof
(
*
ct
));
completed_thread
*
ct
=
gpr_malloc
(
sizeof
(
*
ct
));
// The call to gpr_thd_new() has to be under the same lock used by
// gc_completed_threads(), particularly due to ct->t, which is written here
// (internally by gpr_thd_new) and read there. Otherwise it's possible for ct
// to leak through g_completed_threads and be freed in gc_completed_threads()
// before "&ct->t" is written to, causing a use-after-free.
gpr_mu_lock
(
&
g_mu
);
gpr_thd_new
(
&
ct
->
t
,
timer_thread
,
ct
,
&
opt
);
gpr_thd_new
(
&
ct
->
t
,
timer_thread
,
ct
,
&
opt
);
gpr_mu_unlock
(
&
g_mu
);
}
}
void
grpc_timer_manager_tick
()
{
void
grpc_timer_manager_tick
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment