linux/net
David Howells 9f8d0dc0ec kcm: Fix unnecessary psock unreservation.
kcm_write_msgs() calls unreserve_psock() to release its hold on the
underlying TCP socket if it has run out of things to transmit, but if we
have nothing in the write queue on entry (e.g. because someone did a
zero-length sendmsg), we don't actually go into the transmission loop and
as a consequence don't call reserve_psock().

Fix this by skipping the call to unreserve_psock() if we didn't reserve a
psock.

Fixes: c31a25e1db ("kcm: Send multiple frags in one sendmsg()")
Reported-by: syzbot+dd1339599f1840e4cc65@syzkaller.appspotmail.com
Link: https://lore.kernel.org/r/000000000000a61ffe05fe0c3d08@google.com/
Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: syzbot+dd1339599f1840e4cc65@syzkaller.appspotmail.com
cc: Tom Herbert <tom@herbertland.com>
cc: Tom Herbert <tom@quantonium.net>
cc: Jens Axboe <axboe@kernel.dk>
cc: Matthew Wilcox <willy@infradead.org>
Link: https://lore.kernel.org/r/20787.1686828722@warthog.procyon.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-06-17 00:08:27 -07:00
..
6lowpan
9p
802
8021q
appletalk
atm
ax25
batman-adv
bluetooth
bpf
bpfilter
bridge
caif
can
ceph
core net: add check for current MAC address in dev_set_mac_address 2023-06-15 22:54:54 -07:00
dcb
dccp net: ioctl: Use kernel memory on protocol ioctl callbacks 2023-06-15 22:33:26 -07:00
devlink
dns_resolver
dsa
ethernet
ethtool net: create device lookup API with reference tracking 2023-06-15 08:21:11 +01:00
handshake Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-06-15 22:19:41 -07:00
hsr
ieee802154 net: ioctl: Use kernel memory on protocol ioctl callbacks 2023-06-15 22:33:26 -07:00
ife
ipv4 ip, ip6: Fix splice to raw and ping sockets 2023-06-16 11:45:16 -07:00
ipv6 ip, ip6: Fix splice to raw and ping sockets 2023-06-16 11:45:16 -07:00
iucv
kcm kcm: Fix unnecessary psock unreservation. 2023-06-17 00:08:27 -07:00
key
l2tp net: ioctl: Use kernel memory on protocol ioctl callbacks 2023-06-15 22:33:26 -07:00
l3mdev
lapb
llc
mac80211 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-06-15 22:19:41 -07:00
mac802154
mctp
mpls net: move gso declarations and functions to their own files 2023-06-10 00:11:41 -07:00
mptcp net: ioctl: Use kernel memory on protocol ioctl callbacks 2023-06-15 22:33:26 -07:00
ncsi net/ncsi: change from ndo_set_mac_address to dev_set_mac_address 2023-06-09 10:32:51 +01:00
netfilter Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-06-15 22:19:41 -07:00
netlabel netlabel: fix shift wrapping bug in netlbl_catmap_setlong() 2023-06-10 19:54:06 +01:00
netlink netlink: support extack in dump ->start() 2023-06-12 11:32:44 +01:00
netrom
nfc
nsh net: move gso declarations and functions to their own files 2023-06-10 00:11:41 -07:00
openvswitch net: openvswitch: add support for l4 symmetric hashing 2023-06-12 09:46:30 +01:00
packet
phonet net: ioctl: Use kernel memory on protocol ioctl callbacks 2023-06-15 22:33:26 -07:00
psample
qrtr
rds
rfkill
rose
rxrpc
sched Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-06-15 22:19:41 -07:00
sctp net: ioctl: Use kernel memory on protocol ioctl callbacks 2023-06-15 22:33:26 -07:00
smc
strparser
sunrpc sunrpc: Use sendmsg(MSG_SPLICE_PAGES) rather then sendpage 2023-06-12 21:13:23 -07:00
switchdev
tipc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-06-15 22:19:41 -07:00
tls net: tls: make the offload check helper take skb not socket 2023-06-15 09:01:05 +01:00
unix af_unix: Kconfig: make CONFIG_UNIX bool 2023-06-12 10:45:50 +01:00
vmw_vsock
wireless Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-06-15 22:19:41 -07:00
x25
xdp
xfrm net: move gso declarations and functions to their own files 2023-06-10 00:11:41 -07:00
compat.c
devres.c
Kconfig
Kconfig.debug
Makefile
socket.c splice, net: Add a splice_eof op to file-ops and socket-ops 2023-06-08 19:40:30 -07:00
sysctl_net.c