linux-stable/io_uring
Jens Axboe a40e90d930 io_uring/sqpoll: work around a potential audit memory leak
[ Upstream commit c4ce0ab276 ]

kmemleak complains that there's a memory leak related to connect
handling:

unreferenced object 0xffff0001093bdf00 (size 128):
comm "iou-sqp-455", pid 457, jiffies 4294894164
hex dump (first 32 bytes):
02 00 fa ea 7f 00 00 01 00 00 00 00 00 00 00 00  ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
backtrace (crc 2e481b1a):
[<00000000c0a26af4>] kmemleak_alloc+0x30/0x38
[<000000009c30bb45>] kmalloc_trace+0x228/0x358
[<000000009da9d39f>] __audit_sockaddr+0xd0/0x138
[<0000000089a93e34>] move_addr_to_kernel+0x1a0/0x1f8
[<000000000b4e80e6>] io_connect_prep+0x1ec/0x2d4
[<00000000abfbcd99>] io_submit_sqes+0x588/0x1e48
[<00000000e7c25e07>] io_sq_thread+0x8a4/0x10e4
[<00000000d999b491>] ret_from_fork+0x10/0x20

which can can happen if:

1) The command type does something on the prep side that triggers an
   audit call.
2) The thread hasn't done any operations before this that triggered
   an audit call inside ->issue(), where we have audit_uring_entry()
   and audit_uring_exit().

Work around this by issuing a blanket NOP operation before the SQPOLL
does anything.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-27 13:52:11 +02:00
..
advise.c
advise.h
alloc_cache.h io_uring: use mempool KASAN hook 2023-12-29 11:58:41 -08:00
cancel.c io_uring/cancel: don't default to setting req->work.cancel_seq 2024-02-08 13:27:06 -07:00
cancel.h io_uring: fix cancellation overwriting req->flags 2024-06-21 14:40:11 +02:00
epoll.c
epoll.h
fdinfo.c io_uring: Fix sqpoll utilization check racing with dying sqpoll 2024-03-09 07:27:09 -07:00
fdinfo.h
filetable.c io_uring: drop any code related to SCM_RIGHTS 2023-12-19 12:36:34 -07:00
filetable.h io_uring: expand main struct io_kiocb flags to 64-bits 2024-02-08 13:27:03 -07:00
fs.c io_uring/fs: consider link->flags when getting path for LINKAT 2023-11-20 09:01:42 -07:00
fs.h
futex.c io_uring/futex: always remove futex entry for cancel all 2024-03-15 15:37:15 -06:00
futex.h io_uring: add support for vectored futex waits 2023-09-29 02:37:08 -06:00
io-wq.c io_uring/io-wq: avoid garbage value of 'match' in io_wq_enqueue() 2024-06-21 14:40:19 +02:00
io-wq.h io_uring: break out of iowq iopoll on teardown 2023-09-07 09:02:27 -06:00
io_uring.c io_uring: fix cancellation overwriting req->flags 2024-06-21 14:40:11 +02:00
io_uring.h io_uring: check for non-NULL file pointer in io_file_can_poll() 2024-06-16 13:51:04 +02:00
kbuf.c io_uring/kbuf: hold io_buffer_list reference over mmap 2024-04-02 19:03:27 -06:00
kbuf.h io_uring/kbuf: hold io_buffer_list reference over mmap 2024-04-02 19:03:27 -06:00
Makefile io-uring: add napi busy poll support 2024-02-09 11:54:19 -07:00
msg_ring.c
msg_ring.h
napi.c io_uring/napi: fix timeout calculation 2024-06-16 13:51:04 +02:00
napi.h io_uring: add register/unregister napi function 2024-02-09 11:54:32 -07:00
net.c io_uring/net: fix sendzc lazy wake polling 2024-05-30 09:44:09 +02:00
net.h
nop.c io_uring: fail NOP if non-zero op flags is passed in 2024-05-30 09:43:59 +02:00
nop.h
notif.c
notif.h
opdef.c io_uring: add support for ftruncate 2024-02-09 09:04:39 -07:00
opdef.h io_uring/rw: mark readv/writev as vectored in the opcode definition 2023-09-21 12:00:46 -06:00
openclose.c io_uring: enable audit and restrict cred override for IORING_OP_FIXED_FD_INSTALL 2024-01-23 15:25:14 -07:00
openclose.h io_uring/openclose: add support for IORING_OP_FIXED_FD_INSTALL 2023-12-12 07:42:57 -07:00
poll.c io_uring: fix poll_remove stalled req completion 2024-03-15 09:36:56 -06:00
poll.h io_uring/rw: ensure poll based multishot read retries appropriately 2024-01-28 20:37:11 -07:00
refs.h
register.c io_uring: add register/unregister napi function 2024-02-09 11:54:32 -07:00
register.h io_uring/register: move io_uring_register(2) related code to register.c 2023-12-19 08:54:20 -07:00
rsrc.c io_uring/rsrc: don't lock while !TASK_RUNNING 2024-06-21 14:40:11 +02:00
rsrc.h io_uring: Don't include af_unix.h. 2024-02-12 19:02:11 -07:00
rw.c io_uring/rw: don't allow multishot reads without NOWAIT support 2024-04-01 11:41:50 -06:00
rw.h io_uring/rw: add separate prep handler for fixed read/write 2023-11-06 07:43:16 -07:00
slist.h
splice.c splice: return type ssize_t from all helpers 2023-12-12 16:19:59 +01:00
splice.h
sqpoll.c io_uring/sqpoll: work around a potential audit memory leak 2024-06-27 13:52:11 +02:00
sqpoll.h io_uring/sqpoll: statistics of the true utilization of sq threads 2024-03-01 06:28:19 -07:00
statx.c
statx.h
sync.c
sync.h
tctx.c
tctx.h
timeout.c io_uring: never overflow io_aux_cqe 2023-08-11 10:42:57 -06:00
timeout.h
truncate.c io_uring: add support for ftruncate 2024-02-09 09:04:39 -07:00
truncate.h io_uring: add support for ftruncate 2024-02-09 09:04:39 -07:00
uring_cmd.c io_uring: Don't include af_unix.h. 2024-02-12 19:02:11 -07:00
uring_cmd.h
waitid.c io_uring/waitid: always remove waitid entry for cancel all 2024-03-15 15:42:49 -06:00
waitid.h io_uring: add IORING_OP_WAITID support 2023-09-21 12:04:45 -06:00
xattr.c io_uring: use file_mnt_idmap helper 2024-02-06 19:55:14 -07:00
xattr.h