aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/udp.c
diff options
context:
space:
mode:
authorPaolo Abeni <pabeni@redhat.com>2016-11-15 16:37:53 +0100
committerDavid S. Miller <davem@davemloft.net>2016-11-15 11:59:38 -0500
commitc915fe13cbaae5c7aa7b44f367d05addd60c9008 (patch)
treeb887552a905b9a209b9f800977027b9b8219f37e /net/ipv4/udp.c
parentMerge branch 'bpf-lru' (diff)
downloadlinux-dev-c915fe13cbaae5c7aa7b44f367d05addd60c9008.tar.xz
linux-dev-c915fe13cbaae5c7aa7b44f367d05addd60c9008.zip
udplite: fix NULL pointer dereference
The commit 850cbaddb52d ("udp: use it's own memory accounting schema") assumes that the socket proto has memory accounting enabled, but this is not the case for UDPLITE. Fix it enabling memory accounting for UDPLITE and performing fwd allocated memory reclaiming on socket shutdown. UDP and UDPLITE share now the same memory accounting limits. Also drop the backlog receive operation, since is no more needed. Fixes: 850cbaddb52d ("udp: use it's own memory accounting schema") Reported-by: Andrei Vagin <avagin@gmail.com> Suggested-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/udp.c')
-rw-r--r--net/ipv4/udp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index c827e4ea509e..9ae7c63a8b13 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1253,7 +1253,7 @@ drop:
}
EXPORT_SYMBOL_GPL(__udp_enqueue_schedule_skb);
-static void udp_destruct_sock(struct sock *sk)
+void udp_destruct_sock(struct sock *sk)
{
/* reclaim completely the forward allocated memory */
unsigned int total = 0;
@@ -1267,6 +1267,7 @@ static void udp_destruct_sock(struct sock *sk)
inet_sock_destruct(sk);
}
+EXPORT_SYMBOL_GPL(udp_destruct_sock);
int udp_init_sock(struct sock *sk)
{