File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -4601,8 +4601,20 @@ static int __init io_uring_init(void)
46014601
46024602 io_uring_optable_init ();
46034603
4604- req_cachep = KMEM_CACHE (io_kiocb , SLAB_HWCACHE_ALIGN | SLAB_PANIC |
4605- SLAB_ACCOUNT | SLAB_TYPESAFE_BY_RCU );
4604+ /*
4605+ * Allow user copy in the per-command field, which starts after the
4606+ * file in io_kiocb and until the opcode field. The openat2 handling
4607+ * requires copying in user memory into the io_kiocb object in that
4608+ * range, and HARDENED_USERCOPY will complain if we haven't
4609+ * correctly annotated this range.
4610+ */
4611+ req_cachep = kmem_cache_create_usercopy ("io_kiocb" ,
4612+ sizeof (struct io_kiocb ), 0 ,
4613+ SLAB_HWCACHE_ALIGN | SLAB_PANIC |
4614+ SLAB_ACCOUNT | SLAB_TYPESAFE_BY_RCU ,
4615+ offsetof(struct io_kiocb , cmd .data ),
4616+ sizeof_field (struct io_kiocb , cmd .data ), NULL );
4617+
46064618 return 0 ;
46074619};
46084620__initcall (io_uring_init );
You can’t perform that action at this time.
0 commit comments