diff options
author | Paolo Abeni <pabeni@redhat.com> | 2016-11-15 16:37:53 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-15 11:59:38 -0500 |
commit | c915fe13cbaae5c7aa7b44f367d05addd60c9008 (patch) | |
tree | b887552a905b9a209b9f800977027b9b8219f37e /include/net/udp.h | |
parent | e6ca4f16a6950537132d0752581c967df2d911c4 (diff) | |
download | op-kernel-dev-c915fe13cbaae5c7aa7b44f367d05addd60c9008.zip op-kernel-dev-c915fe13cbaae5c7aa7b44f367d05addd60c9008.tar.gz |
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 'include/net/udp.h')
-rw-r--r-- | include/net/udp.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/udp.h b/include/net/udp.h index e6e4e19..1661791 100644 --- a/include/net/udp.h +++ b/include/net/udp.h @@ -246,6 +246,7 @@ static inline __be16 udp_flow_src_port(struct net *net, struct sk_buff *skb, } /* net/ipv4/udp.c */ +void udp_destruct_sock(struct sock *sk); void skb_consume_udp(struct sock *sk, struct sk_buff *skb, int len); int __udp_enqueue_schedule_skb(struct sock *sk, struct sk_buff *skb); void udp_skb_destructor(struct sock *sk, struct sk_buff *skb); |