deepin-kernel/net
Jakub Kicinski 17e83b78bf netlink: make sure we allow at least one dump skb
commit a215b5723922f8099078478122f02100e489cb80 upstream.

Commit under Fixes tightened up the memory accounting for Netlink
sockets. Looks like the accounting is too strict for some existing
use cases, Marek reported issues with nl80211 / WiFi iw CLI.

To reduce number of iterations Netlink dumps try to allocate
messages based on the size of the buffer passed to previous
recvmsg() calls. If user space uses a larger buffer in recvmsg()
than sk_rcvbuf we will allocate an skb we won't be able to queue.

Make sure we always allow at least one skb to be queued.
Same workaround is already present in netlink_attachskb().
Alternative would be to cap the allocation size to
  rcvbuf - rmem_alloc
but as I said, the workaround is already present in other places.

Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/9794af18-4905-46c6-b12c-365ea2f05858@samsung.com
Fixes: ae8f160e7eb2 ("netlink: Fix wraparounds of sk->sk_rmem_alloc.")
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20250711001121.3649033-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit c31ee1695b6d88042d7bd6b2a77babb70f941451)
2025-07-22 16:16:43 +08:00
..
6lowpan
9p 9p/net: fix improper handling of bogus negative read/write replies 2025-05-09 23:02:50 +08:00
802 net: 802: LLC+SNAP OID:PID lookup on start of skb data 2025-01-19 12:48:46 +08:00
8021q net: vlan: don't propagate flags on open 2025-05-09 18:47:19 +08:00
appletalk
atm atm: clip: Fix NULL pointer dereference in vcc_sendmsg() 2025-07-22 16:16:39 +08:00
ax25 ax25: Remove broken autobind 2025-07-10 21:44:13 +08:00
batman-adv batman-adv: Ignore own maximum aggregation size during RX 2025-04-14 13:52:15 +08:00
bluetooth Bluetooth: HCI: Set extended advertising data synchronously 2025-07-22 16:16:40 +08:00
bpf bpf, test_run: Fix use-after-free issue in eth_skb_pkt_type() 2025-03-14 17:42:52 +08:00
bpfilter
bridge net: bridge: mcast: re-implement br_multicast_{enable, disable}_port functions 2025-07-03 11:32:03 +08:00
caif
can can: bcm: add missing rcu read protection for procfs content 2025-06-10 16:18:03 +08:00
ceph ceph: allocate sparse_ext map only for sparse reads 2025-01-03 15:27:49 +08:00
core net/sched: Fix mirred deadlock on device recursion 2025-07-16 13:29:16 +08:00
dcb
dccp tcp: record last received ipv6 flowlabel 2025-07-02 15:46:51 +08:00
devlink devlink: fix port new reply cmd type 2024-03-26 18:20:11 -04:00
dns_resolver HAOC: Add support for x86 CRED Protection (CREDP). 2025-05-12 15:02:47 +08:00
dsa net: dsa: tag_brcm: legacy: fix pskb_may_pull length 2025-06-20 14:40:11 +08:00
ethernet ethernet: Add helper for assigning packet type when dest address does not match device address 2024-05-05 17:12:09 +08:00
ethtool net: ethtool: Don't call .cleanup_data when prepare_data fails 2025-05-09 18:47:15 +08:00
handshake net/handshake: Fix handshake_req_destroy_test1 2024-02-23 09:24:50 +01:00
hsr net: hsr: fix fill_frame_info() regression vs VLAN packets 2025-02-10 01:59:56 +08:00
ieee802154 net: Rename mono_delivery_time to tstamp_type for scalabilty 2025-05-09 23:16:41 +08:00
ife net: sched: ife: fix potential use-after-free 2024-01-01 12:42:30 +00:00
ipv4 tcp: Correct signedness in skb remaining space calculation 2025-07-22 16:16:38 +08:00
ipv6 gre: Fix IPv6 multicast route creation. 2025-07-22 16:16:41 +08:00
iucv s390/iucv: MSG_PEEK causes memory leak in iucv_sock_destruct() 2024-12-10 20:44:59 +08:00
kcm kcm: Serialise kcm_sendmsg() for the same socket. 2024-12-10 20:40:53 +08:00
key
l2tp ipv6: introduce dst_rt6_info() helper 2024-12-16 00:22:41 +08:00
l3mdev
lapb
llc llc: fix data loss when reading from a socket in llc_ui_recvmsg() 2025-06-10 16:18:04 +08:00
mac80211 wifi: mac80211: drop invalid source address OCB frames 2025-07-14 10:42:17 +08:00
mac802154 mac802154: check local interfaces before deleting sdata list 2025-01-24 10:13:49 +08:00
mctp net: mctp: Ensure keys maintain only one ref to corresponding dev 2025-05-26 10:36:06 +08:00
mpls mpls: Use rcu_dereference_rtnl() in mpls_route_input_rcu(). 2025-07-03 11:32:10 +08:00
mptcp mptcp: sockopt: fix getting freebind & transparent 2025-05-09 22:54:46 +08:00
ncsi net: ncsi: Fix GCPS 64-bit member variables 2025-06-20 14:39:02 +08:00
netfilter netfilter: nf_nat: also check reverse tuple to obtain clashing entry 2025-06-20 14:40:14 +08:00
netlabel calipso: unlock rcu before returning -EAFNOSUPPORT 2025-06-20 14:40:51 +08:00
netlink netlink: make sure we allow at least one dump skb 2025-07-22 16:16:43 +08:00
netrom netrom: check buffer length before accessing it 2025-01-13 11:06:44 +08:00
nfc NFC: nci: uart: Set tty->disc_data only in success path 2025-07-03 11:31:55 +08:00
nsh nsh: Restore skb->{protocol,data,mac_header} for outer header in nsh_gso_segment(). 2024-12-10 20:19:40 +08:00
openvswitch net: openvswitch: Fix the dead loop of MPLS parse 2025-06-20 14:39:29 +08:00
packet packet: add a generic drop reason for receive 2025-07-16 11:03:55 +08:00
phonet phonet: Handle error of rtnl_register_module(). 2024-12-10 20:42:48 +08:00
psample
qrtr net: qrtr: Update packets cloning when broadcasting 2024-12-10 20:42:02 +08:00
rds net:rds: Fix possible deadlock in rds_message_put 2024-12-10 20:40:35 +08:00
rfkill net: rfkill: gpio: Add check for clk_enable() 2024-12-10 20:44:41 +08:00
rose rose: fix dangling neighbour pointers in rose_rt_device_down() 2025-07-14 10:42:14 +08:00
rxrpc rxrpc: Fix oops due to non-existence of prealloc backlog struct 2025-07-22 16:16:40 +08:00
sched net/sched: Abort __tc_modify_qdisc if parent class does not exist 2025-07-22 16:16:39 +08:00
sctp sctp: Do not wake readers in __sctp_write_space() 2025-07-03 11:32:01 +08:00
smc net/smc: use the correct ndev to find pnetid by pnetid table 2025-06-10 10:34:55 +08:00
strparser strparser: Add read_sock callback 2025-03-14 17:42:52 +08:00
sunrpc sunrpc: don't immediately retransmit on seqno miss 2025-07-09 09:49:54 +08:00
switchdev net: switchdev: Convert blocking notification chain to a raw one 2025-03-23 19:26:40 +08:00
tipc tipc: Fix use-after-free in tipc_conn_close(). 2025-07-22 16:16:38 +08:00
tls ktls, sockmap: Fix missing uncharge operation 2025-06-20 14:39:15 +08:00
unix af_unix: Don't set -ECONNRESET for consumed OOB skb. 2025-07-09 09:50:00 +08:00
vmw_vsock vsock: Fix IOCTL_VM_SOCKETS_GET_LOCAL_CID to check also `transport_local` 2025-07-22 16:16:38 +08:00
wireless wifi: prevent A-MSDU attacks in mesh networks 2025-07-22 16:16:41 +08:00
x25 net/x25: fix incorrect parameter validation in the x25_getsockopt() function 2024-03-26 18:19:41 -04:00
xdp xsk: fix an integer overflow in xp_create_and_assign_umem() 2025-04-14 13:52:15 +08:00
xfrm xfrm: Use xdo.dev instead of xdo.real_dev 2025-06-20 14:39:03 +08:00
Kconfig
Kconfig.debug
Makefile af_unix: Remove CONFIG_UNIX_SCM. 2025-06-10 16:18:06 +08:00
OWNERS deepin: OWNERS: Update OWNERS 2025-05-29 18:26:52 +08:00
compat.c
devres.c
socket.c net: explicitly clear the sk pointer, when pf->create fails 2024-12-10 20:42:50 +08:00
sysctl_net.c sysctl: treewide: drop unused argument ctl_table_root::set_ownership(table) 2024-12-10 20:40:09 +08:00