Skip to content

Commit 8e004fa

Browse files
committed
Merge: io_uring/rsrc: require cloned buffers to share accounting contexts
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/368 JIRA: https://issues.redhat.com/browse/RHEL-78677 CVE: CVE-2025-21686 Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Approved-by: Ming Lei <ming.lei@redhat.com> Approved-by: Brian Foster <bfoster@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Jan Stancek <jstancek@redhat.com>
2 parents 15080d5 + 92bbd9a commit 8e004fa

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

io_uring/rsrc.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,6 +1153,13 @@ static int io_clone_buffers(struct io_ring_ctx *ctx, struct io_ring_ctx *src_ctx
11531153
struct io_rsrc_data *data;
11541154
int i, ret, nbufs;
11551155

1156+
/*
1157+
* Accounting state is shared between the two rings; that only works if
1158+
* both rings are accounted towards the same counters.
1159+
*/
1160+
if (ctx->user != src_ctx->user || ctx->mm_account != src_ctx->mm_account)
1161+
return -EINVAL;
1162+
11561163
/*
11571164
* Drop our own lock here. We'll setup the data we need and reference
11581165
* the source buffers, then re-grab, check, and assign at the end.

0 commit comments

Comments
 (0)