Skip to content

write_dns_event may cause underflow when proxy.config.dns.retries is changed #7699

Description

@udbxtd2008

Position of the problem:
write_dns_event DNS.cc line 1140: e->id[dns_retries - e->retries] = i;

  1. e->retries was assinged with dns_retries in DNSProcessor::getby.
  2. The value of dns_retries is combined with "proxy.config.dns.retries".
  3. if "proxy.config.dns.retries" is changed to be a smaller value by traffic_ctl, for example:
    /opt/ats/bin/traffic_ctl config set proxy.config.dns.retries 9 -- > 0.
  4. [dns_retries - e->retries] will underflow. The memory before id[] will be writen by wrong value.

struct DNSEntry : public Continuation {
int id[MAX_DNS_RETRIES];
...

Solution:
Consider assign dns_retries to DNSEntry in DNSProcessor::getby?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions