All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 net 0/3] udp: Fix two integer overflows when sk->sk_rcvbuf is close to INT_MAX.
@ 2025-03-23 23:09 Kuniyuki Iwashima
  2025-03-23 23:09 ` [PATCH v1 net 1/3] udp: Fix multiple wraparounds of sk->sk_rmem_alloc Kuniyuki Iwashima
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Kuniyuki Iwashima @ 2025-03-23 23:09 UTC (permalink / raw)
  To: Willem de Bruijn, David S. Miller, David Ahern, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni
  Cc: Simon Horman, Kuniyuki Iwashima, Kuniyuki Iwashima, netdev

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.


Kuniyuki Iwashima (3):
  udp: Fix multiple wraparounds of sk->sk_rmem_alloc.
  udp: Fix memory accounting leak.
  selftest: net: Check wraparounds for sk->sk_rmem_alloc.

 net/ipv4/udp.c                          |  18 ++-
 tools/testing/selftests/net/.gitignore  |   1 +
 tools/testing/selftests/net/Makefile    |   2 +-
 tools/testing/selftests/net/so_rcvbuf.c | 178 ++++++++++++++++++++++++
 4 files changed, 188 insertions(+), 11 deletions(-)
 create mode 100644 tools/testing/selftests/net/so_rcvbuf.c

-- 
2.48.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2025-03-25 17:54 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-23 23:09 [PATCH v1 net 0/3] udp: Fix two integer overflows when sk->sk_rcvbuf is close to INT_MAX Kuniyuki Iwashima
2025-03-23 23:09 ` [PATCH v1 net 1/3] udp: Fix multiple wraparounds of sk->sk_rmem_alloc Kuniyuki Iwashima
2025-03-24 10:01   ` Eric Dumazet
2025-03-24 18:00     ` Kuniyuki Iwashima
2025-03-24 14:59   ` Willem de Bruijn
2025-03-24 18:10     ` Kuniyuki Iwashima
2025-03-24 19:44       ` Willem de Bruijn
2025-03-24 20:46         ` Kuniyuki Iwashima
2025-03-25 14:18           ` Willem de Bruijn
2025-03-25 17:53             ` Kuniyuki Iwashima
2025-03-23 23:09 ` [PATCH v1 net 2/3] udp: Fix memory accounting leak Kuniyuki Iwashima
2025-03-23 23:09 ` [PATCH v1 net 3/3] selftest: net: Check wraparounds for sk->sk_rmem_alloc Kuniyuki Iwashima
2025-03-24 15:58   ` Willem de Bruijn
2025-03-24 18:25     ` Kuniyuki Iwashima
2025-03-24 19:31       ` Willem de Bruijn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.