NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/52792: uninitiaized memory read in tzset(3)



>Number:         52792
>Category:       lib
>Synopsis:       uninitiaized memory read in tzset(3)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 08 00:10:00 +0000 2017
>Originator:     Kamil Rytarowski
>Release:        NetBSD 8.99.8 amd64
>Organization:
TNF
>Environment:
NetBSD chieftec 8.99.8 NetBSD 8.99.8 (GENERIC) #1: Thu Dec  7 02:50:00 CET 2017  root@chieftec:/public/netbsd-root/sys/arch/amd64/compile/GENERIC amd64
>Description:
$ MSAN_SYMBOLIZER_PATH=/usr/bin/addr2line ./a.out                                                                                                                                    
Uninitialized bytes in __interceptor_strcmp at offset 0 inside [0x731000012d28, 4)
==23489==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7f7ff6ce77cc in typesequiv /usr/src/lib/libc/time/localtime.c:776
    #1 0x7f7ff6ce8170 in tzloadbody /usr/src/lib/libc/time/localtime.c:700
    #2 0x7f7ff6ce8170 in tzload /usr/src/lib/libc/time/localtime.c:754
    #3 0x7f7ff6ce849c in tzparse /usr/src/lib/libc/time/localtime.c:1117
    #4 0x7f7ff6ce8271 in tzloadbody /usr/src/lib/libc/time/localtime.c:634
    #5 0x7f7ff6ce8271 in tzload /usr/src/lib/libc/time/localtime.c:754
    #6 0x7f7ff6ce900b in zoneinit /usr/src/lib/libc/time/localtime.c:1359
    #7 0x7f7ff6ce9158 in tzsetlcl /usr/src/lib/libc/time/localtime.c:1381
    #8 0x7f7ff6cea01e in tzset_unlocked /usr/src/lib/libc/time/localtime.c:1403
    #9 0x7f7ff6cea01e in __tzset50 /usr/src/lib/libc/time/localtime.c:1410
    #10 0x44c7fe in main /public/llvm-build/tzset.c:6
    #11 0x40a5fa in ___start ??:?

SUMMARY: MemorySanitizer: use-of-uninitialized-value /usr/src/lib/libc/time/localtime.c:776 in typesequiv
Exiting
>How-To-Repeat:
$ cat tzset.c 
#include <time.h>

int
main(int argc, char **argv)
{
        tzset();
        return 0;
}
$ ./bin/clang tzset.c -g -O0 -fsanitize=memory
$ ./a.out
>Fix:
N/A



Home | Main Index | Thread Index | Old Index