Skip to content

Commit

Permalink
[DCCP]: Fix skb leak in dccp_sendmsg
Browse files Browse the repository at this point in the history
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Arnaldo Carvalho de Melo authored and David S. Miller committed Aug 29, 2005
1 parent 7ad07e7 commit 20472af
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions net/dccp/proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,18 @@ int dccp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
goto out_discard;

rc = dccp_write_xmit(sk, skb, len);
/*
* XXX we don't use sk_write_queue, so just discard the packet.
* Current plan however is to _use_ sk_write_queue with
* an algorith similar to tcp_sendmsg, where the main difference
* is that in DCCP we have to respect packet boundaries, so
* no coalescing of skbs.
*
* This bug was _quickly_ found & fixed by just looking at an OSTRA
* generated callgraph 8) -acme
*/
if (rc != 0)
goto out_discard;
out_release:
release_sock(sk);
return rc ? : len;
Expand Down

0 comments on commit 20472af

Please sign in to comment.