diff options
author | Paolo Abeni <pabeni@redhat.com> | 2016-11-15 18:37:53 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-15 19:59:38 +0300 |
commit | c915fe13cbaae5c7aa7b44f367d05addd60c9008 (patch) | |
tree | b887552a905b9a209b9f800977027b9b8219f37e /net/ipv6/udplite.c | |
parent | e6ca4f16a6950537132d0752581c967df2d911c4 (diff) | |
download | linux-c915fe13cbaae5c7aa7b44f367d05addd60c9008.tar.xz |
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/ipv6/udplite.c')
-rw-r--r-- | net/ipv6/udplite.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv6/udplite.c b/net/ipv6/udplite.c index 47d0d2b87106..2784cc363f2b 100644 --- a/net/ipv6/udplite.c +++ b/net/ipv6/udplite.c @@ -45,10 +45,11 @@ struct proto udplitev6_prot = { .getsockopt = udpv6_getsockopt, .sendmsg = udpv6_sendmsg, .recvmsg = udpv6_recvmsg, - .backlog_rcv = udpv6_queue_rcv_skb, .hash = udp_lib_hash, .unhash = udp_lib_unhash, .get_port = udp_v6_get_port, + .memory_allocated = &udp_memory_allocated, + .sysctl_mem = sysctl_udp_mem, .obj_size = sizeof(struct udp6_sock), .h.udp_table = &udplite_table, #ifdef CONFIG_COMPAT |