[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <cover.1750285100.git.jbaron@akamai.com>
Date: Wed, 18 Jun 2025 19:13:20 -0400
From: Jason Baron <jbaron@...mai.com>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, horms@...nel.org, kuniyu@...zon.com
Subject: [PATCH net-next v2 0/3] Fix netlink rcvbuf wraparound
The sk->sk_rmem_alloc field of a netlink socket can wraparound as a
signed int when comparing to sk->sk_rcvbuf, when sk->sk_rcvbuf approaches
INT_MAX. This can be reproduced by forcing sk->sk_rcvbuf to INT_MAX and
this can exhaust all of memory.
I've added a sock_rcvbuf_has_space() helper function to generalize the
fix as a similar approach has already been implemented for udp sockets.
v2:
-add Fixes:
-add sock_rcvbuf_has_space() helper
-use helper functions for udp netlink
-remove excessive parentheses
Jason Baron (3):
net: add sock_rcvbuf_has_space() helper
udp: use __sock_rcvbuf_has_space() helper
netlink: Fix wraparound of sk->sk_rmem_alloc
include/net/sock.h | 38 ++++++++++++++++++++++++++++++++++++++
net/ipv4/udp.c | 13 ++-----------
net/netlink/af_netlink.c | 35 +++++++++++++++++++++--------------
3 files changed, 61 insertions(+), 25 deletions(-)
--
2.25.1
Powered by blists - more mailing lists