Thread (6 messages) flat view 6 messages, 4 authors, 2012-11-28

Re: [PATCH] sctp: fix -ENOMEM result with invalid user space pointer in sendto() syscall

From: David Miller <davem@davemloft.net>
Date: 2012-11-28 16:12:19
Also in: linux-sctp

From: Tommi Rantala <redacted>
Date: Thu, 22 Nov 2012 15:23:16 +0200
Consider the following program, that sets the second argument to the
sendto() syscall incorrectly:
 ...
We get -ENOMEM:

 $ strace -e sendto ./demo
 sendto(3, NULL, 1, 0, {sa_family=AF_INET, sin_port=htons(11111), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 ENOMEM (Cannot allocate memory)

Propagate the error code from sctp_user_addto_chunk(), so that we will
tell user space what actually went wrong:

 $ strace -e sendto ./demo
 sendto(3, NULL, 1, 0, {sa_family=AF_INET, sin_port=htons(11111), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 EFAULT (Bad address)

Noticed while running Trinity (the syscall fuzzer).

Signed-off-by: Tommi Rantala <redacted>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help