-
Notifications
You must be signed in to change notification settings - Fork 849
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
UBSan violations in print-pflog.c and print-snmp.c #1054
Comments
Can you see if https://github.com/the-tcpdump-group/tcpdump/pull/1012/files addresses the Snmp ub you see? |
It does, at least on my Ubuntu 22.04 VM. Tested by reverting to a version of print-snmp.c prior to your change, building with UBSAN, reading those two files, checking out the latest print-snmp.c, rebuilding, and reading those files again. |
Currently on Debian bookworm, CC=clang-15:
|
Remain some UBs, see above:. |
This 1) makes sure that GET_ macros are used to extract data from the structure (which they already were) and 2) avoids undefined behavior if the structure isn't aligned on the appropriate memory boundary. Fixes the-tcpdump-group#1054. (The SNMP issues are fixed by changes for the-tcpdump-group#1012.) (cherry picked from commit a0b7859)
Tcpdump version:
Fuzzing tcpdump with our hybrid fuzzer has uncovered 3 Undefined Behavior Sanitizer violations in print-pflog.c and print-snmp.c. Reproducing pcaps are included and can be tested with
tcpdump -e -r <filename>
left shift out of
int
boundsReproducer:
crash_print-snmp-751.pcap.tar.gz
left shift of negative value -1
Reproducer: crash_print-snmp-545.pcap.tar.gz
member access within misaligned address 0x61d0000000a2 for type 'const struct pfloghdr', which requires 4 byte alignment
Reproducer:
crash_print-pflog-147.pcap.tar.gz
The text was updated successfully, but these errors were encountered: