UDP memory usage accounting: fix send buffer check
Subsystems (3)
PATCH 1/3 UDP memory usage accounting: fix send buffer check
This patch introduces sndbuf size check before
memory allcation for send buffer.
Signed-off-by Satoshi Oshima <[email protected]>
Signed-off-by Hideo Aoki <[email protected]>
net/ipv4/ip_output.c +5 -0
@@ -1004,6 +1004,11 @@ alloc_new_skb: frag = &skb_shinfo (skb)->frags[i]; } }else if (i <MAX_SKB_FRAGS ) { +if (atomic_read (&sk->sk_wmem_alloc) +PAGE_SIZE + >2 * sk->sk_sndbuf) { + err = -ENOBUFS ; + goto error; + }if (copy >PAGE_SIZE ) copy =PAGE_SIZE ; page =alloc_pages (sk->sk_allocation,0 );