Skip to content

Commit e347810

Browse files
committed
Merge tag 'io_uring-6.16-20250718' of git://git.kernel.dk/linux
Pull io_uring fixes from Jens Axboe: - dmabug offset fix for zcrx - Fix for the POLLERR connect work around handling * tag 'io_uring-6.16-20250718' of git://git.kernel.dk/linux: io_uring/poll: fix POLLERR handling io_uring/zcrx: disallow user selected dmabuf offset and size
2 parents e5ac874 + c7cafd5 commit e347810

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

io_uring/net.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,9 +1738,11 @@ int io_connect(struct io_kiocb *req, unsigned int issue_flags)
17381738
int ret;
17391739
bool force_nonblock = issue_flags & IO_URING_F_NONBLOCK;
17401740

1741-
if (unlikely(req->flags & REQ_F_FAIL)) {
1742-
ret = -ECONNRESET;
1743-
goto out;
1741+
if (connect->in_progress) {
1742+
struct poll_table_struct pt = { ._key = EPOLLERR };
1743+
1744+
if (vfs_poll(req->file, &pt) & EPOLLERR)
1745+
goto get_sock_err;
17441746
}
17451747

17461748
file_flags = force_nonblock ? O_NONBLOCK : 0;
@@ -1765,8 +1767,10 @@ int io_connect(struct io_kiocb *req, unsigned int issue_flags)
17651767
* which means the previous result is good. For both of these,
17661768
* grab the sock_error() and use that for the completion.
17671769
*/
1768-
if (ret == -EBADFD || ret == -EISCONN)
1770+
if (ret == -EBADFD || ret == -EISCONN) {
1771+
get_sock_err:
17691772
ret = sock_error(sock_from_file(req->file)->sk);
1773+
}
17701774
}
17711775
if (ret == -ERESTARTSYS)
17721776
ret = -EINTR;

io_uring/poll.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,6 @@ static int io_poll_check_events(struct io_kiocb *req, io_tw_token_t tw)
273273
return IOU_POLL_REISSUE;
274274
}
275275
}
276-
if (unlikely(req->cqe.res & EPOLLERR))
277-
req_set_fail(req);
278276
if (req->apoll_events & EPOLLONESHOT)
279277
return IOU_POLL_DONE;
280278

io_uring/zcrx.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ static int io_import_dmabuf(struct io_zcrx_ifq *ifq,
7676
int dmabuf_fd = area_reg->dmabuf_fd;
7777
int i, ret;
7878

79+
if (off)
80+
return -EINVAL;
7981
if (WARN_ON_ONCE(!ifq->dev))
8082
return -EFAULT;
8183
if (!IS_ENABLED(CONFIG_DMA_SHARED_BUFFER))
@@ -106,7 +108,7 @@ static int io_import_dmabuf(struct io_zcrx_ifq *ifq,
106108
for_each_sgtable_dma_sg(mem->sgt, sg, i)
107109
total_size += sg_dma_len(sg);
108110

109-
if (total_size < off + len) {
111+
if (total_size != len) {
110112
ret = -EINVAL;
111113
goto err;
112114
}

0 commit comments

Comments
 (0)