linux/include/trace/events
David Howells 2c28769a51 rxrpc: Fix recvmsg() unconditional requeue
If rxrpc_recvmsg() fails because MSG_DONTWAIT was specified but the call at
the front of the recvmsg queue already has its mutex locked, it requeues
the call - whether or not the call is already queued.  The call may be on
the queue because MSG_PEEK was also passed and so the call was not dequeued
or because the I/O thread requeued it.

The unconditional requeue may then corrupt the recvmsg queue, leading to
things like UAFs or refcount underruns.

Fix this by only requeuing the call if it isn't already on the queue - and
moving it to the front if it is already queued.  If we don't queue it, we
have to put the ref we obtained by dequeuing it.

Also, MSG_PEEK doesn't dequeue the call so shouldn't call
rxrpc_notify_socket() for the call if we didn't use up all the data on the
queue, so fix that also.

Fixes: 540b1c48c3 ("rxrpc: Fix deadlock between call creation and sendmsg/recvmsg")
Reported-by: Faith <faith@zellic.io>
Reported-by: Pumpkin Chang <pumpkin@devco.re>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Marc Dionne <marc.dionne@auristor.com>
cc: Nir Ohfeld <niro@wiz.io>
cc: Willy Tarreau <w@1wt.eu>
cc: Simon Horman <horms@kernel.org>
cc: linux-afs@lists.infradead.org
cc: stable@kernel.org
Link: https://patch.msgid.link/95163.1768428203@warthog.procyon.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-01-19 10:07:06 -08:00
..
9p.h
afs.h
alarmtimer.h
amdxdna.h
asoc.h
avc.h
bcache.h
block.h
bpf_test_run.h
bridge.h
btrfs.h btrfs: fix NULL dereference on root when tracing inode eviction 2025-12-16 22:53:14 +01:00
cachefiles.h
capability.h
ceph.h ceph: add trace points to the MDS client 2025-12-10 11:50:54 +01:00
cgroup.h
clk.h
cma.h
compaction.h
context_tracking.h
cpuhp.h
csd.h
damon.h
devfreq.h
devlink.h
dlm.h
dma.h
dma_fence.h
erofs.h
error_report.h
exceptions.h
ext4.h ext4: rename EXT4_GET_BLOCKS_PRE_IO 2025-11-26 17:13:33 -05:00
f2fs.h f2fs: optimize trace_f2fs_write_checkpoint with enums 2025-12-04 02:00:06 +00:00
fib.h
fib6.h
filelock.h
filemap.h
firewire.h
firewire_ohci.h
fs_dax.h
fscache.h
fsi.h
fsi_master_aspeed.h
fsi_master_ast_cf.h
fsi_master_gpio.h
fsi_master_i2cr.h
gpio.h
gpu_mem.h
habanalabs.h
handshake.h
host1x.h
huge_memory.h mm/khugepaged: unify SCAN_PMD_NONE and SCAN_PMD_NULL into SCAN_NO_PTE_TABLE 2025-11-24 15:08:52 -08:00
hugetlbfs.h
hw_pressure.h
hwmon.h
i2c.h
i2c_slave.h
ib_mad.h
ib_umad.h
icmp.h
initcall.h
intel-sst.h
intel_ifs.h
intel_ish.h
io_uring.h io_uring/trace: rename io_uring_queue_async_work event "rw" field 2025-12-04 07:18:02 -07:00
iocost.h
iommu.h
ipi.h
irq.h
irq_matrix.h
iscsi.h
jbd2.h
kmem.h
ksm.h
kvm.h
kyber.h
libata.h
lock.h
maple_tree.h
mce.h
mctp.h
mdio.h
memcg.h
memory-failure.h mm/memory-failure: remove the selection of RAS 2025-11-24 15:08:55 -08:00
migrate.h
mlxsw.h
mmap.h
mmap_lock.h
mmc.h
mmflags.h
module.h
mptcp.h
napi.h
nbd.h
neigh.h
net.h
net_probe_common.h
netfs.h
netlink.h
nilfs2.h
nmi.h
notifier.h
objagg.h
oom.h
osnoise.h
page_isolation.h
page_pool.h
page_ref.h
pagemap.h
percpu.h
power.h
power_cpu_migrate.h
preemptirq.h
printk.h
pwc.h
pwm.h
qdisc.h
qla.h
qrtr.h
rcu.h
rdma_core.h
readahead.h
regulator.h
rpcgss.h
rpcrdma.h
rpm.h
rseq.h
rtc.h
rust_sample.h
rwmmio.h
rxrpc.h rxrpc: Fix recvmsg() unconditional requeue 2026-01-19 10:07:06 -08:00
sched.h
sched_ext.h
scmi.h
scsi.h
sctp.h
signal.h
siox.h
skb.h
smbus.h
sock.h
sof.h
sof_intel.h
spi-mem.h
spi.h
spmi.h
sunrpc.h
sunvnet.h
swiotlb.h
syscalls.h
target.h
task.h
tcp.h
tegra_apb_dma.h
thp.h
timer.h
timer_migration.h
timestamp.h
tlb.h x86/mm/tlb/trace: Export the TLB_REMOTE_WRONG_CPU enum in <trace/events/tlb.h> 2025-12-13 11:01:16 +01:00
tsm_mr.h
udp.h
v4l2.h
vb2.h
vmalloc.h
vmscan.h
vsock_virtio_transport_common.h
watchdog.h
wbt.h
workqueue.h
writeback.h
xdp.h
xen.h