@@ -3638,6 +3638,11 @@ SYSCALL_DEFINE2(io_uring_setup, u32, entries,
3638
3638
3639
3639
static int __init io_uring_init (void )
3640
3640
{
3641
+ struct kmem_cache_args kmem_args = {
3642
+ .useroffset = offsetof(struct io_kiocb , cmd .data ),
3643
+ .usersize = sizeof_field (struct io_kiocb , cmd .data ),
3644
+ };
3645
+
3641
3646
#define __BUILD_BUG_VERIFY_OFFSET_SIZE (stype , eoffset , esize , ename ) do { \
3642
3647
BUILD_BUG_ON(offsetof(stype, ename) != eoffset); \
3643
3648
BUILD_BUG_ON(sizeof_field(stype, ename) != esize); \
@@ -3722,12 +3727,9 @@ static int __init io_uring_init(void)
3722
3727
* range, and HARDENED_USERCOPY will complain if we haven't
3723
3728
* correctly annotated this range.
3724
3729
*/
3725
- req_cachep = kmem_cache_create_usercopy ("io_kiocb" ,
3726
- sizeof (struct io_kiocb ), 0 ,
3727
- SLAB_HWCACHE_ALIGN | SLAB_PANIC |
3728
- SLAB_ACCOUNT | SLAB_TYPESAFE_BY_RCU ,
3729
- offsetof(struct io_kiocb , cmd .data ),
3730
- sizeof_field (struct io_kiocb , cmd .data ), NULL );
3730
+ req_cachep = kmem_cache_create ("io_kiocb" , sizeof (struct io_kiocb ), & kmem_args ,
3731
+ SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_ACCOUNT |
3732
+ SLAB_TYPESAFE_BY_RCU );
3731
3733
io_buf_cachep = KMEM_CACHE (io_buffer ,
3732
3734
SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_ACCOUNT );
3733
3735
0 commit comments