[PATCH 0/2] trace-cmd lib: Fix potential integer overflows

[email protected]
Newsgroups org.kernel.vger.linux-trace-devel
Message-ID <[email protected]>
From: Jaroslav Jindrak <[email protected]>

There are two possible integer overflows in libtracecmd when reading
CPU data from a file. The first one can cause the size returned by
stat() to overflow when assigned from off_t to an int, which can then
lead to a the read_size and the file size not matching. The second one
occurs when printing such an error because we use %lld to print an
unsigned long long int. These two overflows can lead to a situation
such as this:

libtracecmd: Invalid argument
  did not match size of 3451486208 to -843481088

Jaroslav Jindrak (2):
  trace-cmd lib: Fix potential integer overflow in
    tracecmd_write_cpu_data()
  trace-cmd lib: Use proper printf format specifiers

 lib/trace-cmd/include/trace-cmd-local.h | 2 +-
 lib/trace-cmd/trace-output.c            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
2.37.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.