Skip to content

maglev: fix handling of unspecified locality weights.#5863

Merged
htuch merged 2 commits intoenvoyproxy:masterfrom
htuch:fix-maglev-assert
Feb 6, 2019
Merged

maglev: fix handling of unspecified locality weights.#5863
htuch merged 2 commits intoenvoyproxy:masterfrom
htuch:fix-maglev-assert

Conversation

@htuch
Copy link
Member

@htuch htuch commented Feb 6, 2019

The config fuzzer showed that the locality weight assertion in
#5831 was too strong. Extant behavior was and is that if
locality weight is not specified and locality LB weighting, we should just ignore the locality.

Fixes oss-fuzz issue https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12923.

Risk level: Low
Testing: Corpus entry and unit test added.

Signed-off-by: Harvey Tuch htuch@google.com

The config fuzzer showed that the locality weight assertion in
envoyproxy#5831 was too strong. Extant behavior was and is that if
locality weight is not specified and locality LB weighting, we should just ignore the locality.

Fixes oss-fuzz issue https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12923.

Risk level: Low
Testing: Corpus entry and unit test added.

Signed-off-by: Harvey Tuch <htuch@google.com>
const uint32_t weight = effective_weight(host->weight(), i);
// If weight is zero, it should be totally excluded from table building
// below.
if (weight > 0) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: could write (weight != 0), because we're unsigned.

mergeconflict
mergeconflict previously approved these changes Feb 6, 2019
Copy link

@mergeconflict mergeconflict left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Signed-off-by: Harvey Tuch <htuch@google.com>
Copy link
Contributor

@snowp snowp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - matches how we handle zero locality weight elsewhere.

@htuch htuch merged commit 5fd128d into envoyproxy:master Feb 6, 2019
@htuch htuch deleted the fix-maglev-assert branch February 6, 2019 23:23
fredlas pushed a commit to fredlas/envoy that referenced this pull request Mar 5, 2019
The config fuzzer showed that the locality weight assertion in
envoyproxy#5831 was too strong. Extant behavior was and is that if
locality weight is not specified and locality LB weighting, we should just ignore the locality.

Fixes oss-fuzz issue https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12923.

Risk level: Low
Testing: Corpus entry and unit test added.

Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Fred Douglas <fredlas@google.com>
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.

3 participants