kernel-hacking-2024-linux-s.../net/sctp
Tommi Rantala be364c8c0f sctp: fix memory leak in sctp_datamsg_from_user() when copy from user space fails
Trinity (the syscall fuzzer) discovered a memory leak in SCTP,
reproducible e.g. with the sendto() syscall by passing invalid
user space pointer in the second argument:

 #include <string.h>
 #include <arpa/inet.h>
 #include <sys/socket.h>

 int main(void)
 {
         int fd;
         struct sockaddr_in sa;

         fd = socket(AF_INET, SOCK_STREAM, 132 /*IPPROTO_SCTP*/);
         if (fd < 0)
                 return 1;

         memset(&sa, 0, sizeof(sa));
         sa.sin_family = AF_INET;
         sa.sin_addr.s_addr = inet_addr("127.0.0.1");
         sa.sin_port = htons(11111);

         sendto(fd, NULL, 1, 0, (struct sockaddr *)&sa, sizeof(sa));

         return 0;
 }

As far as I can tell, the leak has been around since ~2003.

Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-11-28 11:10:09 -05:00
..
associola.c
auth.c
bind_addr.c
chunk.c sctp: fix memory leak in sctp_datamsg_from_user() when copy from user space fails 2012-11-28 11:10:09 -05:00
command.c
debug.c
endpointola.c
input.c sctp: fix a typo in prototype of __sctp_rcv_lookup() 2012-10-04 15:53:48 -04:00
inqueue.c
ipv6.c
Kconfig
Makefile
objcnt.c
output.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2012-09-15 11:43:53 -04:00
outqueue.c sctp: check src addr when processing SACK to update transport state 2012-10-04 15:53:48 -04:00
primitive.c
probe.c
proc.c sctp: fix /proc/net/sctp/ memory leak 2012-11-15 13:56:05 -05:00
protocol.c
sm_make_chunk.c
sm_sideeffect.c sctp: fix call to SCTP_CMD_PROCESS_SACK in sctp_cmd_interpreter() 2012-10-16 14:41:46 -04:00
sm_statefuns.c sctp: check src addr when processing SACK to update transport state 2012-10-04 15:53:48 -04:00
sm_statetable.c
socket.c net: sctp: Fix typo in net/sctp 2012-11-01 11:55:19 -04:00
ssnmap.c
sysctl.c
transport.c
tsnmap.c
ulpevent.c
ulpqueue.c