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

Frag dev pull request #284

Merged
merged 54 commits into from
Jun 19, 2015
Merged

Frag dev pull request #284

merged 54 commits into from
Jun 19, 2015

Conversation

laurensmiers
Copy link
Contributor

This should fix #246 . Asan does not complain anymore + udp frag test in autotest.h is succeeding (with asan).
Tahi ipv6 fragmentation tests, Test v6LC.1.3.1/2/3/4, are also succeeding.
Requesting review.

ludolinux and others added 30 commits April 15, 2015 13:45
…eanup out of arrive function

+ copy all pico net headers in reassambled frame
+ add pico device to reassambled frame
+ update payload lengths in reassambled frame
@danielinux
Copy link
Contributor

@laurensmiers : I right-merged from last development and fixed some warnings. I ran tics showcase and the results are optimal 👍

There is one unit test failing though, please investigate.

Reproduce:

make ARCH=faulty units
./build/test/modunit_fragments.elf 
*** Error in `./build/test/modunit_fragments.elf': free(): corrupted unsorted chunks: 0x089db330 ***
84%: Checks: 13, Failures: 1, Errors: 1
test/unit/modunit_pico_fragments.c:275:E:Unit test for pico_fragment_arrived:tc_pico_fragment_arrived:0: (after this point) Received signal 6 (Aborted)
test/unit/modunit_pico_fragments.c:388:F:Unit test for copy_ipv6_hdrs_nofrag:tc_copy_ipv6_hdrs_nofrag:0: Assertion 'copy_ipv6_hdrs_nofrag(dst, src) == src->net_len - 8' failed
make ADDRESS_SANITIZER=1 ARCH=faulty units
./build/test/modunit_fragments.elf 
Running suite(s): PicoTCP
=================================================================
==9427==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xb5c00c26 at pc 0x804e3a2 bp 0xbffb3b58 sp 0xbffb3b4c
WRITE of size 1 at 0xb5c00c26 thread T0
    #0 0x804e3a1 in pico_fragment_arrived modules/pico_fragments.c:903
    #1 0x80505bf in tc_pico_fragment_arrived test/unit/modunit_pico_fragments.c:263
    #2 0x80549b1 in srunner_run (/home/dan/picotcp/build/test/modunit_fragments.elf+0x80549b1)
    #3 0x8054a66 in srunner_run_all (/home/dan/picotcp/build/test/modunit_fragments.elf+0x8054a66)
    #4 0x8052053 in main test/unit/modunit_pico_fragments.c:488
    #5 0xb7029a62 in __libc_start_main (/lib/i386-linux-gnu/i686/cmov/libc.so.6+0x19a62)
    #6 0x8049660 (/home/dan/picotcp/build/test/modunit_fragments.elf+0x8049660)

0xb5c00c26 is located 10 bytes to the left of 8-byte region [0xb5c00c30,0xb5c00c38)
allocated by thread T0 here:
    #0 0xb7275812 in __interceptor_calloc (/usr/lib/i386-linux-gnu/libasan.so.1+0x4e812)
    #1 0x8049b51 in pico_zalloc include/../test/pico_faulty.h:72
    #2 0x804cdd8 in pico_hole_alloc modules/pico_fragments.c:652
    #3 0x804e7d7 in pico_fragment_arrived modules/pico_fragments.c:954
    #4 0x8050024 in tc_pico_fragment_arrived test/unit/modunit_pico_fragments.c:234
    #5 0x80549b1 in srunner_run (/home/dan/picotcp/build/test/modunit_fragments.elf+0x80549b1)

SUMMARY: AddressSanitizer: heap-buffer-overflow modules/pico_fragments.c:903 pico_fragment_arrived
Shadow bytes around the buggy address:
  0x36b80130: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36b80140: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36b80150: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36b80160: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x36b80170: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x36b80180: fa fa 00 02[fa]fa 00 fa fa fa fd fa fa fa fd fa
  0x36b80190: fa fa fd fa fa fa fd fd fa fa 00 04 fa fa fd fa
  0x36b801a0: fa fa fd fa fa fa 07 fa fa fa fd fa fa fa 07 fa
  0x36b801b0: fa fa fd fa fa fa fd fd fa fa 07 fa fa fa fd fa
  0x36b801c0: fa fa fd fa fa fa 07 fa fa fa fd fa fa fa 07 fa
  0x36b801d0: fa fa fd fa fa fa 00 00 fa fa 04 fa fa fa fd fa
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
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Contiguous container OOB:fc
  ASan internal:           fe
==9427==ABORTING
84%: Checks: 13, Failures: 1, Errors: 1
test/unit/modunit_pico_fragments.c:245:E:Unit test for pico_fragment_arrived:tc_pico_fragment_arrived:0: (after this point) Early exit with return value 1
test/unit/modunit_pico_fragments.c:388:F:Unit test for copy_ipv6_hdrs_nofrag:tc_copy_ipv6_hdrs_nofrag:0: Assertion 'copy_ipv6_hdrs_nofrag(dst, src) == src->net_len - 8' failed

danielinux added a commit that referenced this pull request Jun 19, 2015
@danielinux danielinux merged commit e7ef870 into development Jun 19, 2015
@danielinux danielinux deleted the frag_dev branch June 19, 2015 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants