summaryrefslogtreecommitdiff
path: root/code_coverage/seccomp_policy/code_coverage.arm.policy
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2020-07-09 20:39:17 -0700
committerTom Cherry <tomcherry@google.com>2020-07-09 20:39:17 -0700
commitfd399f068f6cf73710135b0e8329207471059068 (patch)
tree4cb75e89714a405b9fefea15eb305202d94b1d37 /code_coverage/seccomp_policy/code_coverage.arm.policy
parent5bb25d5658c7ed314f8609d90d359c6ac3166e04 (diff)
liblog: remove faulty logic in __android_logger_valid_buffer_size
In testing, I saw that the 'main' and 'events' log buffers were set to incorrect sizes when they were intended to be >= 4MB. The bug is tracked down to an invalid line in __android_logger_valid_buffer_size(): /* maximum memory impact a somewhat arbitrary ~3% */ pages = (pages + 31) / 32; There are two issues with this line: 1) That is not the right calculation for 3%. 2) `pages` is a static variable, so it repeatedly is decremented until reaching 1. The consequence is that this function gives invalid results for the first few calls, then returns true as long as the input is between LOG_BUFFER_MIN_SIZE and LOG_BUFFER_MAX_SIZE. That check is enough, so the rest of this logic is removed. Test: buffers are set to the right sizes. Change-Id: I4d19b1d0fdbd83843d2d61a484ac083d571ef37b
Diffstat (limited to 'code_coverage/seccomp_policy/code_coverage.arm.policy')
0 files changed, 0 insertions, 0 deletions