Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use-of-uninitialized values in print-esp.c #849

Open
fxlb opened this issue Apr 22, 2020 · 1 comment
Open

use-of-uninitialized values in print-esp.c #849

fxlb opened this issue Apr 22, 2020 · 1 comment

Comments

@fxlb
Copy link
Member

fxlb commented Apr 22, 2020

Need to fix print-esp.c. Test case:

$ CC=clang CFLAGS='-fno-omit-frame-pointer -fsanitize=memory -fno-optimize-sibling-calls -fPIC -g3 -ggdb3 -O0' ./configure

$ make -s clean all

$ ./tcpdump -#n -E "file tests/esp-secrets.txt" -r tests/espudp1.pcap

1) tcpdump-4.9 branch:

reading from file tests/espudp1.pcap, link-type EN10MB (Ethernet)
==205441==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x5e74f5 in esp_print
...
fxlb added a commit to fxlb/tcpdump that referenced this issue Aug 12, 2022
Found with clang, CFLAGS=-fsanitize=memory.

Fix GitHub issues the-tcpdump-group#848 and the-tcpdump-group#849.

The problem is that for some unknown reason the pt buffer is not
initialized after EVP_DecryptUpdate() call, no error, in:

print-esp.c:260:        if (!EVP_DecryptUpdate(ctx, pt, &len, ct, ctlen)) {
fxlb added a commit to fxlb/tcpdump that referenced this issue Aug 12, 2022
Found with clang, CFLAGS=-fsanitize=memory.

Fix GitHub issues the-tcpdump-group#848 and the-tcpdump-group#849.

The problem is that for some unknown reason the pt buffer is not
initialized after EVP_DecryptUpdate() call, no error, in:

print-esp.c:260:        if (!EVP_DecryptUpdate(ctx, pt, &len, ct, ctlen)) {

(cherry picked from commit 47a7e20)
@fxlb
Copy link
Member Author

fxlb commented Aug 12, 2022

Workaround commited.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant