Skip to content

Commit

Permalink
tcp: Schedule rmem for rcvq repair send
Browse files Browse the repository at this point in the history
As noted by Eric, no checks are performed on the data size we're
putting in the read queue during repair. Thus, validate the given
data size with the common rmem management routine.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed May 11, 2012
1 parent 292e8d8 commit 3c961af
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/ipv4/tcp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -4769,6 +4769,9 @@ int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size)
struct tcphdr *th;
bool fragstolen;

if (tcp_try_rmem_schedule(sk, size + sizeof(*th)))
goto err;

skb = alloc_skb(size + sizeof(*th), sk->sk_allocation);
if (!skb)
goto err;
Expand Down

0 comments on commit 3c961af

Please sign in to comment.