-
Notifications
You must be signed in to change notification settings - Fork 188
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
Heap buffer overflow in version 2.8.0.0 with abstract Linux sockets #382
Comments
remyoudompheng
pushed a commit
to remyoudompheng/network
that referenced
this issue
Feb 19, 2019
remyoudompheng
pushed a commit
to remyoudompheng/network
that referenced
this issue
Feb 19, 2019
@remyoudompheng I would gladly accept a PR for 2.8.0.1. |
remyoudompheng
pushed a commit
to remyoudompheng/network
that referenced
this issue
Feb 19, 2019
There are two cases where pokeSockAddr can write past the end of the sockaddr_un structure and corrupt the heap: - when processing a very large Unix socket path (more than 108 bytes) - when processing the address of a Linux abstract Unix socket, where (2 + length path) bytes are allocated but sizeof(sockadr_un) are written.
For completeness I included in the PR a variant of commit c8042c7 to check lengths of ordinary Unix socket addresses. You can obtain consistent crashes with a program like
In this case it is probably easier to obtain more arbitrary memory writes. |
remyoudompheng
pushed a commit
to remyoudompheng/network
that referenced
this issue
Feb 23, 2019
There are two cases where pokeSockAddr can write past the end of the sockaddr_un structure and corrupt the heap: - when processing a very large Unix socket path - when processing the address of a Linux abstract Unix socket, where (2 + length path) bytes are allocated but sizeof(sockadr_un) are written. The fix is backported from version 3.0.0.0.
kazu-yamamoto
pushed a commit
to kazu-yamamoto/network
that referenced
this issue
Apr 23, 2019
There are two cases where pokeSockAddr can write past the end of the sockaddr_un structure and corrupt the heap: - when processing a very large Unix socket path - when processing the address of a Linux abstract Unix socket, where (2 + length path) bytes are allocated but sizeof(sockadr_un) are written. The fix is backported from version 3.0.0.0.
kazu-yamamoto
pushed a commit
to kazu-yamamoto/network
that referenced
this issue
Apr 23, 2019
There are two cases where pokeSockAddr can write past the end of the sockaddr_un structure and corrupt the heap: - when processing a very large Unix socket path - when processing the address of a Linux abstract Unix socket, where (2 + length path) bytes are allocated but sizeof(sockadr_un) are written. The fix is backported from version 3.0.0.0.
kazu-yamamoto
pushed a commit
to kazu-yamamoto/network
that referenced
this issue
Apr 23, 2019
There are two cases where pokeSockAddr can write past the end of the sockaddr_un structure and corrupt the heap: - when processing a very large Unix socket path - when processing the address of a Linux abstract Unix socket, where (2 + length path) bytes are allocated but sizeof(sockadr_un) are written. The fix is backported from version 3.0.0.0.
kazu-yamamoto
pushed a commit
to kazu-yamamoto/network
that referenced
this issue
Apr 23, 2019
There are two cases where pokeSockAddr can write past the end of the sockaddr_un structure and corrupt the heap: - when processing a very large Unix socket path - when processing the address of a Linux abstract Unix socket, where (2 + length path) bytes are allocated but sizeof(sockadr_un) are written. The fix is backported from version 3.0.0.0.
kazu-yamamoto
pushed a commit
to kazu-yamamoto/network
that referenced
this issue
Apr 23, 2019
There are two cases where pokeSockAddr can write past the end of the sockaddr_un structure and corrupt the heap: - when processing a very large Unix socket path - when processing the address of a Linux abstract Unix socket, where (2 + length path) bytes are allocated but sizeof(sockadr_un) are written. The fix is backported from version 3.0.0.0.
eborden
pushed a commit
that referenced
this issue
Apr 24, 2019
There are two cases where pokeSockAddr can write past the end of the sockaddr_un structure and corrupt the heap: - when processing a very large Unix socket path - when processing the address of a Linux abstract Unix socket, where (2 + length path) bytes are allocated but sizeof(sockadr_un) are written. The fix is backported from version 3.0.0.0.
#400 fixes this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
There is a heap overflow in pokeSockAddr that was fixed in release 3.0.0.0 when using Linux abstract Unix sockets. As far as I know it is present in at least all versions from 2.6.3.3 to 2.8.0.0.
The following program reproduces a segfault with ghc 8.6.3 when compiled with the threaded runtime
with the following output:
Since many systems are still using network 2.8.0.0 (like the Stackage distribution) I would like to know whether a 2.8.0.1 version could be released.
The fix would be to have
pokeSockAddr _ sa@(SockAddrUnix _)
always uselike it does in the 3.x version.
The text was updated successfully, but these errors were encountered: