2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00

io_uring-6.16-20250718

-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEwPw5LcreJtl1+l5K99NY+ylx4KYFAmh6ZXQQHGF4Ym9lQGtl
 cm5lbC5kawAKCRD301j7KXHgpnaaEACbZ2g4GOk6tGqeatiIuB+HKbf72zkI4JP4
 ffyirNnvXpL2du5pUskhIgqSpLb1S5qq2TlQSNpAAtcmbQuxhAbwrBP+6e3GkdZo
 zb2x2ztRVV1PdgUdE7dYX6NPJ2GzF5tMDH5sDDm8HeaQTHX6Zdv6sXahDYHdhH3a
 lo9yjh3GZp/2fa0N067ECMDPUWWVvhkolxulB4Ek+l11RhEtamIXzU4x8cBVvzVS
 7nmaqES9xnVqwXFbF2/IEi5NfUYxlcxsySgYgUmfFBp8baOFC/dVUFre0wRNiCf2
 BoRCBKG/by6mEccE+M7JTuH/itA2vPvDzYmgXuMk8BgDSwXdcoHm7QUx9PJh8bbU
 3SXw/125VI1DKG5xZReDrRHI6GNSwwhEJLR7oAgBCCxfbiuG99cRKdM3C1HOeN4q
 jP4L1jQnSgD9VYaxrQD0se5191WtR2S6h+tO27W4UiYlOvSMU2hWHE9eZQBohLJb
 2p+jltziAOL0riE8wwY9h0dnPAWSrvs+sf9LrfBtNe3lRDttszhFoJXeJ4SpGs0P
 0xv+gt1Gq1pl1lKCyX+HlXt6wVj5ReYj78iQqLmHIEtFKOfrhCYJVIDyepRG+pKE
 7LnncbfLoYHXcj3eIRj6zsiZh+k43tbGmoKBYmyqhUnu4ySNQpdUBQWP4ZVVjjlx
 zKY3j7fpcw==
 =N6xk
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2025-07-18 12:21:26 -07:00
commit e347810e84
3 changed files with 11 additions and 7 deletions

View File

@ -1738,9 +1738,11 @@ int io_connect(struct io_kiocb *req, unsigned int issue_flags)
int ret; int ret;
bool force_nonblock = issue_flags & IO_URING_F_NONBLOCK; bool force_nonblock = issue_flags & IO_URING_F_NONBLOCK;
if (unlikely(req->flags & REQ_F_FAIL)) { if (connect->in_progress) {
ret = -ECONNRESET; struct poll_table_struct pt = { ._key = EPOLLERR };
goto out;
if (vfs_poll(req->file, &pt) & EPOLLERR)
goto get_sock_err;
} }
file_flags = force_nonblock ? O_NONBLOCK : 0; file_flags = force_nonblock ? O_NONBLOCK : 0;
@ -1765,8 +1767,10 @@ int io_connect(struct io_kiocb *req, unsigned int issue_flags)
* which means the previous result is good. For both of these, * which means the previous result is good. For both of these,
* grab the sock_error() and use that for the completion. * grab the sock_error() and use that for the completion.
*/ */
if (ret == -EBADFD || ret == -EISCONN) if (ret == -EBADFD || ret == -EISCONN) {
get_sock_err:
ret = sock_error(sock_from_file(req->file)->sk); ret = sock_error(sock_from_file(req->file)->sk);
}
} }
if (ret == -ERESTARTSYS) if (ret == -ERESTARTSYS)
ret = -EINTR; ret = -EINTR;

View File

@ -273,8 +273,6 @@ static int io_poll_check_events(struct io_kiocb *req, io_tw_token_t tw)
return IOU_POLL_REISSUE; return IOU_POLL_REISSUE;
} }
} }
if (unlikely(req->cqe.res & EPOLLERR))
req_set_fail(req);
if (req->apoll_events & EPOLLONESHOT) if (req->apoll_events & EPOLLONESHOT)
return IOU_POLL_DONE; return IOU_POLL_DONE;

View File

@ -76,6 +76,8 @@ static int io_import_dmabuf(struct io_zcrx_ifq *ifq,
int dmabuf_fd = area_reg->dmabuf_fd; int dmabuf_fd = area_reg->dmabuf_fd;
int i, ret; int i, ret;
if (off)
return -EINVAL;
if (WARN_ON_ONCE(!ifq->dev)) if (WARN_ON_ONCE(!ifq->dev))
return -EFAULT; return -EFAULT;
if (!IS_ENABLED(CONFIG_DMA_SHARED_BUFFER)) if (!IS_ENABLED(CONFIG_DMA_SHARED_BUFFER))
@ -106,7 +108,7 @@ static int io_import_dmabuf(struct io_zcrx_ifq *ifq,
for_each_sgtable_dma_sg(mem->sgt, sg, i) for_each_sgtable_dma_sg(mem->sgt, sg, i)
total_size += sg_dma_len(sg); total_size += sg_dma_len(sg);
if (total_size < off + len) { if (total_size != len) {
ret = -EINVAL; ret = -EINVAL;
goto err; goto err;
} }