• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stefanberger / swtpm / 4166
74%
master: 74%

Build:
Build:
LAST BUILD BRANCH: HEAD
DEFAULT BRANCH: master
Ran 09 Dec 2022 12:33AM UTC
Jobs 1
Files 56
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
4166

cron

travis-ci-com

stefanberger
swtpm: Use uint64_t in tlv_data_append() to avoid integer overflows

Instead of uint32_t use uint64_t's for accumulating needed buffer sizes
that are calculated by adding uint32_t length indicators. Use the uint64_t
to check for excessively large buffer sizes that could cause an integer
overflow if uint32_t was used.

This patch addresses the case where a user passes an old version of TPM
state file to swtpm for reading and the file is 4GB in size and thus can
cause an integer overflow in this particular function.

Otherwise, the previous fix to tlv_data_find_tag() protects swtpm from
integer overflows and later out-of-bound accesses when the TPM state is
initially read from a file (assuming the state file has a header, which
is the case since swtpm 0.1). If an excessively large buffer was passed
to libtpms, it would reject it since it would never be able to take in
that much data.

Data written to the file are coming from libtpms that we can trust in
terms of length indicators.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>

5 of 5 new or added lines in 1 file covered. (100.0%)

3734 of 5061 relevant lines covered (73.78%)

22794.79 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
88.64
0.0% src/swtpm/tlv.c
Jobs
ID Job ID Ran Files Coverage
2 4166.2 (COVERITY_SCAN_TOKEN=[secure] PREFIX="/usr" CONFIG="--with-openssl --prefix=/usr --enable-test-coverage" SUDO="sudo" CHECK="check" SWTPM_TEST_IBMTSS2="1") 09 Dec 2022 12:33AM UTC 56
73.78
Travis Job 4166.2
Source Files on build 4166
  • Tree
  • List 56
  • Changed 9
  • Source Changed 0
  • Coverage Changed 9
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Build #4166
  • 20141486 on github
  • Prev Build on stable-0.5 (#4159)
  • Next Build on stable-0.5 (#4171)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc