Skip to content

udp: Fix two integer overflows when sk->sk_rcvbuf is close to INT_MAX.

Kuniyuki Iwashima netdev 5 versions – Applied

Status from this message: This series was applied to netdev/net.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest2 patches 0 repliesApplied 2/2
  2. v43 patches 8 repliesSuperseded
  3. v33 patches 2 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v23 patches5 repliesSuperseded
v13 patches11 repliesSuperseded

Changes in v5 from the cover letter

* Drop flaky test
* Patch 1
* Update size after skb_condense()

Patches in v5 All 2 applied

#Subject and filesSizeRepliesApplied
1/2udp: Fix multiple wraparounds of sk->sk_rmem_alloc.net/ipv4/udp.c+17 -90 repliesApplied
2/2udp: Fix memory accounting leak.net/ipv4/udp.c+7 -90 repliesApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchWillem de Bruijn
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 net 0/2] udp: Fix two integer overflows when sk->sk_rcvbuf is close to INT_MAX.

I got a report that UDP mem usage in /proc/net/sockstat did not drop even after an application was terminated.

The issue could happen if sk->sk_rmem_alloc wraps around due to a large sk->sk_rcvbuf, which was INT_MAX in our case.

The patch 2 fixes the issue, and the patch 1 fixes yet another overflow I found while investigating the issue.

v5:
* Drop flaky test
* Patch 1
* Update size after skb_condense()

v4:
* Patch 3
* Wait RCU for at most 30 sec

v3: https://lore.kernel.org/netdev/[email protected]/
* Rebase
* Add Willem's tags

v2: https://lore.kernel.org/netdev/[email protected]/
* Patch 1
* Define rmem and rcvbuf as unsigned int (Eric)
* Take skb->truesize into account for sk with large rcvbuf (Willem)

* Patch 3
* Add a comment

v1: https://lore.kernel.org/netdev/[email protected]/

Kuniyuki Iwashima (2):
udp: Fix multiple wraparounds of sk->sk_rmem_alloc.
udp: Fix memory accounting leak.

 net/ipv4/udp.c | 42 ++++++++++++++++++++++++------------------
 1 file changed, 24 insertions(+), 18 deletions(-)
Signature · 1 line
2.48.1