From nobody Sun Feb 8 05:30:17 2026 Received: from mail-oo1-f67.google.com (mail-oo1-f67.google.com [209.85.161.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91BB9F513 for ; Sun, 25 Jan 2026 07:53:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.67 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769327627; cv=none; b=tr3aMuHg4y6Di+Z9ZUQmZlIumqvjbE4myYi8ZpZhrDqJVPtzF68T2gVhldt82Qt14nsrXKC4DyNBz7S3Tg87Epvzg39Suk/4p9CPkd8FvmYhVLjquZcZqqqlPpCoKWpPxS0HX5PJ+2PKOao+p32/nC90d83lJkZ4MxAreBEj0uc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769327627; c=relaxed/simple; bh=y9Pi1sKe68oODiWAUWccViyCxgEMk25r1TDK30DicS8=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=HgaksGJO6hklVa/GoDawhxhL5VGPYQyCugsuKpb9tB49CQzKnEpbm311rLHRPz6PbIIKk3mKmrGN61RaRP4gGdbG9HyncLObIjJNyfXFcNNycyz1Zuw77jL8unASkJN5wsDOlUSdbGueCOcsV8sqbYMCAdXn9SGyWxM7+pJ5Q5E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XaSKuXIq; arc=none smtp.client-ip=209.85.161.67 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XaSKuXIq" Received: by mail-oo1-f67.google.com with SMTP id 006d021491bc7-6611b6a55f9so130408eaf.2 for ; Sat, 24 Jan 2026 23:53:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769327624; x=1769932424; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=hHMac+Y7jUcS3qG21NW9q7VLIIJKSsv5RU/hi8sm4Dk=; b=XaSKuXIqLzuuDVe09TH1gRnMAQxnBCPgd8Zrp9aZjHQaPs/PblqLRFdbv9Nd2g0Kfv PbWzaNFixSgmFSm/cim0iNj15teIRDmCzhoQzGcZzo4qykRDB5ftbk+mK7WeS5dJxjYz LTIHwveg9B857WO2t3JmBdxKt2nNTiaVfurWz6pS8AtP6teDJsCJfJZl+laSrZ0ugWPj bicNRGscHxDA+2NhzGZjHfoDKkhHJfz+vY+ODTJIxQb+BTmd2k0eh2C7+n5ZZ3nS1Q/r SPo8oRIi7QQJcZMLJ/6kV4ev/A9HL2cxyHoOpSXZw+kjlyHg87y36T2VCyjofb+82SNT fi4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769327624; x=1769932424; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=hHMac+Y7jUcS3qG21NW9q7VLIIJKSsv5RU/hi8sm4Dk=; b=BXfN9hhMeR+rqMygCd7dXCvF8VApFNOisv3Ypi/vN7S5CQk9Q/YbVEVaBbXjYhm9/C 58Fi71na4z/fkaGCcdGkPhOnZSGmF596egVgpZ/xo05KtZbiFkJfp7qDGFxk5x15NmVD UPwu1QAftj1s2wO2Bap0ircVia9F2CRNFEJBj0yE3RwmZwGMU2i8D2UYGE3FcdQvqth2 3vGISHqVLBxVosSSjEfow3LQWzst/yALg4TGafsyCOnbCxq5y/W4xE+6rT65ZFS+Owdy tRG44K8wOEoC2IB+R3lrVm3lDOBBcckFN0r+q8brZkbfcRM8HHZt8y62ceYvPAD46TOS u7hQ== X-Forwarded-Encrypted: i=1; AJvYcCVvmLlNhRSyTAG9L0bz7rFL4mvMh90utpA1XGcR1Y2vLf/KgjekNl7vYv/sdIAYMIM43vvc0sqasRSdSdo=@vger.kernel.org X-Gm-Message-State: AOJu0YyY5ukiMdqhBxs7JrrJ14bhD0m2asXC2Vrt5X+kVv8e1dtqp+Uv qxn4Gsv3SEk2G7TsaZt1cLaMIFODQOJykYM8EnUUE6vJH1clvic8/u2wu1F3ZTgTQCF+8g== X-Gm-Gg: AZuq6aLzJCuNlDhID9YcLXZx4hVS5ck3fYyIJG7UhgfHWwgHQNV41J1bCXErFtiOn7d bauyXXzrcBD7R1mgyKOkTkU6nY5LY7PWRWHObr9kscDE+My1RP1YHB2XYN6w+7xmBkwWJeXSMk6 5LoOU7UztSnTEky26pcvNZIbeNmo1eI+kz2JPeXHiGIl9jlmBxL9Pa0hzqE/FFg9syKbsvR8R8g K8vdmeAOLNYh+qCpL0ag3SpqmsQzelRcku4trxql45O81nwqvwW7Y1Yp8w8FBCkFXI5cCNrKSr3 0MRTvlmostYjr4acfFa/Pno0TnVzQmD4ahEJ06gDEGNrvnyMUodhNiF5/Eu9Y7AMKQYru4wykeF tpZz8CmEybwl34h+feaBBBz5t+c8tbCZIOkxH0QaBJ/c2VRPyeaK5YVVLbHdNlH3eijSQpQ4Nhh iA X-Received: by 2002:a05:6820:4a18:b0:661:1d11:9a5c with SMTP id 006d021491bc7-662e045d8f5mr382989eaf.1.1769327624253; Sat, 24 Jan 2026 23:53:44 -0800 (PST) Received: from user.. ([140.235.142.61]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-662cb46b991sm3521920eaf.0.2026.01.24.23.53.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jan 2026 23:53:43 -0800 (PST) From: clingfei X-Google-Original-From: clingfei <1599101385@qq.com> To: axboe@kernel.dk Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, clf700383@gmail.com Subject: [PATCH] io_uring: gate personality per opcode to fix TOCTOU check in io_msg_ring_prep Date: Sun, 25 Jan 2026 15:53:02 +0800 Message-Id: <20260125075302.621785-1-1599101385@qq.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Cheng Lingfei Add allow_personality io_issue_def and reject personality use in io_init_req for opcodes that do not permit it. This fixes a TOCTOU window in the prior implementation: userspace could race-update sqe->personality and bypass the __io_msg_ring_prep personality check. Signed-off-by: Cheng Lingfei --- io_uring/io_uring.c | 2 ++ io_uring/msg_ring.c | 2 +- io_uring/opdef.c | 64 +++++++++++++++++++++++++++++++++++++++++++++ io_uring/opdef.h | 2 ++ 4 files changed, 69 insertions(+), 1 deletion(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index b7a077c11c21..7a898b19a340 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -2219,6 +2219,8 @@ static int io_init_req(struct io_ring_ctx *ctx, struc= t io_kiocb *req, personality =3D READ_ONCE(sqe->personality); if (personality) { int ret; + if (unlikely(!def->allow_personality)) + return -EINVAL; =20 req->creds =3D xa_load(&ctx->personalities, personality); if (!req->creds) diff --git a/io_uring/msg_ring.c b/io_uring/msg_ring.c index 7063ea7964e7..758635753da6 100644 --- a/io_uring/msg_ring.c +++ b/io_uring/msg_ring.c @@ -260,7 +260,7 @@ static int io_msg_send_fd(struct io_kiocb *req, unsigne= d int issue_flags) =20 static int __io_msg_ring_prep(struct io_msg *msg, const struct io_uring_sq= e *sqe) { - if (unlikely(sqe->buf_index || sqe->personality)) + if (unlikely(sqe->buf_index)) return -EINVAL; =20 msg->src_file =3D NULL; diff --git a/io_uring/opdef.c b/io_uring/opdef.c index df52d760240e..ee2dfc673fdf 100644 --- a/io_uring/opdef.c +++ b/io_uring/opdef.c @@ -55,6 +55,7 @@ const struct io_issue_def io_issue_defs[] =3D { [IORING_OP_NOP] =3D { .audit_skip =3D 1, .iopoll =3D 1, + .allow_personality =3D 1, .prep =3D io_nop_prep, .issue =3D io_nop, }, @@ -69,6 +70,7 @@ const struct io_issue_def io_issue_defs[] =3D { .iopoll =3D 1, .iopoll_queue =3D 1, .vectored =3D 1, + .allow_personality =3D 1, .async_size =3D sizeof(struct io_async_rw), .prep =3D io_prep_readv, .issue =3D io_read, @@ -84,6 +86,7 @@ const struct io_issue_def io_issue_defs[] =3D { .iopoll =3D 1, .iopoll_queue =3D 1, .vectored =3D 1, + .allow_personality =3D 1, .async_size =3D sizeof(struct io_async_rw), .prep =3D io_prep_writev, .issue =3D io_write, @@ -91,6 +94,7 @@ const struct io_issue_def io_issue_defs[] =3D { [IORING_OP_FSYNC] =3D { .needs_file =3D 1, .audit_skip =3D 1, + .allow_personality =3D 1, .prep =3D io_fsync_prep, .issue =3D io_fsync, }, @@ -103,6 +107,7 @@ const struct io_issue_def io_issue_defs[] =3D { .ioprio =3D 1, .iopoll =3D 1, .iopoll_queue =3D 1, + .allow_personality =3D 1, .async_size =3D sizeof(struct io_async_rw), .prep =3D io_prep_read_fixed, .issue =3D io_read_fixed, @@ -117,6 +122,7 @@ const struct io_issue_def io_issue_defs[] =3D { .ioprio =3D 1, .iopoll =3D 1, .iopoll_queue =3D 1, + .allow_personality =3D 1, .async_size =3D sizeof(struct io_async_rw), .prep =3D io_prep_write_fixed, .issue =3D io_write_fixed, @@ -125,17 +131,20 @@ const struct io_issue_def io_issue_defs[] =3D { .needs_file =3D 1, .unbound_nonreg_file =3D 1, .audit_skip =3D 1, + .allow_personality =3D 1, .prep =3D io_poll_add_prep, .issue =3D io_poll_add, }, [IORING_OP_POLL_REMOVE] =3D { .audit_skip =3D 1, + .allow_personality =3D 1, .prep =3D io_poll_remove_prep, .issue =3D io_poll_remove, }, [IORING_OP_SYNC_FILE_RANGE] =3D { .needs_file =3D 1, .audit_skip =3D 1, + .allow_personality =3D 1, .prep =3D io_sfr_prep, .issue =3D io_sync_file_range, }, @@ -144,6 +153,7 @@ const struct io_issue_def io_issue_defs[] =3D { .unbound_nonreg_file =3D 1, .pollout =3D 1, .ioprio =3D 1, + .allow_personality =3D 1, #if defined(CONFIG_NET) .async_size =3D sizeof(struct io_async_msghdr), .prep =3D io_sendmsg_prep, @@ -158,6 +168,7 @@ const struct io_issue_def io_issue_defs[] =3D { .pollin =3D 1, .buffer_select =3D 1, .ioprio =3D 1, + .allow_personality =3D 1, #if defined(CONFIG_NET) .async_size =3D sizeof(struct io_async_msghdr), .prep =3D io_recvmsg_prep, @@ -168,6 +179,7 @@ const struct io_issue_def io_issue_defs[] =3D { }, [IORING_OP_TIMEOUT] =3D { .audit_skip =3D 1, + .allow_personality =3D 1, .async_size =3D sizeof(struct io_timeout_data), .prep =3D io_timeout_prep, .issue =3D io_timeout, @@ -175,6 +187,7 @@ const struct io_issue_def io_issue_defs[] =3D { [IORING_OP_TIMEOUT_REMOVE] =3D { /* used by timeout updates' prep() */ .audit_skip =3D 1, + .allow_personality =3D 1, .prep =3D io_timeout_remove_prep, .issue =3D io_timeout_remove, }, @@ -184,6 +197,7 @@ const struct io_issue_def io_issue_defs[] =3D { .pollin =3D 1, .poll_exclusive =3D 1, .ioprio =3D 1, /* used for flags */ + .allow_personality =3D 1, #if defined(CONFIG_NET) .prep =3D io_accept_prep, .issue =3D io_accept, @@ -193,11 +207,13 @@ const struct io_issue_def io_issue_defs[] =3D { }, [IORING_OP_ASYNC_CANCEL] =3D { .audit_skip =3D 1, + .allow_personality =3D 1, .prep =3D io_async_cancel_prep, .issue =3D io_async_cancel, }, [IORING_OP_LINK_TIMEOUT] =3D { .audit_skip =3D 1, + .allow_personality =3D 1, .async_size =3D sizeof(struct io_timeout_data), .prep =3D io_link_timeout_prep, .issue =3D io_no_issue, @@ -206,6 +222,7 @@ const struct io_issue_def io_issue_defs[] =3D { .needs_file =3D 1, .unbound_nonreg_file =3D 1, .pollout =3D 1, + .allow_personality =3D 1, #if defined(CONFIG_NET) .async_size =3D sizeof(struct io_async_msghdr), .prep =3D io_connect_prep, @@ -217,25 +234,30 @@ const struct io_issue_def io_issue_defs[] =3D { [IORING_OP_FALLOCATE] =3D { .needs_file =3D 1, .hash_reg_file =3D 1, + .allow_personality =3D 1, .prep =3D io_fallocate_prep, .issue =3D io_fallocate, }, [IORING_OP_OPENAT] =3D { + .allow_personality =3D 1, .prep =3D io_openat_prep, .issue =3D io_openat, }, [IORING_OP_CLOSE] =3D { + .allow_personality =3D 1, .prep =3D io_close_prep, .issue =3D io_close, }, [IORING_OP_FILES_UPDATE] =3D { .audit_skip =3D 1, .iopoll =3D 1, + .allow_personality =3D 1, .prep =3D io_files_update_prep, .issue =3D io_files_update, }, [IORING_OP_STATX] =3D { .audit_skip =3D 1, + .allow_personality =3D 1, .prep =3D io_statx_prep, .issue =3D io_statx, }, @@ -249,6 +271,7 @@ const struct io_issue_def io_issue_defs[] =3D { .ioprio =3D 1, .iopoll =3D 1, .iopoll_queue =3D 1, + .allow_personality =3D 1, .async_size =3D sizeof(struct io_async_rw), .prep =3D io_prep_read, .issue =3D io_read, @@ -263,6 +286,7 @@ const struct io_issue_def io_issue_defs[] =3D { .ioprio =3D 1, .iopoll =3D 1, .iopoll_queue =3D 1, + .allow_personality =3D 1, .async_size =3D sizeof(struct io_async_rw), .prep =3D io_prep_write, .issue =3D io_write, @@ -270,11 +294,13 @@ const struct io_issue_def io_issue_defs[] =3D { [IORING_OP_FADVISE] =3D { .needs_file =3D 1, .audit_skip =3D 1, + .allow_personality =3D 1, .prep =3D io_fadvise_prep, .issue =3D io_fadvise, }, [IORING_OP_MADVISE] =3D { .audit_skip =3D 1, + .allow_personality =3D 1, .prep =3D io_madvise_prep, .issue =3D io_madvise, }, @@ -285,6 +311,7 @@ const struct io_issue_def io_issue_defs[] =3D { .audit_skip =3D 1, .ioprio =3D 1, .buffer_select =3D 1, + .allow_personality =3D 1, #if defined(CONFIG_NET) .async_size =3D sizeof(struct io_async_msghdr), .prep =3D io_sendmsg_prep, @@ -300,6 +327,7 @@ const struct io_issue_def io_issue_defs[] =3D { .buffer_select =3D 1, .audit_skip =3D 1, .ioprio =3D 1, + .allow_personality =3D 1, #if defined(CONFIG_NET) .async_size =3D sizeof(struct io_async_msghdr), .prep =3D io_recvmsg_prep, @@ -309,12 +337,14 @@ const struct io_issue_def io_issue_defs[] =3D { #endif }, [IORING_OP_OPENAT2] =3D { + .allow_personality =3D 1, .prep =3D io_openat2_prep, .issue =3D io_openat2, }, [IORING_OP_EPOLL_CTL] =3D { .unbound_nonreg_file =3D 1, .audit_skip =3D 1, + .allow_personality =3D 1, #if defined(CONFIG_EPOLL) .prep =3D io_epoll_ctl_prep, .issue =3D io_epoll_ctl, @@ -327,18 +357,21 @@ const struct io_issue_def io_issue_defs[] =3D { .hash_reg_file =3D 1, .unbound_nonreg_file =3D 1, .audit_skip =3D 1, + .allow_personality =3D 1, .prep =3D io_splice_prep, .issue =3D io_splice, }, [IORING_OP_PROVIDE_BUFFERS] =3D { .audit_skip =3D 1, .iopoll =3D 1, + .allow_personality =3D 1, .prep =3D io_provide_buffers_prep, .issue =3D io_manage_buffers_legacy, }, [IORING_OP_REMOVE_BUFFERS] =3D { .audit_skip =3D 1, .iopoll =3D 1, + .allow_personality =3D 1, .prep =3D io_remove_buffers_prep, .issue =3D io_manage_buffers_legacy, }, @@ -347,11 +380,13 @@ const struct io_issue_def io_issue_defs[] =3D { .hash_reg_file =3D 1, .unbound_nonreg_file =3D 1, .audit_skip =3D 1, + .allow_personality =3D 1, .prep =3D io_tee_prep, .issue =3D io_tee, }, [IORING_OP_SHUTDOWN] =3D { .needs_file =3D 1, + .allow_personality =3D 1, #if defined(CONFIG_NET) .prep =3D io_shutdown_prep, .issue =3D io_shutdown, @@ -360,22 +395,27 @@ const struct io_issue_def io_issue_defs[] =3D { #endif }, [IORING_OP_RENAMEAT] =3D { + .allow_personality =3D 1, .prep =3D io_renameat_prep, .issue =3D io_renameat, }, [IORING_OP_UNLINKAT] =3D { + .allow_personality =3D 1, .prep =3D io_unlinkat_prep, .issue =3D io_unlinkat, }, [IORING_OP_MKDIRAT] =3D { + .allow_personality =3D 1, .prep =3D io_mkdirat_prep, .issue =3D io_mkdirat, }, [IORING_OP_SYMLINKAT] =3D { + .allow_personality =3D 1, .prep =3D io_symlinkat_prep, .issue =3D io_symlinkat, }, [IORING_OP_LINKAT] =3D { + .allow_personality =3D 1, .prep =3D io_linkat_prep, .issue =3D io_linkat, }, @@ -387,24 +427,29 @@ const struct io_issue_def io_issue_defs[] =3D { }, [IORING_OP_FSETXATTR] =3D { .needs_file =3D 1, + .allow_personality =3D 1, .prep =3D io_fsetxattr_prep, .issue =3D io_fsetxattr, }, [IORING_OP_SETXATTR] =3D { + .allow_personality =3D 1, .prep =3D io_setxattr_prep, .issue =3D io_setxattr, }, [IORING_OP_FGETXATTR] =3D { .needs_file =3D 1, + .allow_personality =3D 1, .prep =3D io_fgetxattr_prep, .issue =3D io_fgetxattr, }, [IORING_OP_GETXATTR] =3D { + .allow_personality =3D 1, .prep =3D io_getxattr_prep, .issue =3D io_getxattr, }, [IORING_OP_SOCKET] =3D { .audit_skip =3D 1, + .allow_personality =3D 1, #if defined(CONFIG_NET) .prep =3D io_socket_prep, .issue =3D io_socket, @@ -418,6 +463,7 @@ const struct io_issue_def io_issue_defs[] =3D { .plug =3D 1, .iopoll =3D 1, .iopoll_queue =3D 1, + .allow_personality =3D 1, .async_size =3D sizeof(struct io_async_cmd), .prep =3D io_uring_cmd_prep, .issue =3D io_uring_cmd, @@ -428,6 +474,7 @@ const struct io_issue_def io_issue_defs[] =3D { .pollout =3D 1, .audit_skip =3D 1, .ioprio =3D 1, + .allow_personality =3D 1, #if defined(CONFIG_NET) .async_size =3D sizeof(struct io_async_msghdr), .prep =3D io_send_zc_prep, @@ -441,6 +488,7 @@ const struct io_issue_def io_issue_defs[] =3D { .unbound_nonreg_file =3D 1, .pollout =3D 1, .ioprio =3D 1, + .allow_personality =3D 1, #if defined(CONFIG_NET) .async_size =3D sizeof(struct io_async_msghdr), .prep =3D io_send_zc_prep, @@ -455,16 +503,19 @@ const struct io_issue_def io_issue_defs[] =3D { .pollin =3D 1, .buffer_select =3D 1, .audit_skip =3D 1, + .allow_personality =3D 1, .async_size =3D sizeof(struct io_async_rw), .prep =3D io_read_mshot_prep, .issue =3D io_read_mshot, }, [IORING_OP_WAITID] =3D { + .allow_personality =3D 1, .async_size =3D sizeof(struct io_waitid_async), .prep =3D io_waitid_prep, .issue =3D io_waitid, }, [IORING_OP_FUTEX_WAIT] =3D { + .allow_personality =3D 1, #if defined(CONFIG_FUTEX) .prep =3D io_futex_prep, .issue =3D io_futex_wait, @@ -473,6 +524,7 @@ const struct io_issue_def io_issue_defs[] =3D { #endif }, [IORING_OP_FUTEX_WAKE] =3D { + .allow_personality =3D 1, #if defined(CONFIG_FUTEX) .prep =3D io_futex_prep, .issue =3D io_futex_wake, @@ -481,6 +533,7 @@ const struct io_issue_def io_issue_defs[] =3D { #endif }, [IORING_OP_FUTEX_WAITV] =3D { + .allow_personality =3D 1, #if defined(CONFIG_FUTEX) .prep =3D io_futexv_prep, .issue =3D io_futexv_wait, @@ -490,16 +543,19 @@ const struct io_issue_def io_issue_defs[] =3D { }, [IORING_OP_FIXED_FD_INSTALL] =3D { .needs_file =3D 1, + .allow_personality =3D 1, .prep =3D io_install_fixed_fd_prep, .issue =3D io_install_fixed_fd, }, [IORING_OP_FTRUNCATE] =3D { .needs_file =3D 1, .hash_reg_file =3D 1, + .allow_personality =3D 1, .prep =3D io_ftruncate_prep, .issue =3D io_ftruncate, }, [IORING_OP_BIND] =3D { + .allow_personality =3D 1, #if defined(CONFIG_NET) .needs_file =3D 1, .prep =3D io_bind_prep, @@ -510,6 +566,7 @@ const struct io_issue_def io_issue_defs[] =3D { #endif }, [IORING_OP_LISTEN] =3D { + .allow_personality =3D 1, #if defined(CONFIG_NET) .needs_file =3D 1, .prep =3D io_listen_prep, @@ -524,6 +581,7 @@ const struct io_issue_def io_issue_defs[] =3D { .unbound_nonreg_file =3D 1, .pollin =3D 1, .ioprio =3D 1, + .allow_personality =3D 1, #if defined(CONFIG_NET) .prep =3D io_recvzc_prep, .issue =3D io_recvzc, @@ -535,6 +593,7 @@ const struct io_issue_def io_issue_defs[] =3D { .needs_file =3D 1, .audit_skip =3D 1, .pollin =3D 1, + .allow_personality =3D 1, #if defined(CONFIG_EPOLL) .prep =3D io_epoll_wait_prep, .issue =3D io_epoll_wait, @@ -552,6 +611,7 @@ const struct io_issue_def io_issue_defs[] =3D { .iopoll =3D 1, .iopoll_queue =3D 1, .vectored =3D 1, + .allow_personality =3D 1, .async_size =3D sizeof(struct io_async_rw), .prep =3D io_prep_readv_fixed, .issue =3D io_read, @@ -567,11 +627,13 @@ const struct io_issue_def io_issue_defs[] =3D { .iopoll =3D 1, .iopoll_queue =3D 1, .vectored =3D 1, + .allow_personality =3D 1, .async_size =3D sizeof(struct io_async_rw), .prep =3D io_prep_writev_fixed, .issue =3D io_write, }, [IORING_OP_PIPE] =3D { + .allow_personality =3D 1, .prep =3D io_pipe_prep, .issue =3D io_pipe, }, @@ -579,6 +641,7 @@ const struct io_issue_def io_issue_defs[] =3D { .audit_skip =3D 1, .iopoll =3D 1, .is_128 =3D 1, + .allow_personality =3D 1, .prep =3D io_nop_prep, .issue =3D io_nop, }, @@ -589,6 +652,7 @@ const struct io_issue_def io_issue_defs[] =3D { .iopoll =3D 1, .iopoll_queue =3D 1, .is_128 =3D 1, + .allow_personality =3D 1, .async_size =3D sizeof(struct io_async_cmd), .prep =3D io_uring_cmd_prep, .issue =3D io_uring_cmd, diff --git a/io_uring/opdef.h b/io_uring/opdef.h index aa37846880ff..f4a98339aa79 100644 --- a/io_uring/opdef.h +++ b/io_uring/opdef.h @@ -29,6 +29,8 @@ struct io_issue_def { unsigned vectored : 1; /* set to 1 if this opcode uses 128b sqes in a mixed sq */ unsigned is_128 : 1; + /* set to 1 if this opcode allows using personality */ + unsigned allow_personality : 1; =20 /* size of async data needed, if any */ unsigned short async_size; --=20 2.34.1