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

fix udp.srcaddr after connections realloc #362

Closed
wants to merge 1 commit into from

Conversation

msaf1980
Copy link
Contributor

Fix for #346

@msaf1980
Copy link
Contributor Author

Trace with ASAN
==11648==ERROR: AddressSanitizer: heap-use-after-free on address 0x7f16b52e9811 at pc 0x00000040f9d6 bp 0x7f16b3ae39d0 sp 0x7f16b3ae39c0
WRITE of size 1 at 0x7f16b52e9811 thread T4
#0 0x40f9d5 in udpsockread /data/git/carbon-c-relay/dispatcher.c:163
#1 0x413154 in dispatch_connection /data/git/carbon-c-relay/dispatcher.c:859
#2 0x4152c4 in dispatch_runner /data/git/carbon-c-relay/dispatcher.c:1137
#3 0x7f16bcca8593 in start_thread (/lib64/libpthread.so.0+0x7593)
#4 0x7f16bc9dbe6e in clone (/lib64/libc.so.6+0xf9e6e)

0x7f16b52e9811 is located 17 bytes inside of 68247552-byte region [0x7f16b52e9800,0x7f16b93ff800)
freed by thread T1 here:
#0 0x7f16be05f448 in __interceptor_realloc (/lib64/libasan.so.5+0xef448)
#1 0x411126 in dispatch_addconnection /data/git/carbon-c-relay/dispatcher.c:600
#2 0x414dd0 in dispatch_runner /data/git/carbon-c-relay/dispatcher.c:1100
#3 0x7f16bcca8593 in start_thread (/lib64/libpthread.so.0+0x7593)

Realloc of connections is a root cause of segfault
https://github.com/grobian/carbon-c-relay/blob/master/dispatcher.c#L600

@msaf1980 msaf1980 closed this Mar 25, 2019
@msaf1980 msaf1980 deleted the fix_connections_realloc branch February 27, 2020 09:26
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.

1 participant