Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dangling pointer bugfix for upstream check module while update the upstream via dyups #1265

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cuber
Copy link

@cuber cuber commented May 14, 2019

Dangling pointer access, while ngx_http_dyups_module and ngx_http_upstream_check_module are used together.

Because dyups has its own srv_conf and it will be freed when the upstream is deleted,
but upstream check timer will still be exists and access its srv conf via peer->conf.

To avoid dangling pointer access, we should delete the dynamic peer while its upstream is deleting.

When `ngx_http_dyups_module` and `ngx_http_upstream_check_module` are used together.
Because dyups has its own srv_conf and it will be freed when the upstream is deleted,
but upstream check timer will still be exists and access its srv conf via peer->conf.

To avoid dangling pointer access, we should delete the dynamic peer while its upstream is deleting.
@cuber
Copy link
Author

cuber commented May 14, 2019

I have found a commit of yzprofile/nginx_upstream_check_module@2eb4451 use ngx_dyups_del_upstream_top_filter and NGX_DYUPS macro to avoid this problem.
I think it's much better than this PR.

@chobits chobits added this to the 2.3.1 milestone May 16, 2019
@chobits chobits removed this from the 2.3.1 milestone Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants