lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6fcfa902-5d59-4d2a-9fa6-ea59529f6710@kernel.dk>
Date: Mon, 1 Dec 2025 13:16:28 -0700
From: Jens Axboe <axboe@...nel.dk>
To: syzbot <syzbot+641eec6b7af1f62f2b99@...kaller.appspotmail.com>,
 io-uring@...r.kernel.org, linux-kernel@...r.kernel.org,
 syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [io-uring?] memory leak in io_submit_sqes (5)

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git v6.18

diff --git a/io_uring/poll.c b/io_uring/poll.c
index b9681d0f9f13..5df09e4e958d 100644
--- a/io_uring/poll.c
+++ b/io_uring/poll.c
@@ -922,6 +922,11 @@ int io_poll_remove(struct io_kiocb *req, unsigned int issue_flags)
 		goto out;
 	}
 
+	/*
+	 * Set cancel res early, so io_poll_add() can overwrite it, if
+	 * necessary.
+	 */
+	io_req_set_res(preq, -ECANCELED, 0);
 	if (poll_update->update_events || poll_update->update_user_data) {
 		/* only mask one event flags, keep behavior flags */
 		if (poll_update->update_events) {
@@ -936,12 +941,12 @@ int io_poll_remove(struct io_kiocb *req, unsigned int issue_flags)
 
 		ret2 = io_poll_add(preq, issue_flags & ~IO_URING_F_UNLOCKED);
 		/* successfully updated, don't complete poll request */
-		if (!ret2 || ret2 == -EIOCBQUEUED)
+		if (ret2 == IOU_ISSUE_SKIP_COMPLETE)
 			goto out;
 	}
 
-	req_set_fail(preq);
-	io_req_set_res(preq, -ECANCELED, 0);
+	if (preq->cqe.res < 0)
+		req_set_fail(preq);
 	preq->io_task_work.func = io_req_task_complete;
 	io_req_task_work_add(preq);
 out:

-- 
Jens Axboe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ