Skip to contentSkip to conversation

Passed: linux-test-project/ltp#535 (master - cecbd0c)

LTP Travis CI 1 participant 1 message Nov 8, 2017 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): linux-test-project/[email protected]

Travis CI

author
#1 lore raw

Build Update for linux-test-project/ltp
-------------------------------------

Build: #535
Status: Passed

Duration: 14 minutes and 58 seconds
Commit: cecbd0c (master)
Author: Veronika Kabatova
Message: Fix buffer overflow in print_result() function

From man page: "The functions snprintf() and vsnprintf() do not write more than size bytes (including the terminating null byte ('\0')). If the output was truncated due to this limit, then the return value is the number of characters (excluding the terminating null byte) which would have been written to the final string if enough space had been available. Thus, a return value of size or more means that the output was truncated."

The return value is not checked and blindly subtracted from available space in the buffer which may cause negative values (which are then converted to unsigned type size_t) in case the variables to print don't fit into buffer. The pointer to buffer is also moved forward the same amount, and writing into memory that is not allocated causes unexpected failures of tests with segfaults.

This was discovered during rewriting of mtest06/mmap1 testcase to new library where verbose output tried to print out memory contents longer than space available in the buffer. The framework should be robust enough to handle these situations.

View the changeset: https://github.com/linux-test-project/ltp/compare/f11172e481dc...cecbd0cb36d6

View the full build log and details: https://travis-ci.org/linux-test-project/ltp/builds/299139951?utm_source=email&utm_medium=notification

--

You can configure recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20171108/9ac08f8a/attachment.html>