]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
udp: fix rx queue len reported by diag and proc interface
authorPaolo Abeni <pabeni@redhat.com>
Fri, 8 Jun 2018 09:35:40 +0000 (11:35 +0200)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Fri, 9 Nov 2018 19:00:04 +0000 (17:00 -0200)
commit8b4099fff4506faaf81b3f211cb01ccd30c1a9d1
treedcda9d49483814b749a8aa0c777eebd6a037761f
parentdd319c074f132518690f05aa91b51fc11c4d2d1b
udp: fix rx queue len reported by diag and proc interface

BugLink: http://bugs.launchpad.net/bugs/1800537
[ Upstream commit 6c206b20092a3623184cff9470dba75d21507874 ]

After commit 6b229cf77d68 ("udp: add batching to udp_rmem_release()")
the sk_rmem_alloc field does not measure exactly anymore the
receive queue length, because we batch the rmem release. The issue
is really apparent only after commit 0d4a6608f68c ("udp: do rmem bulk
free even if the rx sk queue is empty"): the user space can easily
check for an empty socket with not-0 queue length reported by the 'ss'
tool or the procfs interface.

We need to use a custom UDP helper to report the correct queue length,
taking into account the forward allocation deficit.

Reported-by: trevor.francis@46labs.com
Fixes: 6b229cf77d68 ("UDP: add batching to udp_rmem_release()")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
include/net/transp_v6.h
include/net/udp.h
net/ipv4/udp.c
net/ipv4/udp_diag.c
net/ipv6/datagram.c
net/ipv6/udp.c