You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2022/12/14 17:37:19 UTC
[GitHub] [trafficcontrol] tcfdev opened a new issue, #7252: Traffic Router (TR) czCount integer overflow in Traffic Ops (TO)
tcfdev opened a new issue, #7252:
URL: https://github.com/apache/trafficcontrol/issues/7252
<!--
************ STOP!! ************
If this issue identifies a security vulnerability, DO NOT submit it! Instead, contact
the Apache Traffic Control Security Team at security@trafficcontrol.apache.org and follow the
guidelines at https://apache.org/security regarding vulnerability disclosure.
- For *SUPPORT QUESTIONS*, use the #traffic-control channel on the ASF slack (https://s.apache.org/tc-slack-request)
or the Traffic Control Users mailing list (send an email to users-subscribe@trafficcontrol.apache.org to subscribe).
- Before submitting, please **SEARCH GITHUB** for a similar issue or PR
* https://github.com/apache/trafficcontrol/issues
* https://github.com/apache/trafficcontrol/pulls
-->
<!-- Do not submit security vulnerabilities or support requests here - see above -->
## This Bug Report affects these Traffic Control components:
<!-- delete all those that don't apply -->
- Traffic Ops
- Traffic Router
## Current behavior:
<!-- Describe how the bug happens -->
Traffic Ops queries the Traffic Router endpoint `crs/stats` to parse / process / display information. The struct is expecting the `czCount` field to be a _uint64_ however in at least one instance the value returned was negative (implying an Integer Overflow in TR).
From the TO error log:
```
ERROR: api.go:263: <id addr> decoding stats from CDN <CDN name> <traffic router>: json: cannot unmarshal number -2054406724 into Go struct field CRSStatsStat.stats.HTTPMap.czCount of type uint64
```
Looking into the response from TR, one of the routers reported:
```
"server": {
"czCount": -2055404181, <--- The culprit
"geoCount": 26857914,
"deepCzCount": 0,
"missCount": 1498,
"dsrCount": 0,
"errCount": 0,
"staticRouteCount": 0,
"fedCount": 0,
"regionalDeniedCount": 0,
"regionalAlternateCount": 0
},
```
## Expected behavior:
<!-- Describe what the behavior would be without the bug -->
The `czCount` field should certainly _not_ be negative to prevent the bug from happening. However there may a bigger question in terms of "What to do when we've hit the max allowable value of a uint64? Is resetting the values considered appropriate?"
## Steps to reproduce:
<!-- If the current behavior is a bug, please provide the *STEPS TO REPRODUCE* and
include the applicable TC version.
-->
Whew uhh. Hit an endpoint more than 2 147 483 647 times to see if it rolls over (since Java doesn't have unsigned integer types).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] ocket8888 commented on issue #7252: Traffic Router (TR) czCount integer overflow in Traffic Ops (TO)
Posted by GitBox <gi...@apache.org>.
ocket8888 commented on issue #7252:
URL: https://github.com/apache/trafficcontrol/issues/7252#issuecomment-1351839443
> Java doesn't have unsigned integer types
That's literally true, but it does provide ways to interpret the data value of a signed integer in unsigned ways. Specifically, the serialization of a count of something should be using [the `toUnsignedString` static method of Java's `Integer` class](https://devdocs.io/openjdk~19/java.base/java/lang/integer#toUnsignedString(int)).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman closed issue #7252: Traffic Router (TR) czCount integer overflow in Traffic Ops (TO)
Posted by GitBox <gi...@apache.org>.
zrhoffman closed issue #7252: Traffic Router (TR) czCount integer overflow in Traffic Ops (TO)
URL: https://github.com/apache/trafficcontrol/issues/7252
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org