Project

General

Profile

Actions

Bug #1238

closed

AddressSanitizer detects an global buffer overflow when we iterate over tracepoint sections

Added by Mathieu Desnoyers about 4 years ago. Updated about 4 years ago.

Status:
Resolved
Priority:
Normal
Target version:
-
Start date:
02/17/2020
Due date:
% Done:

0%

Estimated time:

Description

Building lttng-ust with:

CC="clang-9" CFLAGS="-g -O0 -fsanitize=address" LDFLAGS="-fsanitize=address -fno-omit-frame-pointer" ./configure && make

then running tests/hello/hello :

=================================================================
5772ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f1e9d589270 at pc 0x7f1e9d16103f bp 0x7fff2e875ff0 sp 0x7fff2e875fe8
READ of size 4 at 0x7f1e9d589270 thread T0
#0 0x7f1e9d16103e in hashlittle /home/efficios/git/lttng-ust/liblttng-ust/./jhash.h:129:15
#1 0x7f1e9d160322 in jhash /home/efficios/git/lttng-ust/liblttng-ust/./jhash.h:256:9
#2 0x7f1e9d1657a2 in add_callsite /home/efficios/git/lttng-ust/liblttng-ust/tracepoint.c:422:9
#3 0x7f1e9d15d518 in lib_register_callsites /home/efficios/git/lttng-ust/liblttng-ust/tracepoint.c:552:3
#4 0x7f1e9d15ca91 in tracepoint_register_lib /home/efficios/git/lttng-ust/liblttng-ust/tracepoint.c:903:2
#5 0x7f1e9d4a124e in _tracepoints_ptrs_init /home/efficios/git/lttng-ust/liblttng-ust/../include/lttng/tracepoint.h:485:3
#6 0x7f1e9d4a2d8d in lttng_ust_statedump_init /home/efficios/git/lttng-ust/liblttng-ust/lttng-ust-statedump.c:645:2
#7 0x7f1e9d409a85 in lttng_ust_init /home/efficios/git/lttng-ust/liblttng-ust/lttng-ust-comm.c:1846:2
#8 0x7f1e9d7e0732 (/lib64/ld-linux-x86-64.so.2+0x10732)
#9 0x7f1e9d7d10c9 (/lib64/ld-linux-x86-64.so.2+0x10c9)

0x7f1e9d589270 is located 48 bytes to the left of global variable '__tp_strtab_lttng_ust_lib___build_id' defined in './ust_lib.h:55:1' (0x7f1e9d5892a0) of size 23
'__tp_strtab_lttng_ust_lib___build_id' is ascii string 'lttng_ust_lib:build_id'
0x7f1e9d589273 is located 0 bytes to the right of global variable '__tp_strtab_lttng_ust_lib___load' defined in './ust_lib.h:42:1' (0x7f1e9d589260) of size 19
'__tp_strtab_lttng_ust_lib___load' is ascii string 'lttng_ust_lib:load'
SUMMARY: AddressSanitizer: global-buffer-overflow /home/efficios/git/lttng-ust/liblttng-ust/./jhash.h:129:15 in hashlittle
Shadow bytes around the buggy address:
0x0fe453aa91f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0fe453aa9200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0fe453aa9210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0fe453aa9220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0fe453aa9230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0fe453aa9240: 00 00 00 00 00 00 00 00 00 00 00 00 00 0003f9
0x0fe453aa9250: f9 f9 f9 f9 00 00 07 f9 f9 f9 f9 f9 00 00 00 01
0x0fe453aa9260: f9 f9 f9 f9 00 00 05 f9 f9 f9 f9 f9 00 00 00 02
0x0fe453aa9270: f9 f9 f9 f9 00 00 00 05 f9 f9 f9 f9 00 00 00 05
0x0fe453aa9280: f9 f9 f9 f9 00 00 00 07 f9 f9 f9 f9 00 00 00 05
0x0fe453aa9290: f9 f9 f9 f9 00 00 00 f9 f9 f9 f9 f9 00 00 07 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
Shadow gap: cc
5772ABORTING

Actions

Also available in: Atom PDF