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

[Bug] Reachable assertion in get_layer4_v6 #717

Closed
kdsjZh opened this issue Mar 4, 2022 · 2 comments
Closed

[Bug] Reachable assertion in get_layer4_v6 #717

kdsjZh opened this issue Mar 4, 2022 · 2 comments
Assignees
Projects

Comments

@kdsjZh
Copy link

kdsjZh commented Mar 4, 2022

You are opening a bug report against the Tcpreplay project: we use
GitHub Issues for tracking bug reports and feature requests.

If you have a question about how to use Tcpreplay, you are at the wrong
site. You can ask a question on the tcpreplay-users mailing list
or on Stack Overflow with [tcpreplay] tag.
General help is available here.

If you have a build issue, consider downloading the latest release

Otherwise, to report a bug, please fill out the reproduction steps
(below) and delete these introductory paragraphs. Thanks!

Describe the bug
The assertion assert(ip6_hdr); in get_layer4_v6() at common/get.c is reachable when the user uses tcprewrite to open a crafted pcap file.

To Reproduce
Steps to reproduce the behavior:

  1. export CC=clang && export CFLAGS="-fsanitize=address -g"
  2. ./autogen.sh && ./configure --disable-shared --disable-local-libopts && make clean && make -j8
  3. src/tcprewrite -o /dev/null -i POC
    output:
Warning: tcprewrite/crash.0 was captured using a snaplen of 96 bytes.  This may mean you have truncated packets.
tcprewrite: get.c:599: void *get_layer4_v6(const ipv6_hdr_t *, const int): Assertion `ip6_hdr' failed.
Aborted

Expected behavior
Program reports assertion failure and is terminated.

Screenshots
image

System (please complete the following information):

  • OS: Ubuntu
  • OS version : can be reproduced in 18.04/20.04
  • Clang version : clang-12.0.1 (release/12.x)
  • Tcpreplay Version : latest commit 09f0774

Credit
Han Zheng
NCNIPC of China
Hexhive

@kdsjZh
Copy link
Author

kdsjZh commented Mar 4, 2022

POC1.zip

@fklassen fklassen added this to To do in 4.4.2 Apr 22, 2022
@fklassen fklassen self-assigned this Aug 1, 2022
@fklassen fklassen moved this from To do to In progress in 4.4.2 Aug 1, 2022
fklassen added a commit that referenced this issue Aug 2, 2022
fklassen added a commit that referenced this issue Aug 2, 2022
…_layer4_6

Bug #717 avoid assertion in get_layer4_v6
@fklassen
Copy link
Member

fklassen commented Aug 2, 2022

Fixed in PR #739. Added test for null pointer.

@fklassen fklassen closed this as completed Aug 2, 2022
4.4.2 automation moved this from In progress to Done Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
4.4.2
Done
Development

No branches or pull requests

2 participants